Skip to content

Commit 6d49433

Browse files
committed
chore: improve toJSON types
1 parent e2d6364 commit 6d49433

File tree

8 files changed

+20
-0
lines changed

8 files changed

+20
-0
lines changed

dist/js/application.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
22
import { type DefaultableInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/DefaultableMixin";
33
import { type NamedInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
44
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
5+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
56
import type { ApplicationSchema } from "@mat3ra/esse/dist/js/types";
67
import { type ApplicationMixin, type ApplicationStaticMixin } from "./applicationMixin";
78
type Base = typeof InMemoryEntity & NamedInMemoryEntityConstructor & DefaultableInMemoryEntityConstructor & Constructor<ApplicationMixin> & ApplicationStaticMixin;
89
declare const Application_base: Base;
910
export default class Application extends Application_base implements ApplicationSchema {
1011
constructor(data?: Partial<ApplicationSchema>);
1112
static createDefault: () => Application;
13+
toJSON: () => ApplicationSchema & AnyObject;
1214
}
1315
export {};

dist/js/executable.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { type DefaultableInMemoryEntityConstructor } from "@mat3ra/code/dist/js/
33
import { type NamedInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
44
import { type RuntimeItemsInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
55
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
6+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
67
import type { ExecutableSchema } from "@mat3ra/esse/dist/js/types";
78
import { type ExecutableMixin } from "./executableMixin";
89
type Base = Constructor<ExecutableMixin> & RuntimeItemsInMemoryEntityConstructor & NamedInMemoryEntityConstructor & DefaultableInMemoryEntityConstructor & typeof InMemoryEntity;
910
declare const Executable_base: Base;
1011
export default class Executable extends Executable_base implements ExecutableSchema {
1112
constructor(data?: Partial<ExecutableSchema>);
1213
static createDefault: () => Executable;
14+
toJSON: () => ExecutableSchema & AnyObject;
1315
}
1416
export {};

dist/js/flavor.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { type DefaultableInMemoryEntityConstructor } from "@mat3ra/code/dist/js/
33
import { NamedInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
44
import { type RuntimeItemsInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
55
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
6+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
67
import type { FlavorSchema } from "@mat3ra/esse/dist/js/types";
78
import { type FlavorMixin } from "./flavorMixin";
89
type Base = typeof InMemoryEntity & Constructor<FlavorMixin> & RuntimeItemsInMemoryEntityConstructor & NamedInMemoryEntityConstructor & DefaultableInMemoryEntityConstructor;
910
declare const Flavor_base: Base;
1011
export default class Flavor extends Flavor_base implements FlavorSchema {
1112
constructor(data?: Partial<FlavorSchema>);
1213
static createDefault: () => Flavor;
14+
toJSON: () => FlavorSchema & AnyObject;
1315
}
1416
export {};

dist/js/template.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
22
import { type NamedInMemoryEntityConstructor } from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
33
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
4+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
45
import type { TemplateSchema } from "@mat3ra/esse/dist/js/types";
56
import { type TemplateMixin, type TemplateStaticMixin } from "./templateMixin";
67
type Base = typeof InMemoryEntity & Constructor<TemplateMixin> & NamedInMemoryEntityConstructor & TemplateStaticMixin;
78
declare const Template_base: Base;
89
export default class Template extends Template_base implements TemplateSchema {
910
constructor(data?: Partial<TemplateSchema>);
11+
toJSON: () => TemplateSchema & AnyObject;
1012
}
1113
export {};

src/js/Application.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
namedEntityMixin,
99
} from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
1010
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
11+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
1112
import type { ApplicationSchema } from "@mat3ra/esse/dist/js/types";
1213

1314
import {
@@ -30,6 +31,8 @@ export default class Application extends (InMemoryEntity as Base) implements App
3031
}
3132

3233
declare static createDefault: () => Application;
34+
35+
declare toJSON: () => ApplicationSchema & AnyObject;
3336
}
3437

3538
namedEntityMixin(Application.prototype);

src/js/Executable.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
runtimeItemsMixin,
1313
} from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
1414
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
15+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
1516
import type { ExecutableSchema } from "@mat3ra/esse/dist/js/types";
1617

1718
import { type ExecutableMixin, executableMixin } from "./executableMixin";
@@ -35,6 +36,8 @@ export default class Executable extends (InMemoryEntity as Base) implements Exec
3536
}
3637

3738
declare static createDefault: () => Executable;
39+
40+
declare toJSON: () => ExecutableSchema & AnyObject;
3841
}
3942

4043
namedEntityMixin(Executable.prototype);

src/js/Flavor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
runtimeItemsMixin,
1313
} from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
1414
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
15+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
1516
import type { FlavorSchema } from "@mat3ra/esse/dist/js/types";
1617

1718
import { type FlavorMixin, flavorMixin } from "./flavorMixin";
@@ -38,6 +39,8 @@ export default class Flavor extends (InMemoryEntity as Base) implements FlavorSc
3839
}
3940

4041
declare static createDefault: () => Flavor;
42+
43+
declare toJSON: () => FlavorSchema & AnyObject;
4144
}
4245

4346
namedEntityMixin(Flavor.prototype);

src/js/Template.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
namedEntityMixin,
55
} from "@mat3ra/code/dist/js/entity/mixins/NamedEntityMixin";
66
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
7+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
78
import type { TemplateSchema } from "@mat3ra/esse/dist/js/types";
89

910
import { type TemplateMixin, type TemplateStaticMixin, templateMixin } from "./templateMixin";
@@ -23,6 +24,8 @@ export default class Template extends (InMemoryEntity as Base) implements Templa
2324
...data,
2425
});
2526
}
27+
28+
declare toJSON: () => TemplateSchema & AnyObject;
2629
}
2730

2831
namedEntityMixin(Template.prototype);

0 commit comments

Comments
 (0)