Typescript support
francisleigh opened this issue ยท 6 comments
Hello,
Enjoying using your lib but i would rather have the methods typed instead of having to always refer to the documentation
is this something you are considering in the future?
There is index.d.ts which contains typescript definitions.
Hey icebob. I do see the fakerator.d.ts file in the repo, but not in the package (I'm on version 0.3.4). Perhaps Francis is experiencing the same issue?
yup! @garrett-mclaughlin
Sorry. The npm skipped the d.ts file at releasing. I've fixed and re-released as 0.3.5
Hey icebox,
tsc reports a bunch of errors (in total 22) in the d.ts file, such as:
error TS2300: Duplicate identifier 'Technics'.
-> Technics = 'flickr',
-> Technics = 'technics',
error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
-> boolean(likelyhood: number = 50): boolean;
error TS2552: Cannot find name 'ITimesOptions'. Did you mean 'TimesOptions'?
-> times(functionWillRepeat: Function, options: ITimesOptions, ...args: Array): Array;
error TS1039: Initializers are not allowed in ambient contexts.
-> public company = new FakeratorCompany();
Any chance to fix this?
I'm not a TS guy, I've just accepted the TS PRs.