Skip to content

Commit 8d194f5

Browse files
committed
chore: clenup types
1 parent 19c904d commit 8d194f5

19 files changed

+72
-32
lines changed

dist/js/entity/mixins/DefaultableMixin.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { type DefaultableSchemaMixin } from "../../generated/DefaultableSchemaMi
22
import type { AbstractConstructor, Constructor } from "../../utils/types";
33
import { InMemoryEntity } from "../in_memory";
44
export type Defaultable = DefaultableSchemaMixin;
5-
export type DefaultableInMemoryEntity = Defaultable;
65
export type DefaultableInMemoryStaticEntity = {
76
createDefault: () => InMemoryEntity & Defaultable;
87
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { ConsistencyCheck } from "@mat3ra/esse/dist/js/types";
2+
import type { Constructor } from "src/js/utils/types";
23
import { type HasConsistencyChecksSchemaMixin } from "../../generated/HasConsistencyChecksSchemaMixin";
34
import { InMemoryEntity } from "../in_memory";
45
type HasConsistencyChecksProperties = {
56
addConsistencyChecks: (array: ConsistencyCheck[]) => void;
67
};
78
export type HasConsistencyChecks = HasConsistencyChecksSchemaMixin & HasConsistencyChecksProperties;
9+
export type HasConsistencyChecksInMemoryEntityConstructor = Constructor<HasConsistencyChecks>;
810
export declare function hasConsistencyChecksMixin<T extends InMemoryEntity>(item: T): asserts item is T & HasConsistencyChecks;
911
export {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import { type HasMetadataSchemaMixin } from "../../generated/HasMetadataSchemaMixin";
23
import { InMemoryEntity } from "../in_memory";
34
type HasMetadataProperties = {
45
updateMetadata: (object: object) => void;
56
};
67
export type HasMetadata = HasMetadataSchemaMixin & HasMetadataProperties;
8+
export type HasMetadataInMemoryEntityConstructor = Constructor<HasMetadata>;
79
export declare function hasMetadataMixin<T extends InMemoryEntity>(item: T): asserts item is T & HasMetadata;
810
export {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import { InMemoryEntity } from "../in_memory";
23
export type HashedEntity = {
34
calculateHash(): string;
45
getHashObject?(): object;
56
};
7+
export type HashedInMemoryEntityConstructor = Constructor<HashedEntity>;
68
export declare function hashedEntityMixin<T extends InMemoryEntity>(item: T): asserts item is T & HashedEntity;

dist/js/entity/mixins/ImportantSettingsProviderMixin.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import type { InMemoryEntity } from "../in_memory";
23
export interface ContextProvider {
34
domain?: string;
@@ -11,5 +12,6 @@ export type ImportantSettingsProvider = {
1112
type AbstractBase = {
1213
contextProviders: ContextProvider[];
1314
};
15+
export type ImportantSettingsProviderInMemoryEntityConstructor = Constructor<ImportantSettingsProvider>;
1416
export declare function importantSettingsProviderMixin<T extends InMemoryEntity & AbstractBase>(item: T): asserts item is T & ImportantSettingsProvider;
1517
export {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import { type NamedEntitySchemaMixin } from "../../generated/NamedEntitySchemaMixin";
23
import { InMemoryEntity } from "../in_memory";
34
type NamedEntityProperties = {
45
setName: (name: string) => void;
56
};
67
export type NamedEntity = NamedEntitySchemaMixin & NamedEntityProperties;
8+
export type NamedInMemoryEntityConstructor = Constructor<NamedEntity>;
79
export declare function namedEntityMixin<T extends InMemoryEntity>(item: T): asserts item is T & NamedEntity;
810
export {};

dist/js/entity/mixins/RuntimeItemsMixin.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import { type RuntimeItemsSchemaMixin } from "../../generated/RuntimeItemsSchemaMixin";
23
import { InMemoryEntity } from "../in_memory";
34
type RuntimeItemsProperties = {
@@ -8,5 +9,6 @@ type RuntimeItemsProperties = {
89
};
910
};
1011
export type RuntimeItems = RuntimeItemsSchemaMixin & RuntimeItemsProperties;
12+
export type RuntimeItemsInMemoryEntityConstructor = Constructor<RuntimeItems>;
1113
export declare function runtimeItemsMixin<T extends InMemoryEntity>(item: T): asserts item is T & RuntimeItems;
1214
export {};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import type { Constructor } from "src/js/utils/types";
12
import { type TaggableSchemaMixin } from "../../generated/TaggableSchemaMixin";
23
import { InMemoryEntity } from "../in_memory";
34
type TaggableProperties = {
45
setTags: (array: string[]) => void;
56
};
67
export type Taggable = TaggableSchemaMixin & TaggableProperties;
8+
export type TaggableInMemoryEntityConstructor = Constructor<Taggable>;
79
export declare function taggableMixin<T extends InMemoryEntity>(item: T): asserts item is T & Taggable;
810
export {};

dist/js/entity/other.d.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import type { Constructor } from "../utils/types";
21
import { InMemoryEntity } from "./in_memory";
3-
import { type Defaultable } from "./mixins/DefaultableMixin";
4-
import { type HasConsistencyChecks } from "./mixins/HasConsistencyChecksMixin";
5-
import { type HasMetadata } from "./mixins/HasMetadataMixin";
6-
import { type NamedEntity } from "./mixins/NamedEntityMixin";
7-
type DefaultableBase = typeof InMemoryEntity & Constructor<Defaultable>;
8-
type NamedBase = typeof InMemoryEntity & Constructor<NamedEntity>;
9-
type NamedDefaultableBase = typeof InMemoryEntity & Constructor<Defaultable> & Constructor<NamedEntity>;
10-
type HasMetadataNamedDefaultableBase = typeof InMemoryEntity & Constructor<Defaultable> & Constructor<NamedEntity> & Constructor<HasMetadata>;
11-
type HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntityBase = typeof HasMetadataNamedDefaultableInMemoryEntity & Constructor<HasConsistencyChecks>;
2+
import { type DefaultableInMemoryEntityConstructor } from "./mixins/DefaultableMixin";
3+
import { type HasConsistencyChecksInMemoryEntityConstructor } from "./mixins/HasConsistencyChecksMixin";
4+
import { type HasMetadataInMemoryEntityConstructor } from "./mixins/HasMetadataMixin";
5+
import { type NamedInMemoryEntityConstructor } from "./mixins/NamedEntityMixin";
6+
type DefaultableBase = typeof InMemoryEntity & DefaultableInMemoryEntityConstructor;
7+
type NamedBase = typeof InMemoryEntity & NamedInMemoryEntityConstructor;
8+
type NamedDefaultableBase = typeof InMemoryEntity & DefaultableInMemoryEntityConstructor & NamedInMemoryEntityConstructor;
9+
type HasMetadataNamedDefaultableBase = typeof InMemoryEntity & DefaultableInMemoryEntityConstructor & NamedInMemoryEntityConstructor & HasMetadataInMemoryEntityConstructor;
10+
type HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntityBase = typeof InMemoryEntity & DefaultableInMemoryEntityConstructor & NamedInMemoryEntityConstructor & HasConsistencyChecksInMemoryEntityConstructor;
1211
declare const DefaultableInMemoryEntity_base: DefaultableBase;
1312
export declare class DefaultableInMemoryEntity extends DefaultableInMemoryEntity_base {
1413
}

dist/js/entity/other.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.HasConsistencyChecksHasMetadataNamedDefaultableInMemoryEntity = exports.HasMetadataNamedDefaultableInMemoryEntity = exports.NamedDefaultableInMemoryEntity = exports.NamedInMemoryEntity = exports.DefaultableInMemoryEntity = void 0;
44
const in_memory_1 = require("./in_memory");
5-
// import { ContextAndRenderFieldsMixin, ImportantSettingsProviderMixin } from "./mixins/context";
65
const DefaultableMixin_1 = require("./mixins/DefaultableMixin");
76
const HasConsistencyChecksMixin_1 = require("./mixins/HasConsistencyChecksMixin");
8-
// import { HashedEntityMixin } from "./mixins/hash";
97
const HasMetadataMixin_1 = require("./mixins/HasMetadataMixin");
108
const NamedEntityMixin_1 = require("./mixins/NamedEntityMixin");
119
class DefaultableInMemoryEntity extends in_memory_1.InMemoryEntity {

0 commit comments

Comments
 (0)