Open marcoscaceres opened 3 years ago
I haven't seen a type scheme defined without an actual library. Might be interesting to see an existing case.
I'm thinking of something like: https://www.npmjs.com/package/@types/pluralize
Where the types are delivered independently of the actual library.
I guess then also specref itself would also use them - though it's not really a library in the traditional sense.
That corresponds to the actual library named pluralize
. Anyway there is @types/node
which is obviously not a library and also @types/web-ie11
, so probably doable.
BTW I think getting a JSON schema file would probably be better for multiple language support 👀
Oh cool. Maybe use things like https://www.npmjs.com/package/json-schema-to-typescript to generate TypeScript lib then?
It be nice to have a TypeScript types file, for APIs that consume this.
(I've not had a chance to do something like this before, but would be useful for projects like ReSpec that consume this data)
CC'ing @saschanaz who may provide guidance? 🙏
I think what we need is described in: https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html