Numeral-js icon indicating copy to clipboard operation
Numeral-js copied to clipboard

Add type declarations to package?

Open MisterGoodcat opened this issue 8 years ago • 4 comments

Hi,

at the moment, the type declarations available for numeral seem outdated (see https://www.npmjs.com/package/@types/numeral or directly here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/numeral/index.d.ts). The recommended way instead of keeping separate declarations in the @types/DefinitelyTyped repo is to include them in your NPM package, anyway:

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

Do you see any chance for this?

Thank you!

MisterGoodcat avatar Dec 23 '16 15:12 MisterGoodcat

I do not use type script so if someone would like to create a pull request with this i will add it.

adamwdraper avatar Dec 23 '16 15:12 adamwdraper

Thanks for the quick reply.

Creating an initial type declaration and adding numeral to the exclusion list of definitely typed wouldn't be that hard. The problem however is that it would require monitoring this repo and apply updates continuously, whenever you change your API surface. Even worse, you wouldn't want to keep an outdated version of the declarations in your package, as this would make it really hard for people to integrate proper ones from somewhere else. So, it's not done with a single pull request, and that's some comittment I'm probably not able to keep up. Do you have any regular contributors with a TypeScript background that could take on the task?

MisterGoodcat avatar Dec 23 '16 17:12 MisterGoodcat

Adding typing would definitely help TS devs.

Luyao61 avatar Jan 15 '19 02:01 Luyao61

There are typings already available: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/numeral/index.d.ts

"@types/numeral": "^2.0.4",

bre7 avatar Oct 22 '23 16:10 bre7