From 62e62f962e6598202761bfadb3baaa58b5cbd708 Mon Sep 17 00:00:00 2001
From: Madeorsk
Date: Fri, 4 Oct 2024 17:06:59 +0200
Subject: [PATCH] Add a new model class type.
---
README.md | 2 +-
package.json | 2 +-
src/Model/Model.ts | 9 +++++++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 6290455..cc54130 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
-
+
## Introduction
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;
}