unjs / untyped

Generate types and markdown from a config object.
https://untyped.unjs.io/
MIT License
451 stars 19 forks source link

Potential TS enhancement? #122

Open ineshbose opened 10 months ago

ineshbose commented 10 months ago

Could we use a generic here-

https://github.com/unjs/untyped/blob/a98cf7560c06de400354fe54e250de860b569628/src/utils.ts#L4

export function defineUntypedSchema<T extends SchemaDefinition>(options: T)

Otherwise I don't believe the return value to be strongly-typed; plus I may want to provide the generic explicitly and make sure that options corresponds to it (with appropriate $resolve functions, etc).