ts-interface-builder icon indicating copy to clipboard operation
ts-interface-builder copied to clipboard

feat: Add support for callback signatures

Open diosney opened this issue 6 years ago • 4 comments

Something like:

export interface IHookOnCancel {
  (): void | Promise<void | null>;
}

diosney avatar Jan 15 '19 05:01 diosney

Could you include an example of where it would be useful? In particular, it would help decide how to support such signatures, or if we only need to be able to skip them.

dsagal avatar Jan 15 '19 07:01 dsagal

All the issues I recently created are useful to me righth now on a single feat I need, namely client configuration validation, I mean, validate the configuration that my library users enter.

After some though and testing, I came to realization that maybe using these libraries is not the way to go in my case, but using something like JSON Schema or some other schema validator.

Thanks

diosney avatar Jan 15 '19 13:01 diosney

Perhaps you are right. But that's why I am asking. Call signatures don't make sense for a data descriptor of the kind that you might consider using JSON Schema validator for.

dsagal avatar Jan 15 '19 13:01 dsagal

@dsagal You're right, JSON Schema doesn't have callback signatures, I said it only to say something as an example, which I have to check now how can I overcome that or to find another way to fully validate client configuration entries.

diosney avatar Jan 15 '19 15:01 diosney