Skip to content

@iamcalegari/mongoat / SchemaClass

Type Alias: SchemaClass<T>

SchemaClass<T> = (...args) => T

Defined in: src/types/schema.ts:15

Constructor type of a schema class decorated with @Schema.

A decorated schema class needs no special base class or interface: at runtime it is just a plain constructor (typeof cls === 'function') carrying an internal marker written by the @Schema decorator, which is enough to tell it apart from a plain schema object (never callable, and declaring bsonType directly). This keeps detection reflection-free — no reflect-metadata, no instanceof against a library base class.

Type Parameters

T

T extends object = object

Parameters

args

...never[]

Returns

T