Closed webhacking closed 2 years ago
yo mate post it to @types/cld
thank you in any case :)
it saves my life!
please post it to @types/cld
thanks!
@shtse8 I've been out of the JS loop for some time now. Where do I have to put those definitions to make things work for you?
@shtse8 I've been out of the JS loop for some time now. Where do I have to put those definitions to make things work for you?
It's simple. add the .d.ts
to the project and reference it in package.json
.
everything will be done while you publish your package again.
here is the reference: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
v2.8.0
Thank you @webhacking @shtse8 !
Thanks!!! cld
is the best language detection package I have used.
I can use cld
in typescript now with strict type supported!
but it seems the definition not accuracy.
it is missing async detect
definition. only legacy.
please help to change: from
export declare module 'cld' {
declare function detect(text: string, options: Options, callback: (err: string, result: DetectLanguage) => {});
declare function detect(text: string, callback: (err: string, result: DetectLanguage) => {});
}
to
export declare module 'cld' {
declare function detect(text: string, options: Options, callback: (err: string, result: DetectLanguage) => void): void;
declare function detect(text: string, callback: (err: string, result: DetectLanguage) => void): void;
declare function detect(text: string, options: Options): Promise<DetectLanguage>;
}
@shtse8 thank you. The new version is 2.8.1.
This is my own creation. If there is no official position, I will post it myself.