UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

30 lines (20 loc) 1.49 kB
--- lang: en title: 'API docs: repository.dynamicmodelctor' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository permalink: /doc/en/lb4/apidocs.repository.dynamicmodelctor.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DynamicModelCtor](./repository.dynamicmodelctor.md) ## DynamicModelCtor type A type describing a model class created via `defineModelClass`<!-- -->. Assuming template arguments `BaseCtor` and `Props`<!-- -->, this type describes a class constructor with the following properties: - a constructor function accepting `DataObject<Props>` as the only argument, this argument is optional - all static fields (properties, methods) from `BaseCtor` are inherited and available as static fields on the dynamic class - all prototype fields from `BaseCtor` prototype are inherited and available as prototype fields on the dynamic class <b>Signature:</b> ```typescript export declare type DynamicModelCtor<BaseCtor extends typeof Model, Props extends object> = { new (data?: DataObject<PrototypeOf<BaseCtor> & Props>): PrototypeOf<BaseCtor> & Props; } & BaseCtor; ``` <b>References:</b> [Model](./repository.model.md)<!-- -->, [DataObject](./repository.dataobject.md)<!-- -->, [PrototypeOf](./repository.prototypeof.md)