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) 412 B
import { GenerateSchema } from "../generateSchema"; import { ts } from "ts-morph"; declare const initalizeNewFile: ({ configPath, filePath, identifier, }: GenerateSchema) => { idParent: ts.TypeAliasDeclaration | ts.InterfaceDeclaration | undefined; imports: { [key: string]: string; }; identifiers: { [key: string]: ts.Node; }; }; export default initalizeNewFile;