UNPKG

ts-to-mongo-schema

Version:

Using the Typescript Compiler API, this program parses through Typescript, to generate a JSON Schema that conforms to MongoDB's bson format. Useful when generating large schemas, and being unable to use a javascript or typescript library like Moongoose.

13 lines (12 loc) 395 B
export declare type GenerateSchema = { configPath: string; identifier: string; filePath: string; resolveCustomGenerics?: { [key: string]: (params: any) => any; }; extension: ".tsx" | ".ts"; }; export declare const generateSchema: ({ configPath, filePath, identifier, resolveCustomGenerics, extension }: GenerateSchema) => { [key: string]: any; };