Issue
I'm implementing a library in TypeScript and some functions are as follows:
constructor(type: TypeEnum, params: {[id:string]: any})
The thing is, whenever I use the library using js, I would like my IDE to display every single valid id
of params
. I have seen some libraries already do this, how do I achieve it?
Solution
You can just set them explicitly as properties:
constructor(type: TypeEnum, params: { option1?: any, option2?: any })
Answered By - skara9
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.