monky icon indicating copy to clipboard operation
monky copied to clipboard

Update Typescript Definitions for functions

Open SeanDunford opened this issue 3 years ago • 1 comments

Open to submitting a pr here but haven't dug into where the definitions live in the code yet.

Monky's fixture functionality raise problems for js code intellisense and the typescript compiler because it does not correctly indicate optional parameters. Below you will see 2 examples from my code base.

I believe we can solve these by updating the jsdoc documentation to overload functions for 2 parameters when they are used as promises and by indicating that userParams is optional.

image image

Is there any thought to generate a index.d.ts file for this repo or adopt typescript in any fashion?

SeanDunford avatar May 05 '21 16:05 SeanDunford

Sorry, but I don't use typescript at all, but I'm happy to merge a PR if you've got the time to write up the definitions?

behrendtio avatar May 10 '21 10:05 behrendtio