Skip to content

Function: defineModelSchema() ​

Call Signature ​

defineModelSchema<Schema>(definition): Constructor<MagicAttributes<Schema, Key>> & Constructor<Model> & typeof Model

Defined in: packages/soukai/src/models/schema.ts:8

Type Parameters ​

Schema ​

Schema extends Partial<{ fields: FieldsDefinition<T>; hooks?: ModelHooks; primaryKey: string; timestamps: TimestampsDefinition; }>

Parameters ​

definition ​

Schema

Returns ​

Constructor<MagicAttributes<Schema, Key>> & Constructor<Model> & typeof Model

Call Signature ​

defineModelSchema<BaseModel, Schema>(baseModel, definition): Constructor<MagicAttributes<Schema, Key>> & Constructor<BaseModel> & typeof Model

Defined in: packages/soukai/src/models/schema.ts:11

Type Parameters ​

BaseModel ​

BaseModel extends Model

Schema ​

Schema extends Partial<{ fields: FieldsDefinition<T>; hooks?: ModelHooks; primaryKey: string; timestamps: TimestampsDefinition; }>

Parameters ​

baseModel ​

ModelConstructor<BaseModel>

definition ​

Schema

Returns ​

Constructor<MagicAttributes<Schema, Key>> & Constructor<BaseModel> & typeof Model