import DataType from "../../model/dataTypes/DataType"; import MemberVariable from "../../model/dataTypes/MemberVariable"; export declare const source = "{{!-- Imports --}}\n{{# each imports}} \n{{# if this.systemType}}{{!-- Skip systemType --}}\n{{else}}\n{{!-- Import parent schema explicitly to make sure it has been initialized. --}}\n{{# if (eq this.normalizedName @root.parentDataType.normalizedName) }}\nconst { {{ @root.parentDataType.normalizedName }}Schema } = require('./{{ @root.parentDataType.normalizedName }}');\n{{else}}\nconst { {{ this.normalizedName }}Schema } = require('./allSchemaHeaders.js');\n{{/if}}\n{{/if}}\n{{/each}}\n{{!-- Imports the header (empty schema placeholder to resolve circular dependencies) --}}\nconst { {{ dataType.normalizedName }}Schema } = require('./allSchemaHeaders.js');\n{{!-- Add all parent fields to the schema --}}\n\n{{# if parentDataType }}\n{{ dataType.normalizedName }}Schema.add({{ this.parentDataType.normalizedName }}Schema);\n{{ dataType.normalizedName }}Schema.remove('id');\n{{# if (isMongooseSchemaFunctionIdRequired dataType.normalizedName) }}\n{{ dataType.normalizedName }}Schema.add({\n id: {\n type: String,\n default() {\n return this._id ? this._id.toString() : mongoose.Types.ObjectId().toString();\n }\n }\n });\n{{/if}}\n{{/if}}\n{{!-- Extend schema definition --}}\n{{ dataType.normalizedName }}Schema.add({\n{{# each memberVariables}}\n {{> mongooseMember member=this}},\n{{/each}}\n});\n\nmodule.exports.{{ dataType.normalizedName }}Schema = {{ dataType.normalizedName }}Schema;\n"; export interface TemplateContext { dataType: DataType; parentDataType: DataType | null; memberVariables: Array; imports: Array; } declare const _default: HandlebarsTemplateDelegate; export default _default; //# sourceMappingURL=classTemplate.d.ts.map