Closed ducksoupdev closed 6 years ago
I'm happy to add a Typescript definition file... your file declares format(format: string): string;
, which is just one of the possible signatures for calling format
.
How would you declare the possible variants of duration.format([template] [, precision] [, settings])
? And how do you declare types on the settings object?
Ahh, something like this: https://github.com/moment/moment/blob/develop/moment.d.ts And this is for Moment Duration Format version 1.3: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/moment-duration-format/index.d.ts
I'm going to go ahead and close this PR.
If anyone is interesting in creating a complete typescript definition for the version 2 plugin, a PR would be welcome. Otherwise, hopefully I'll have some time to work on it in the next few weeks.
@jsmreese what is the current state of TypeScript support? Readme states that type definitions were aimed for v2 release.
I have added a Typescript definition file as I am increasingly using this module in Typescript projects and having a definition means editors provide context help on the duration extension method.