@domain-first/types 1.0.6 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/entity.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import type { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  import { type DeepReadonly } from './utils';
3
- export declare const defineEntity: <IdSchema extends StandardSchemaV1, ModelSchema extends StandardSchemaV1>(idSchema: IdSchema, modelSchema: ModelSchema | ((isCurrentEntity: (target: unknown) => boolean) => ModelSchema)) => {
4
- new (id: StandardSchemaV1.InferOutput<IdSchema>, model: StandardSchemaV1.InferOutput<ModelSchema>): {
5
- get model(): DeepReadonly<StandardSchemaV1.InferOutput<ModelSchema>>;
6
- get id(): DeepReadonly<StandardSchemaV1.InferOutput<IdSchema>>;
7
- };
3
+ export declare const defineEntity: <IdSchema extends StandardSchemaV1, ModelSchema extends StandardSchemaV1>(idSchema: IdSchema, modelSchema: ModelSchema | ((isCurrentEntity: (target: unknown) => boolean) => ModelSchema)) => (abstract new (id: StandardSchemaV1.InferInput<IdSchema>, model: StandardSchemaV1.InferInput<ModelSchema>) => {
4
+ get model(): DeepReadonly<StandardSchemaV1.InferOutput<ModelSchema>>;
5
+ get id(): DeepReadonly<StandardSchemaV1.InferOutput<IdSchema>>;
6
+ }) & {
8
7
  readonly idSchema: IdSchema;
9
8
  readonly modelSchema: ModelSchema;
10
- is<T extends abstract new (...args: any[]) => any>(this: T, target: unknown): target is InstanceType<T>;
11
9
  };
12
10
  export type InferEntityModel<T> = T extends {
13
11
  modelSchema: StandardSchemaV1;
package/dist/index.cjs CHANGED
@@ -73,9 +73,6 @@ const defineEntity = (idSchema, modelSchema)=>{
73
73
  value: true
74
74
  });
75
75
  }
76
- static is(target) {
77
- return isThisClass(target);
78
- }
79
76
  get model() {
80
77
  const thisWithSymbol = this;
81
78
  return thisWithSymbol[modelSymbol];
@@ -102,9 +99,6 @@ const defineValueObject = (schema)=>{
102
99
  value: true
103
100
  });
104
101
  }
105
- static is(target) {
106
- return isThisClass(target);
107
- }
108
102
  get model() {
109
103
  const thisWithSymbol = this;
110
104
  return thisWithSymbol[modelSymbol];
package/dist/index.js CHANGED
@@ -38,9 +38,6 @@ const defineEntity = (idSchema, modelSchema)=>{
38
38
  value: true
39
39
  });
40
40
  }
41
- static is(target) {
42
- return isThisClass(target);
43
- }
44
41
  get model() {
45
42
  const thisWithSymbol = this;
46
43
  return thisWithSymbol[modelSymbol];
@@ -67,9 +64,6 @@ const defineValueObject = (schema)=>{
67
64
  value: true
68
65
  });
69
66
  }
70
- static is(target) {
71
- return isThisClass(target);
72
- }
73
67
  get model() {
74
68
  const thisWithSymbol = this;
75
69
  return thisWithSymbol[modelSymbol];
@@ -1,11 +1,9 @@
1
1
  import type { StandardSchemaV1 } from '@standard-schema/spec';
2
2
  import { type DeepReadonly } from './utils';
3
- export declare const defineValueObject: <Schema extends StandardSchemaV1>(schema: Schema | ((isCurrentValueObject: (target: unknown) => boolean) => Schema)) => {
4
- new (data: StandardSchemaV1.InferOutput<Schema>): {
5
- get model(): DeepReadonly<StandardSchemaV1.InferOutput<Schema>>;
6
- };
3
+ export declare const defineValueObject: <Schema extends StandardSchemaV1>(schema: Schema | ((isCurrentValueObject: (target: unknown) => boolean) => Schema)) => (abstract new (data: StandardSchemaV1.InferInput<Schema>) => {
4
+ get model(): DeepReadonly<StandardSchemaV1.InferOutput<Schema>>;
5
+ }) & {
7
6
  readonly schema: Schema;
8
- is<T extends abstract new (...args: any[]) => any>(this: T, target: unknown): target is InstanceType<T>;
9
7
  };
10
8
  export type InferValueObjectSchema<T> = T extends {
11
9
  schema: StandardSchemaV1;
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "ddd",
13
13
  "domain-driven"
14
14
  ],
15
- "version": "1.0.6",
15
+ "version": "2.0.1",
16
16
  "type": "module",
17
17
  "repository": {
18
18
  "type": "git",