@vived/core 1.4.3 → 1.4.4
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/README.md +25 -1
- package/dist/cjs/ExampleFeature/Adapters/examplePmAdapter.js +64 -0
- package/dist/cjs/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
- package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +60 -0
- package/dist/cjs/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
- package/dist/cjs/ExampleFeature/Adapters/index.js +19 -0
- package/dist/cjs/ExampleFeature/Adapters/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/Controllers/index.js +19 -0
- package/dist/cjs/ExampleFeature/Controllers/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/Controllers/setExampleText.js +48 -0
- package/dist/cjs/ExampleFeature/Controllers/setExampleText.js.map +1 -0
- package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js +47 -0
- package/dist/cjs/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js +90 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js +113 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js +69 -0
- package/dist/cjs/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
- package/dist/cjs/ExampleFeature/Entities/index.js +20 -0
- package/dist/cjs/ExampleFeature/Entities/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/Factory/index.js +18 -0
- package/dist/cjs/ExampleFeature/Factory/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js +29 -0
- package/dist/cjs/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
- package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js +47 -0
- package/dist/cjs/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
- package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js +48 -0
- package/dist/cjs/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
- package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js +59 -0
- package/dist/cjs/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
- package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +57 -0
- package/dist/cjs/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
- package/dist/cjs/ExampleFeature/Mocks/index.js +21 -0
- package/dist/cjs/ExampleFeature/Mocks/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/PMs/ExamplePM.js +97 -0
- package/dist/cjs/ExampleFeature/PMs/ExamplePM.js.map +1 -0
- package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js +102 -0
- package/dist/cjs/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
- package/dist/cjs/ExampleFeature/PMs/index.js +19 -0
- package/dist/cjs/ExampleFeature/PMs/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js +87 -0
- package/dist/cjs/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
- package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js +79 -0
- package/dist/cjs/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
- package/dist/cjs/ExampleFeature/UCs/index.js +19 -0
- package/dist/cjs/ExampleFeature/UCs/index.js.map +1 -0
- package/dist/cjs/ExampleFeature/index.js +24 -0
- package/dist/cjs/ExampleFeature/index.js.map +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js +61 -0
- package/dist/esm/ExampleFeature/Adapters/examplePmAdapter.js.map +1 -0
- package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js +57 -0
- package/dist/esm/ExampleFeature/Adapters/exampleSingletonPmAdapter.js.map +1 -0
- package/dist/esm/ExampleFeature/Adapters/index.js +3 -0
- package/dist/esm/ExampleFeature/Adapters/index.js.map +1 -0
- package/dist/esm/ExampleFeature/Controllers/index.js +3 -0
- package/dist/esm/ExampleFeature/Controllers/index.js.map +1 -0
- package/dist/esm/ExampleFeature/Controllers/setExampleText.js +45 -0
- package/dist/esm/ExampleFeature/Controllers/setExampleText.js.map +1 -0
- package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js +44 -0
- package/dist/esm/ExampleFeature/Controllers/toggleExampleBoolean.js.map +1 -0
- package/dist/esm/ExampleFeature/Entities/ExampleEntity.js +85 -0
- package/dist/esm/ExampleFeature/Entities/ExampleEntity.js.map +1 -0
- package/dist/esm/ExampleFeature/Entities/ExampleRepo.js +108 -0
- package/dist/esm/ExampleFeature/Entities/ExampleRepo.js.map +1 -0
- package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js +64 -0
- package/dist/esm/ExampleFeature/Entities/ExampleSingletonEntity.js.map +1 -0
- package/dist/esm/ExampleFeature/Entities/index.js +4 -0
- package/dist/esm/ExampleFeature/Entities/index.js.map +1 -0
- package/dist/esm/ExampleFeature/Factory/index.js +2 -0
- package/dist/esm/ExampleFeature/Factory/index.js.map +1 -0
- package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js +26 -0
- package/dist/esm/ExampleFeature/Factory/setupExampleFeature.js.map +1 -0
- package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js +43 -0
- package/dist/esm/ExampleFeature/Mocks/MockEditExampleStringUC.js.map +1 -0
- package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js +44 -0
- package/dist/esm/ExampleFeature/Mocks/MockExamplePM.js.map +1 -0
- package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js +54 -0
- package/dist/esm/ExampleFeature/Mocks/MockExampleSingletonPM.js.map +1 -0
- package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js +52 -0
- package/dist/esm/ExampleFeature/Mocks/MockToggleExampleBooleanUC.js.map +1 -0
- package/dist/esm/ExampleFeature/Mocks/index.js +5 -0
- package/dist/esm/ExampleFeature/Mocks/index.js.map +1 -0
- package/dist/esm/ExampleFeature/PMs/ExamplePM.js +92 -0
- package/dist/esm/ExampleFeature/PMs/ExamplePM.js.map +1 -0
- package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js +97 -0
- package/dist/esm/ExampleFeature/PMs/ExampleSingletonPM.js.map +1 -0
- package/dist/esm/ExampleFeature/PMs/index.js +3 -0
- package/dist/esm/ExampleFeature/PMs/index.js.map +1 -0
- package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js +82 -0
- package/dist/esm/ExampleFeature/UCs/EditExampleStringUC.js.map +1 -0
- package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js +74 -0
- package/dist/esm/ExampleFeature/UCs/ToggleExampleBooleanUC.js.map +1 -0
- package/dist/esm/ExampleFeature/UCs/index.js +3 -0
- package/dist/esm/ExampleFeature/UCs/index.js.map +1 -0
- package/dist/esm/ExampleFeature/index.js +8 -0
- package/dist/esm/ExampleFeature/index.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts +29 -0
- package/dist/types/ExampleFeature/Adapters/examplePmAdapter.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts +31 -0
- package/dist/types/ExampleFeature/Adapters/exampleSingletonPmAdapter.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Adapters/index.d.ts +3 -0
- package/dist/types/ExampleFeature/Adapters/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Controllers/index.d.ts +3 -0
- package/dist/types/ExampleFeature/Controllers/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts +35 -0
- package/dist/types/ExampleFeature/Controllers/setExampleText.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts +34 -0
- package/dist/types/ExampleFeature/Controllers/toggleExampleBoolean.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts +55 -0
- package/dist/types/ExampleFeature/Entities/ExampleEntity.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts +62 -0
- package/dist/types/ExampleFeature/Entities/ExampleRepo.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts +43 -0
- package/dist/types/ExampleFeature/Entities/ExampleSingletonEntity.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Entities/index.d.ts +4 -0
- package/dist/types/ExampleFeature/Entities/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Factory/index.d.ts +2 -0
- package/dist/types/ExampleFeature/Factory/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts +17 -0
- package/dist/types/ExampleFeature/Factory/setupExampleFeature.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts +42 -0
- package/dist/types/ExampleFeature/Mocks/MockEditExampleStringUC.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts +41 -0
- package/dist/types/ExampleFeature/Mocks/MockExamplePM.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts +49 -0
- package/dist/types/ExampleFeature/Mocks/MockExampleSingletonPM.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts +47 -0
- package/dist/types/ExampleFeature/Mocks/MockToggleExampleBooleanUC.d.ts.map +1 -0
- package/dist/types/ExampleFeature/Mocks/index.d.ts +5 -0
- package/dist/types/ExampleFeature/Mocks/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts +42 -0
- package/dist/types/ExampleFeature/PMs/ExamplePM.d.ts.map +1 -0
- package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts +52 -0
- package/dist/types/ExampleFeature/PMs/ExampleSingletonPM.d.ts.map +1 -0
- package/dist/types/ExampleFeature/PMs/index.d.ts +3 -0
- package/dist/types/ExampleFeature/PMs/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts +52 -0
- package/dist/types/ExampleFeature/UCs/EditExampleStringUC.d.ts.map +1 -0
- package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts +44 -0
- package/dist/types/ExampleFeature/UCs/ToggleExampleBooleanUC.d.ts.map +1 -0
- package/dist/types/ExampleFeature/UCs/index.d.ts +3 -0
- package/dist/types/ExampleFeature/UCs/index.d.ts.map +1 -0
- package/dist/types/ExampleFeature/index.d.ts +8 -0
- package/dist/types/ExampleFeature/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExampleSingletonEntity.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a singleton entity in the application.
|
|
5
|
+
* Singleton entities are special entities that exist only once in the application
|
|
6
|
+
* and can be accessed globally from anywhere.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Singleton entities extend AppObjectEntity like regular entities
|
|
10
|
+
* - They register themselves as singletons with appObjects.registerSingleton()
|
|
11
|
+
* - They're accessed through a static get() method using getSingletonComponent()
|
|
12
|
+
* - There's only one instance of a singleton entity in the entire application
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern:
|
|
15
|
+
* 1. Access the singleton entity using the static get() method
|
|
16
|
+
* 2. Access or modify properties via getters/setters
|
|
17
|
+
* 3. Register change observers to react to property updates
|
|
18
|
+
*/
|
|
19
|
+
import { AppObject, AppObjectEntity, AppObjectRepo } from "../../AppObject";
|
|
20
|
+
/**
|
|
21
|
+
* SingletonEntityExample represents a global entity with a boolean property.
|
|
22
|
+
* As a singleton, only one instance exists in the application.
|
|
23
|
+
*/
|
|
24
|
+
export declare abstract class SingletonEntityExample extends AppObjectEntity {
|
|
25
|
+
/** Unique type identifier for this component */
|
|
26
|
+
static readonly type = "SingletonEntityExampleType";
|
|
27
|
+
/** Boolean property accessor methods that must be implemented */
|
|
28
|
+
abstract get aBoolProperty(): boolean;
|
|
29
|
+
abstract set aBoolProperty(val: boolean);
|
|
30
|
+
/**
|
|
31
|
+
* Global accessor for the singleton entity
|
|
32
|
+
* @param appObjects The AppObjectRepo to search in
|
|
33
|
+
* @returns The singleton entity or undefined if not created yet
|
|
34
|
+
*/
|
|
35
|
+
static get: (appObjects: AppObjectRepo) => SingletonEntityExample | undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Factory function to create a new SingletonEntityExample
|
|
39
|
+
* @param appObject The AppObject to attach the entity to
|
|
40
|
+
* @returns A new SingletonEntityExample instance
|
|
41
|
+
*/
|
|
42
|
+
export declare function makeSingletonEntityExample(appObject: AppObject): SingletonEntityExample;
|
|
43
|
+
//# sourceMappingURL=ExampleSingletonEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSingletonEntity.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/ExampleSingletonEntity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACd,MAAM,iBAAiB,CAAC;AAIzB;;;GAGG;AACH,8BAAsB,sBAAuB,SAAQ,eAAe;IAClE,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,iEAAiE;IACjE,QAAQ,KAAK,aAAa,IAAI,OAAO,CAAC;IACtC,QAAQ,KAAK,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE;IAEzC;;;;OAIG;IACH,MAAM,CAAC,GAAG,GACR,YAAY,aAAa,KACxB,sBAAsB,GAAG,SAAS,CAC4B;CAClE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,GACnB,sBAAsB,CAExB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Factory/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* setupExampleFeature.ts
|
|
3
|
+
*
|
|
4
|
+
* This file provides a setup function to initialize the ExampleFeature components.
|
|
5
|
+
* It creates a dedicated AppObject for ExampleFeature and adds all required
|
|
6
|
+
* singleton components to it.
|
|
7
|
+
*/
|
|
8
|
+
import { AppObjectRepo } from "../../AppObject";
|
|
9
|
+
import { SingletonEntityExample } from "../Entities/ExampleSingletonEntity";
|
|
10
|
+
/**
|
|
11
|
+
* Sets up the ExampleFeature by creating an AppObject and attaching required components.
|
|
12
|
+
*
|
|
13
|
+
* @param appObjects - Repository of AppObjects to use for creating the feature
|
|
14
|
+
* @returns The singleton entity instance
|
|
15
|
+
*/
|
|
16
|
+
export declare function setupExampleFeature(appObjects: AppObjectRepo): SingletonEntityExample;
|
|
17
|
+
//# sourceMappingURL=setupExampleFeature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupExampleFeature.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Factory/setupExampleFeature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAA8B,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAIxG;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,aAAa,GAAG,sBAAsB,CAUrF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MockEditExampleStringUC.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a mock UC for testing.
|
|
5
|
+
* Mock UCs extend the real UC classes but override their methods with test implementations.
|
|
6
|
+
* This allows tests to verify that the UC methods are called correctly without
|
|
7
|
+
* actually modifying entities or performing real operations.
|
|
8
|
+
*
|
|
9
|
+
* Key concepts:
|
|
10
|
+
* - Mock UCs extend the real UC classes
|
|
11
|
+
* - They override methods with test implementations (often empty or spy functions)
|
|
12
|
+
* - They're used in unit tests to isolate components from their dependencies
|
|
13
|
+
* - They help verify that methods are called with the correct parameters
|
|
14
|
+
*
|
|
15
|
+
* Usage pattern (in tests):
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // In a test file
|
|
18
|
+
* const mockUC = new MockEditExampleStringUC(appObject);
|
|
19
|
+
* const spy = jest.spyOn(mockUC, 'editExampleString');
|
|
20
|
+
*
|
|
21
|
+
* // Call the function that should use the UC
|
|
22
|
+
* someFunction(appObject);
|
|
23
|
+
*
|
|
24
|
+
* // Verify the UC method was called correctly
|
|
25
|
+
* expect(spy).toHaveBeenCalledWith('expected value');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import { AppObject } from "../../AppObject";
|
|
29
|
+
import { EditExampleStringUC } from "../UCs/EditExampleStringUC";
|
|
30
|
+
/**
|
|
31
|
+
* Mock implementation of EditExampleStringUC for testing
|
|
32
|
+
* Provides a no-op implementation of editExampleString that can be spied on in tests
|
|
33
|
+
*/
|
|
34
|
+
export declare class MockEditExampleStringUC extends EditExampleStringUC {
|
|
35
|
+
/**
|
|
36
|
+
* Mock implementation that does nothing
|
|
37
|
+
* In tests, this can be replaced with a Jest spy to track calls
|
|
38
|
+
*/
|
|
39
|
+
editExampleString: (text: string) => void;
|
|
40
|
+
constructor(appObject: AppObject);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=MockEditExampleStringUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockEditExampleStringUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockEditExampleStringUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,mBAAmB;IAC9D;;;OAGG;IACH,iBAAiB,GAAI,MAAM,MAAM,KAAG,IAAI,CAAO;gBAEnC,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MockExamplePM.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a mock PM for testing.
|
|
5
|
+
* Mock PMs extend the real PM classes but override their methods with test implementations.
|
|
6
|
+
* This allows tests to verify PM behavior without depending on real entities.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Mock PMs extend the real PM classes
|
|
10
|
+
* - They override methods with test implementations
|
|
11
|
+
* - They're used in unit tests to isolate components from their dependencies
|
|
12
|
+
* - They help test adapters and other components that use PMs
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern (in tests):
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In a test file
|
|
17
|
+
* const mockPM = new MockExamplePM(appObject);
|
|
18
|
+
* const addViewSpy = jest.spyOn(mockPM, 'addView');
|
|
19
|
+
*
|
|
20
|
+
* // Test the component that uses the PM
|
|
21
|
+
* adapter.subscribe(id, appObjects, setVM);
|
|
22
|
+
*
|
|
23
|
+
* // Verify the PM method was called correctly
|
|
24
|
+
* expect(addViewSpy).toHaveBeenCalledWith(setVM);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { AppObject } from "../../AppObject";
|
|
28
|
+
import { ExamplePM } from "../PMs/ExamplePM";
|
|
29
|
+
/**
|
|
30
|
+
* Mock implementation of ExamplePM for testing
|
|
31
|
+
* Provides simplified implementations of required methods
|
|
32
|
+
*/
|
|
33
|
+
export declare class MockExamplePM extends ExamplePM {
|
|
34
|
+
/**
|
|
35
|
+
* Simplified implementation that always returns true
|
|
36
|
+
* This avoids the need to implement real comparison logic in tests
|
|
37
|
+
*/
|
|
38
|
+
vmsAreEqual: () => boolean;
|
|
39
|
+
constructor(appObject: AppObject);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=MockExamplePM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockExamplePM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockExamplePM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;GAGG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C;;;OAGG;IACH,WAAW,gBAET;gBAEU,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MockExampleSingletonPM.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a mock singleton PM for testing.
|
|
5
|
+
* Mock singleton PMs extend the real singleton PM classes and provide helper
|
|
6
|
+
* functions to create and access them in tests.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Mock singleton PMs extend the real singleton PM classes
|
|
10
|
+
* - They override methods with test implementations
|
|
11
|
+
* - They include helper functions to create and access them in tests
|
|
12
|
+
* - They're used to test adapters and controllers that depend on singleton PMs
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern (in tests):
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In a test file
|
|
17
|
+
* const mockPM = makeMockExampleSingletonPM(appObjects);
|
|
18
|
+
* const addViewSpy = jest.spyOn(mockPM, 'addView');
|
|
19
|
+
*
|
|
20
|
+
* // Test the component that uses the singleton PM
|
|
21
|
+
* adapter.subscribe(appObjects, setVM);
|
|
22
|
+
*
|
|
23
|
+
* // Verify the PM method was called correctly
|
|
24
|
+
* expect(addViewSpy).toHaveBeenCalledWith(setVM);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { AppObject, AppObjectRepo } from "../../AppObject";
|
|
28
|
+
import { ExampleSingletonPM } from "../PMs/ExampleSingletonPM";
|
|
29
|
+
/**
|
|
30
|
+
* Mock implementation of ExampleSingletonPM for testing
|
|
31
|
+
* Provides simplified implementations of required methods
|
|
32
|
+
*/
|
|
33
|
+
export declare class MockExampleSingletonPM extends ExampleSingletonPM {
|
|
34
|
+
/**
|
|
35
|
+
* Simplified implementation that always returns true
|
|
36
|
+
* This avoids the need to implement real comparison logic in tests
|
|
37
|
+
*/
|
|
38
|
+
vmsAreEqual: () => boolean;
|
|
39
|
+
constructor(appObject: AppObject);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Helper function to create and register a MockExampleSingletonPM
|
|
43
|
+
* Returns the created mock for use in tests
|
|
44
|
+
*
|
|
45
|
+
* @param appObjects The AppObjectRepo to register the mock with
|
|
46
|
+
* @returns A new MockExampleSingletonPM instance
|
|
47
|
+
*/
|
|
48
|
+
export declare function makeMockExampleSingletonPM(appObjects: AppObjectRepo): MockExampleSingletonPM;
|
|
49
|
+
//# sourceMappingURL=MockExampleSingletonPM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockExampleSingletonPM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockExampleSingletonPM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D;;;OAGG;IACH,WAAW,gBAET;gBAEU,SAAS,EAAE,SAAS;CAGjC;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,aAAa,0BAInE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MockToggleExampleBooleanUC.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a mock singleton UC for testing.
|
|
5
|
+
* Mock singleton UCs extend the real UC classes and provide helper functions
|
|
6
|
+
* to create and register them as singletons for tests.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Mock singleton UCs extend the real UC classes
|
|
10
|
+
* - They override methods with test implementations
|
|
11
|
+
* - They register themselves as singletons just like the real UCs
|
|
12
|
+
* - They include helper functions to create them in tests
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern (in tests):
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In a test file
|
|
17
|
+
* const mockUC = makeMockToggleExampleBooleanUC(appObject);
|
|
18
|
+
* const spy = jest.spyOn(mockUC, 'toggleExampleBoolean');
|
|
19
|
+
*
|
|
20
|
+
* // Call the function that should use the UC
|
|
21
|
+
* toggleExampleBoolean(appObjects);
|
|
22
|
+
*
|
|
23
|
+
* // Verify the UC method was called correctly
|
|
24
|
+
* expect(spy).toHaveBeenCalled();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
import { AppObject } from "../../AppObject";
|
|
28
|
+
import { ToggleExampleBooleanUC } from "../UCs/ToggleExampleBooleanUC";
|
|
29
|
+
/**
|
|
30
|
+
* Mock implementation of ToggleExampleBooleanUC for testing
|
|
31
|
+
* Provides a no-op implementation of toggleExampleBoolean that can be spied on in tests
|
|
32
|
+
*/
|
|
33
|
+
export declare class MockToggleExampleBooleanUC extends ToggleExampleBooleanUC {
|
|
34
|
+
/**
|
|
35
|
+
* Mock implementation that does nothing
|
|
36
|
+
* In tests, this can be replaced with a Jest spy to track calls
|
|
37
|
+
*/
|
|
38
|
+
toggleExampleBoolean: () => void;
|
|
39
|
+
constructor(appObject: AppObject);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Helper factory function to create a mock ToggleExampleBooleanUC
|
|
43
|
+
* @param appObject The AppObject to attach the UC to
|
|
44
|
+
* @returns A new MockToggleExampleBooleanUC instance
|
|
45
|
+
*/
|
|
46
|
+
export declare function makeMockToggleExampleBooleanUC(appObject: AppObject): MockToggleExampleBooleanUC;
|
|
47
|
+
//# sourceMappingURL=MockToggleExampleBooleanUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockToggleExampleBooleanUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/MockToggleExampleBooleanUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,sBAAsB;IACpE;;;OAGG;IACH,oBAAoB,QAAO,IAAI,CAAO;gBAE1B,SAAS,EAAE,SAAS;CAKjC;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,SAAS,GACnB,0BAA0B,CAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/Mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExamplePM.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a Presentation Manager (PM) component.
|
|
5
|
+
* PMs are responsible for transforming entity data into view models (VMs) for the UI.
|
|
6
|
+
* They observe entities for changes and update their views when data changes.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - PMs extend AppObjectPM<VM> where VM is the view model type
|
|
10
|
+
* - They observe entities and transform entity data into view models
|
|
11
|
+
* - They notify UI components (views) when view models change
|
|
12
|
+
* - Each PM instance is associated with a specific AppObject
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern:
|
|
15
|
+
* 1. Get a PM instance using getById
|
|
16
|
+
* 2. Register UI components as views using addView(callback)
|
|
17
|
+
* 3. PM will call the view callbacks with updated view models when entities change
|
|
18
|
+
* 4. Remove UI components with removeView(callback) when they're unmounted
|
|
19
|
+
*/
|
|
20
|
+
import { AppObject, AppObjectPM, AppObjectRepo } from "../../AppObject";
|
|
21
|
+
/**
|
|
22
|
+
* ExamplePM transforms ExampleEntity data into a simple string view model.
|
|
23
|
+
* Abstract class provides the interface and static helper methods.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class ExamplePM extends AppObjectPM<string> {
|
|
26
|
+
/** Unique type identifier for this component */
|
|
27
|
+
static readonly type = "ExamplePMType";
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves an ExamplePM by its parent AppObject's ID
|
|
30
|
+
* @param id The ID of the parent AppObject
|
|
31
|
+
* @param appObjects The AppObjectRepo to search in
|
|
32
|
+
* @returns The ExamplePM component or undefined if not found
|
|
33
|
+
*/
|
|
34
|
+
static getById(id: string, appObjects: AppObjectRepo): ExamplePM | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Factory function to create a new ExamplePM
|
|
38
|
+
* @param appObject The AppObject to attach the PM to
|
|
39
|
+
* @returns A new ExamplePM instance
|
|
40
|
+
*/
|
|
41
|
+
export declare function makeExamplePM(appObject: AppObject): ExamplePM;
|
|
42
|
+
//# sourceMappingURL=ExamplePM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExamplePM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/PMs/ExamplePM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGxE;;;GAGG;AACH,8BAAsB,SAAU,SAAQ,WAAW,CAAC,MAAM,CAAC;IACzD,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,mBAAmB;IAEvC;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa;CAGrD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExampleSingletonPM.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a Singleton Presentation Manager (PM).
|
|
5
|
+
* Singleton PMs are special PMs that exist only once in the application and can be
|
|
6
|
+
* accessed globally. They transform data from singleton entities into view models.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Singleton PMs extend AppObjectPM<VM> like regular PMs
|
|
10
|
+
* - They register themselves as singletons with appObjects.registerSingleton()
|
|
11
|
+
* - They're accessed through a static get() method using getSingletonComponent()
|
|
12
|
+
* - They typically observe singleton entities and provide data to multiple UI components
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern:
|
|
15
|
+
* 1. Access the singleton PM using the static get() method
|
|
16
|
+
* 2. Register UI components as views using addView(callback)
|
|
17
|
+
* 3. PM will call the view callbacks with updated view models when entities change
|
|
18
|
+
* 4. Remove UI components with removeView(callback) when they're unmounted
|
|
19
|
+
*/
|
|
20
|
+
import { AppObject, AppObjectPM, AppObjectRepo } from "../../AppObject";
|
|
21
|
+
/**
|
|
22
|
+
* Interface defining the structure of the view model provided by ExampleSingletonPM
|
|
23
|
+
*/
|
|
24
|
+
export interface ExampleVM {
|
|
25
|
+
aBoolProperty: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* ExampleSingletonPM transforms SingletonEntityExample data into an ExampleVM.
|
|
29
|
+
* As a singleton, only one instance exists in the application.
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class ExampleSingletonPM extends AppObjectPM<ExampleVM> {
|
|
32
|
+
/** Unique type identifier for this component */
|
|
33
|
+
static readonly type = "ExampleSingletonPMType";
|
|
34
|
+
/**
|
|
35
|
+
* Global accessor for the singleton PM
|
|
36
|
+
* @param appObjects The AppObjectRepo to search in
|
|
37
|
+
* @returns The singleton PM or undefined if not created yet
|
|
38
|
+
*/
|
|
39
|
+
static get: (appObjects: AppObjectRepo) => ExampleSingletonPM | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Default view model used when no data is available
|
|
43
|
+
* UI components can use this initially or when the PM is not found
|
|
44
|
+
*/
|
|
45
|
+
export declare const defaultSlideNavigationVM: ExampleVM;
|
|
46
|
+
/**
|
|
47
|
+
* Factory function to create a new ExampleSingletonPM
|
|
48
|
+
* @param appObject The AppObject to attach the PM to
|
|
49
|
+
* @returns A new ExampleSingletonPM instance
|
|
50
|
+
*/
|
|
51
|
+
export declare function makeExampleSingletonPM(appObject: AppObject): ExampleSingletonPM;
|
|
52
|
+
//# sourceMappingURL=ExampleSingletonPM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSingletonPM.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/PMs/ExampleSingletonPM.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACd,MAAM,iBAAiB,CAAC;AAIzB;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,8BAAsB,kBAAmB,SAAQ,WAAW,CAAC,SAAS,CAAC;IACrE,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,4BAA4B;IAEhD;;;;OAIG;IACH,MAAM,CAAC,GAAG,GAAI,YAAY,aAAa,KAAG,kBAAkB,GAAG,SAAS,CACX;CAC9D;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAEtC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAEpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/PMs/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditExampleStringUC.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a Use Case (UC) component.
|
|
5
|
+
* UCs handle business logic and operations that modify entities.
|
|
6
|
+
* They encapsulate specific actions that can be performed in the application.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - UCs extend AppObjectUC and provide methods for specific operations
|
|
10
|
+
* - They implement business logic for modifying entities
|
|
11
|
+
* - They validate inputs and handle errors
|
|
12
|
+
* - Each UC instance is associated with a specific AppObject
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern:
|
|
15
|
+
* 1. Get a UC instance using getById or get
|
|
16
|
+
* 2. Call the UC's methods to perform operations
|
|
17
|
+
* 3. The UC will update entities, which will trigger PM updates and UI refreshes
|
|
18
|
+
*/
|
|
19
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "../../AppObject";
|
|
20
|
+
/**
|
|
21
|
+
* EditExampleStringUC provides functionality to update the string property of an ExampleEntity.
|
|
22
|
+
* Abstract class provides the interface and static helper methods.
|
|
23
|
+
*/
|
|
24
|
+
export declare abstract class EditExampleStringUC extends AppObjectUC {
|
|
25
|
+
/** Unique type identifier for this component */
|
|
26
|
+
static readonly type = "EditExampleStringUCType";
|
|
27
|
+
/**
|
|
28
|
+
* Updates the string property of the associated ExampleEntity
|
|
29
|
+
* @param text The new string value to set
|
|
30
|
+
*/
|
|
31
|
+
abstract editExampleString(text: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves an EditExampleStringUC component from an AppObject
|
|
34
|
+
* @param appObj The AppObject to get the component from
|
|
35
|
+
* @returns The EditExampleStringUC component or undefined if not found
|
|
36
|
+
*/
|
|
37
|
+
static get(appObj: AppObject): EditExampleStringUC | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves an EditExampleStringUC by its parent AppObject's ID
|
|
40
|
+
* @param id The ID of the parent AppObject
|
|
41
|
+
* @param appObjects The AppObjectRepo to search in
|
|
42
|
+
* @returns The EditExampleStringUC component or undefined if not found
|
|
43
|
+
*/
|
|
44
|
+
static getById(id: string, appObjects: AppObjectRepo): EditExampleStringUC | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Factory function to create a new EditExampleStringUC
|
|
48
|
+
* @param appObject The AppObject to attach the UC to
|
|
49
|
+
* @returns A new EditExampleStringUC instance
|
|
50
|
+
*/
|
|
51
|
+
export declare function makeEditSlideTextUC(appObject: AppObject): EditExampleStringUC;
|
|
52
|
+
//# sourceMappingURL=EditExampleStringUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditExampleStringUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/UCs/EditExampleStringUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGxE;;;GAGG;AACH,8BAAsB,mBAAoB,SAAQ,WAAW;IAC3D,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,6BAA6B;IAEjD;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAE9C;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,mBAAmB,GAAG,SAAS;IAI9D;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,mBAAmB,GAAG,SAAS;CAGnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAE7E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToggleExampleBooleanUC.ts
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to implement a Singleton Use Case (UC) component.
|
|
5
|
+
* Singleton UCs are special UCs that exist only once in the application and can be
|
|
6
|
+
* accessed globally. They handle business logic and operations that modify singleton entities.
|
|
7
|
+
*
|
|
8
|
+
* Key concepts:
|
|
9
|
+
* - Singleton UCs extend AppObjectUC like regular UCs
|
|
10
|
+
* - They register themselves as singletons with appObjects.registerSingleton()
|
|
11
|
+
* - They're accessed through a static get() method using getSingletonComponent()
|
|
12
|
+
* - They typically operate on singleton entities
|
|
13
|
+
*
|
|
14
|
+
* Usage pattern:
|
|
15
|
+
* 1. Access the singleton UC using the static get() method
|
|
16
|
+
* 2. Call the UC's methods to perform operations
|
|
17
|
+
* 3. The UC will update entities, which will trigger PM updates and UI refreshes
|
|
18
|
+
*/
|
|
19
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "../../AppObject";
|
|
20
|
+
/**
|
|
21
|
+
* ToggleExampleBooleanUC provides functionality to toggle the boolean property
|
|
22
|
+
* of the SingletonEntityExample. As a singleton, only one instance exists in the application.
|
|
23
|
+
*/
|
|
24
|
+
export declare abstract class ToggleExampleBooleanUC extends AppObjectUC {
|
|
25
|
+
/** Unique type identifier for this component */
|
|
26
|
+
static readonly type = "ToggleExampleBooleanUCType";
|
|
27
|
+
/**
|
|
28
|
+
* Toggles the boolean property of the SingletonEntityExample
|
|
29
|
+
*/
|
|
30
|
+
abstract toggleExampleBoolean(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Global accessor for the singleton UC
|
|
33
|
+
* @param appObjects The AppObjectRepo to search in
|
|
34
|
+
* @returns The singleton UC or undefined if not created yet
|
|
35
|
+
*/
|
|
36
|
+
static get: (appObjects: AppObjectRepo) => ToggleExampleBooleanUC | undefined;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Factory function to create a new ToggleExampleBooleanUC
|
|
40
|
+
* @param appObject The AppObject to attach the UC to
|
|
41
|
+
* @returns A new ToggleExampleBooleanUC instance
|
|
42
|
+
*/
|
|
43
|
+
export declare function makeToggleExampleBooleanUC(appObject: AppObject): ToggleExampleBooleanUC;
|
|
44
|
+
//# sourceMappingURL=ToggleExampleBooleanUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleExampleBooleanUC.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/UCs/ToggleExampleBooleanUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB;;;GAGG;AACH,8BAAsB,sBAAuB,SAAQ,WAAW;IAC9D,gDAAgD;IAChD,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD;;OAEG;IACH,QAAQ,CAAC,oBAAoB,IAAI,IAAI;IAErC;;;;OAIG;IACH,MAAM,CAAC,GAAG,GACR,YAAY,aAAa,KACxB,sBAAsB,GAAG,SAAS,CAC4B;CAClE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,GACnB,sBAAsB,CAExB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ExampleFeature/UCs/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ExampleFeature/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vived/core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "Core Components for VIVED Apps and Hosts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -13,15 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "jest --watch --config jestconfig.json",
|
|
17
|
-
"testOnce": "jest --config jestconfig.json",
|
|
16
|
+
"test": "jest --watch --config jestconfig.json --testPathIgnorePatterns=\\.integration\\.test\\.ts$",
|
|
17
|
+
"testOnce": "jest --config jestconfig.json --testPathIgnorePatterns=\\.integration\\.test\\.ts$",
|
|
18
|
+
"test:integration": "jest --config jestconfig.json \".*\\.integration\\.test\\.ts$\"",
|
|
19
|
+
"test:integration:watch": "jest --watch --config jestconfig.json \".*\\.integration\\.test\\.ts$\"",
|
|
18
20
|
"build": "npm run build:esm && npm run build:cjs",
|
|
19
21
|
"build:esm": "tsc",
|
|
20
22
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
21
23
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
22
24
|
"lint": "tslint -p tsconfig.json",
|
|
23
25
|
"prepare": "npm run build",
|
|
24
|
-
"prepublishOnly": "npm run testOnce && npm run lint",
|
|
26
|
+
"prepublishOnly": "npm run testOnce && npm run test:integration && npm run lint",
|
|
25
27
|
"preversion": "npm run lint",
|
|
26
28
|
"version": "npm run format && git add -A src",
|
|
27
29
|
"postversion": "git push && git push --tags"
|