diff --git a/package.json b/package.json index 2724304..ce7280b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sharkitek/core", - "version": "3.0.0", + "version": "3.0.1", "description": "TypeScript library for well-designed model architectures.", "keywords": [ "deserialization", diff --git a/src/Model/Model.ts b/src/Model/Model.ts index f59a9f8..0fd40f0 100644 --- a/src/Model/Model.ts +++ b/src/Model/Model.ts @@ -34,6 +34,11 @@ export type SerializedModel = { */ export type Model = ModelDefinition & PropertiesModel; +/** + * Type of a model class. + */ +export type ModelClass = ConstructorOf>>; + /** * Identifier type. */ @@ -91,7 +96,7 @@ export interface ModelDefinition export function model( shape: Shape, identifier?: Identifier, -): ConstructorOf>> +): ModelClass { // Get shape entries. const shapeEntries = Object.entries(shape) as [keyof Shape, UnknownDefinition][]; @@ -227,5 +232,5 @@ export function model>>; + } as unknown as ModelClass; }