Open NZSmartie opened 9 years ago
Hi @NZSmartie, thanks for the PR. What's the process for keeping these up to date? Would it be possible to auto generate this file if we had JSDoc annotations in the code?
Generating a TypeScript .d.ts file from javascript isn't really possible, jQuery for example is all hand crafted.
However, if tinycolor was written in TypeScript and compiled down to .js, a --declarations
parameter can be passed to tsc
to produce a .d.ts file along side the .js file
Overlooked how some functions were implemented in the tinycolor
namespace, so moved functions to the declare ... var tinycolor
object.
I'm still testing features on it and fixing mistakes as I go
@bgrins, @NZSmartie
A typings file, d.ts
, can now be generated from javascript files via JSDocs via a tsconfig
given the configurations of
{
allowJs: true,
declarations: true,
}
I think
Types are imperative for Javascript projects too. If there are no types shipped with this library, they should at least be published to Definitely Typed.
Ultimately though, this library should be converted to typescript ASAP.
Created a typings file based on the exposed functions defined in README.md
The functions are not annotated with JSDoc yet, this was just enough to compile and run in a RequireJS environment