File tree Expand file tree Collapse file tree 4 files changed +18
-42
lines changed Expand file tree Collapse file tree 4 files changed +18
-42
lines changed Original file line number Diff line number Diff line change 11import { InMemoryEntity } from "./in_memory" ;
2- declare const InMemoryEntitySet_base : typeof InMemoryEntity & import ( "./set/InMemoryEntitySetBaseMixin" ) . InMemoryEntitySetBaseConstructor & ( new ( ...args : any [ ] ) => {
3- inSet: import ( "./set/InMemoryEntityInSetMixin" ) . InSet [ ] ;
4- } ) & ( new ( ...args : any [ ] ) => {
5- getInSetFilteredByCls ( cls : string ) : {
6- _id : string ;
7- cls ?: string ;
8- slug ?: string ;
9- type ?: string ;
10- index ?: number ;
11- } [ ] ;
12- readonly parentEntitySetReference : {
13- _id: string ;
14- cls?: string ;
15- slug?: string ;
16- type?: string ;
17- index?: number ;
18- } | undefined ;
19- } ) & import ( "./set/InMemoryEntitySetMixin" ) . InMemoryEntitySetConstructor ;
2+ declare const InMemoryEntitySet_base : typeof InMemoryEntity & import ( "./set/InMemoryEntitySetBaseMixin" ) . InMemoryEntitySetBaseConstructor & import ( "./set/InMemoryEntityInSetMixin" ) . InMemoryEntityInSetConstructor & import ( "./set/InMemoryEntitySetMixin" ) . InMemoryEntitySetConstructor ;
203export declare class InMemoryEntitySet extends InMemoryEntitySet_base {
214}
225export { } ;
Original file line number Diff line number Diff line change @@ -3,32 +3,25 @@ import type { Constructor } from "../../utils/types";
33import { type InMemoryEntity } from "../in_memory" ;
44export type SystemInSet = Required < SystemInSetSchema > ;
55export type InSet = SystemInSet [ "inSet" ] [ 0 ] ;
6- declare function schemaMixin < E extends InMemoryEntity > ( item : E ) : {
7- inSet : InSet [ ] ;
8- } ;
9- declare function propertiesMixin < E extends InMemoryEntity > ( item : E & InMemoryEntityInSetSchema ) : {
6+ export declare function inMemoryEntityInSetMixin < E extends InMemoryEntity > ( item : E ) : {
107 getInSetFilteredByCls ( cls : string ) : {
118 _id : string ;
129 cls ?: string ;
1310 slug ?: string ;
1411 type ?: string ;
1512 index ?: number ;
1613 } [ ] ;
17- readonly parentEntitySetReference : {
14+ parentEntitySetReference : {
1815 _id : string ;
1916 cls ?: string ;
2017 slug ?: string ;
2118 type ?: string ;
2219 index ?: number ;
2320 } | undefined ;
21+ inSet : InSet [ ] ;
2422} ;
25- export declare function inMemoryEntityInSetMixin < E extends InMemoryEntity > ( item : E ) : void ;
26- type InMemoryEntityInSetSchema = ReturnType < typeof schemaMixin > ;
27- type InMemoryEntityInSetSchemaConstructor = Constructor < InMemoryEntityInSetSchema > ;
28- type InMemoryEntityInSetProperties = ReturnType < typeof propertiesMixin > ;
29- type InMemoryEntityInSetPropertiesConstructor = Constructor < InMemoryEntityInSetProperties > ;
30- export type InMemoryEntityInSet = InMemoryEntityInSetSchema & InMemoryEntityInSetProperties ;
31- export type InMemoryEntityInSetConstructor = InMemoryEntityInSetSchemaConstructor & InMemoryEntityInSetPropertiesConstructor ;
23+ export type InMemoryEntityInSet = ReturnType < typeof inMemoryEntityInSetMixin > ;
24+ export type InMemoryEntityInSetConstructor = Constructor < InMemoryEntityInSet > ;
3225type Base = Constructor < InMemoryEntity > ;
3326export default function InMemoryEntityInSetMixin < S extends Base = Base > ( superclass : S ) : S & InMemoryEntityInSetConstructor ;
3427export { } ;
Original file line number Diff line number Diff line change @@ -29,8 +29,10 @@ function propertiesMixin(item) {
2929 return properties ;
3030}
3131function inMemoryEntityInSetMixin ( item ) {
32- schemaMixin ( item ) ;
33- propertiesMixin ( item ) ;
32+ return {
33+ ...schemaMixin ( item ) ,
34+ ...propertiesMixin ( item ) ,
35+ } ;
3436}
3537function InMemoryEntityInSetMixin ( superclass ) {
3638 class InMemoryEntityInSetMixin extends superclass {
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { type InMemoryEntity } from "../in_memory";
77export type SystemInSet = Required < SystemInSetSchema > ;
88export type InSet = SystemInSet [ "inSet" ] [ 0 ] ;
99
10+ type InMemoryEntityInSetSchema = ReturnType < typeof schemaMixin > ;
11+
1012function schemaMixin < E extends InMemoryEntity > ( item : E ) {
1113 const schema = {
1214 get inSet ( ) {
@@ -42,18 +44,14 @@ function propertiesMixin<E extends InMemoryEntity>(item: E & InMemoryEntityInSet
4244}
4345
4446export function inMemoryEntityInSetMixin < E extends InMemoryEntity > ( item : E ) {
45- schemaMixin ( item ) ;
46- propertiesMixin ( item as E & InMemoryEntityInSetSchema ) ;
47+ return {
48+ ...schemaMixin ( item ) ,
49+ ...propertiesMixin ( item as E & InMemoryEntityInSetSchema ) ,
50+ } ;
4751}
4852
49- type InMemoryEntityInSetSchema = ReturnType < typeof schemaMixin > ;
50- type InMemoryEntityInSetSchemaConstructor = Constructor < InMemoryEntityInSetSchema > ;
51- type InMemoryEntityInSetProperties = ReturnType < typeof propertiesMixin > ;
52- type InMemoryEntityInSetPropertiesConstructor = Constructor < InMemoryEntityInSetProperties > ;
53-
54- export type InMemoryEntityInSet = InMemoryEntityInSetSchema & InMemoryEntityInSetProperties ;
55- export type InMemoryEntityInSetConstructor = InMemoryEntityInSetSchemaConstructor &
56- InMemoryEntityInSetPropertiesConstructor ;
53+ export type InMemoryEntityInSet = ReturnType < typeof inMemoryEntityInSetMixin > ;
54+ export type InMemoryEntityInSetConstructor = Constructor < InMemoryEntityInSet > ;
5755
5856type Base = Constructor < InMemoryEntity > ;
5957
You can’t perform that action at this time.
0 commit comments