Closed piotr-musialek-skyrise closed 3 years ago
Unfortunately current type definition is only for the function. There is no way to add more units cause there is no index signature defined and parse['anything'] = generates error.
parse['anything'] =
.d.ts file should have something like this instead:
.d.ts
declare const parse: ((input: string, format?: Units) => number) & { [key: string]: number | null; }; export default parse;
I used the above to overwrite the type and it works fine for me.
Would you mind making a PR? I'm not good at TS at all, I only know //@ts-ignore.
//@ts-ignore
Unfortunately current type definition is only for the function. There is no way to add more units cause there is no index signature defined and
parse['anything'] =
generates error..d.ts
file should have something like this instead:I used the above to overwrite the type and it works fine for me.