@typegoose/typegoose
Version:
Define Mongoose models using TypeScript classes
24 lines (23 loc) • 1.34 kB
TypeScript
import * as mongoose from 'mongoose';
import type { AnyParamConstructor, IBuildSchemaOptions, IModelOptions, INamingOptions } from '../types';
/**
* Internal Schema Builder for Classes
* This Function should not be used directly outside of typegoose internals, use "buildSchema" from typegoose.ts directly
* @param cl The Class to build a Model from
* @param origSch A Schema to clone and extend onto
* @param opt Overwrite SchemaOptions (Merged with Decorator Options)
* @param isFinalSchema Set if this Schema is the final (top-level) to build, only when "true" are discriminators, hooks, virtuals, etc applied
* @param overwriteNaming Overwrite options for name generation
* @param extraOptions Extra options to affect what needs to be done
* @returns Returns the Build Schema
* @private
*/
export declare function _buildSchema<U extends AnyParamConstructor<any>>(cl: U, origSch?: mongoose.Schema<any>, opt?: IModelOptions, isFinalSchema?: boolean, overwriteNaming?: INamingOptions, extraOptions?: IBuildSchemaOptions): mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
[x: string]: any;
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
[x: string]: any;
}>> & mongoose.FlatRecord<{
[x: string]: any;
}> & Required<{
_id: unknown;
}>>;