@spearwolf/shadow-objects 0.34.0 → 0.35.0
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/CHANGELOG.md +30 -0
- package/README.md +11 -2
- package/bundle.js +4 -2
- package/package.json +9 -1
- package/src/WorkerTimeoutError.d.ts +4 -3
- package/src/WorkerTimeoutError.d.ts.map +1 -1
- package/src/WorkerTimeoutError.js.map +2 -2
- package/src/constants.d.ts +8 -4
- package/src/constants.d.ts.map +1 -1
- package/src/constants.js +6 -0
- package/src/constants.js.map +2 -2
- package/src/elements/ShaePropElement.d.ts +15 -6
- package/src/elements/ShaePropElement.d.ts.map +1 -1
- package/src/elements/ShaePropElement.js +31 -7
- package/src/elements/ShaePropElement.js.map +2 -2
- package/src/elements/ShaeWorkerElement.d.ts +10 -0
- package/src/elements/ShaeWorkerElement.d.ts.map +1 -1
- package/src/elements/ShaeWorkerElement.js +69 -2
- package/src/elements/ShaeWorkerElement.js.map +2 -2
- package/src/elements/constants.d.ts +3 -0
- package/src/elements/constants.d.ts.map +1 -1
- package/src/elements/constants.js +6 -0
- package/src/elements/constants.js.map +2 -2
- package/src/in-the-dark/Entity.d.ts +30 -0
- package/src/in-the-dark/Entity.d.ts.map +1 -1
- package/src/in-the-dark/Entity.js +38 -0
- package/src/in-the-dark/Entity.js.map +2 -2
- package/src/in-the-dark/Kernel.d.ts +24 -1
- package/src/in-the-dark/Kernel.d.ts.map +1 -1
- package/src/in-the-dark/Kernel.js +56 -1
- package/src/in-the-dark/Kernel.js.map +2 -2
- package/src/in-the-dark/Registry.d.ts +7 -1
- package/src/in-the-dark/Registry.d.ts.map +1 -1
- package/src/in-the-dark/Registry.js +29 -0
- package/src/in-the-dark/Registry.js.map +2 -2
- package/src/in-the-dark/ShadowObjectCreationScope.d.ts +8 -1
- package/src/in-the-dark/ShadowObjectCreationScope.d.ts.map +1 -1
- package/src/in-the-dark/ShadowObjectCreationScope.js +23 -16
- package/src/in-the-dark/ShadowObjectCreationScope.js.map +2 -2
- package/src/in-the-dark/SignalsPath.d.ts +2 -0
- package/src/in-the-dark/SignalsPath.d.ts.map +1 -1
- package/src/in-the-dark/SignalsPath.js +4 -0
- package/src/in-the-dark/SignalsPath.js.map +2 -2
- package/src/in-the-dark/displayName.d.ts +4 -0
- package/src/in-the-dark/displayName.d.ts.map +1 -0
- package/src/in-the-dark/displayName.js +5 -0
- package/src/in-the-dark/displayName.js.map +7 -0
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +2 -2
- package/src/inspect/createKernelSnapshot.d.ts +17 -0
- package/src/inspect/createKernelSnapshot.d.ts.map +1 -0
- package/src/inspect/createKernelSnapshot.js +247 -0
- package/src/inspect/createKernelSnapshot.js.map +7 -0
- package/src/inspect/createViewSnapshot.d.ts +10 -0
- package/src/inspect/createViewSnapshot.d.ts.map +1 -0
- package/src/inspect/createViewSnapshot.js +143 -0
- package/src/inspect/createViewSnapshot.js.map +7 -0
- package/src/inspect/normalizeInspectRequest.d.ts +32 -0
- package/src/inspect/normalizeInspectRequest.d.ts.map +1 -0
- package/src/inspect/normalizeInspectRequest.js +55 -0
- package/src/inspect/normalizeInspectRequest.js.map +7 -0
- package/src/inspect/serializeValue.d.ts +13 -0
- package/src/inspect/serializeValue.d.ts.map +1 -0
- package/src/inspect/serializeValue.js +149 -0
- package/src/inspect/serializeValue.js.map +7 -0
- package/src/inspect/types.d.ts +260 -0
- package/src/inspect/types.d.ts.map +1 -0
- package/src/inspect/types.js +1 -0
- package/src/inspect/types.js.map +7 -0
- package/src/model-context/ModelContextLike.d.ts +59 -0
- package/src/model-context/ModelContextLike.d.ts.map +1 -0
- package/src/model-context/ModelContextLike.js +15 -0
- package/src/model-context/ModelContextLike.js.map +7 -0
- package/src/model-context/exposeShadowEnvsToModelContext.d.ts +48 -0
- package/src/model-context/exposeShadowEnvsToModelContext.d.ts.map +1 -0
- package/src/model-context/exposeShadowEnvsToModelContext.js +39 -0
- package/src/model-context/exposeShadowEnvsToModelContext.js.map +7 -0
- package/src/model-context/redactProps.d.ts +14 -0
- package/src/model-context/redactProps.d.ts.map +1 -0
- package/src/model-context/redactProps.js +22 -0
- package/src/model-context/redactProps.js.map +7 -0
- package/src/model-context/sharedExposure.d.ts +32 -0
- package/src/model-context/sharedExposure.d.ts.map +1 -0
- package/src/model-context/sharedExposure.js +108 -0
- package/src/model-context/sharedExposure.js.map +7 -0
- package/src/model-context/toolSupport.d.ts +72 -0
- package/src/model-context/toolSupport.d.ts.map +1 -0
- package/src/model-context/toolSupport.js +145 -0
- package/src/model-context/toolSupport.js.map +7 -0
- package/src/model-context/tools/findEntities.d.ts +15 -0
- package/src/model-context/tools/findEntities.d.ts.map +1 -0
- package/src/model-context/tools/findEntities.js +71 -0
- package/src/model-context/tools/findEntities.js.map +7 -0
- package/src/model-context/tools/getEntity.d.ts +16 -0
- package/src/model-context/tools/getEntity.d.ts.map +1 -0
- package/src/model-context/tools/getEntity.js +65 -0
- package/src/model-context/tools/getEntity.js.map +7 -0
- package/src/model-context/tools/getEntityTree.d.ts +4 -0
- package/src/model-context/tools/getEntityTree.d.ts.map +1 -0
- package/src/model-context/tools/getEntityTree.js +58 -0
- package/src/model-context/tools/getEntityTree.js.map +7 -0
- package/src/model-context/tools/getRegistry.d.ts +14 -0
- package/src/model-context/tools/getRegistry.d.ts.map +1 -0
- package/src/model-context/tools/getRegistry.js +39 -0
- package/src/model-context/tools/getRegistry.js.map +7 -0
- package/src/model-context/tools/index.d.ts +9 -0
- package/src/model-context/tools/index.d.ts.map +1 -0
- package/src/model-context/tools/index.js +16 -0
- package/src/model-context/tools/index.js.map +7 -0
- package/src/model-context/tools/listEnvs.d.ts +33 -0
- package/src/model-context/tools/listEnvs.d.ts.map +1 -0
- package/src/model-context/tools/listEnvs.js +37 -0
- package/src/model-context/tools/listEnvs.js.map +7 -0
- package/src/model-context.d.ts +13 -0
- package/src/model-context.d.ts.map +1 -0
- package/src/model-context.js +15 -0
- package/src/model-context.js.map +7 -0
- package/src/shadow-objects.d.ts +2 -0
- package/src/shadow-objects.d.ts.map +1 -1
- package/src/shadow-objects.js +4 -0
- package/src/shadow-objects.js.map +2 -2
- package/src/testing/TestEntity.d.ts +79 -0
- package/src/testing/TestEntity.d.ts.map +1 -0
- package/src/testing/TestEntity.js +135 -0
- package/src/testing/TestEntity.js.map +7 -0
- package/src/testing/createTestKernel.d.ts +11 -0
- package/src/testing/createTestKernel.d.ts.map +1 -0
- package/src/testing/createTestKernel.js +132 -0
- package/src/testing/createTestKernel.js.map +7 -0
- package/src/testing/mountShadowObject.d.ts +21 -0
- package/src/testing/mountShadowObject.d.ts.map +1 -0
- package/src/testing/mountShadowObject.js +72 -0
- package/src/testing/mountShadowObject.js.map +7 -0
- package/src/testing/recordKernelErrors.d.ts +21 -0
- package/src/testing/recordKernelErrors.d.ts.map +1 -0
- package/src/testing/recordKernelErrors.js +39 -0
- package/src/testing/recordKernelErrors.js.map +7 -0
- package/src/testing/settle.d.ts +15 -0
- package/src/testing/settle.d.ts.map +1 -0
- package/src/testing/settle.js +19 -0
- package/src/testing/settle.js.map +7 -0
- package/src/testing/types.d.ts +119 -0
- package/src/testing/types.d.ts.map +1 -0
- package/src/testing/types.js +1 -0
- package/src/testing/types.js.map +7 -0
- package/src/testing.d.ts +14 -0
- package/src/testing.d.ts.map +1 -0
- package/src/testing.js +11 -0
- package/src/testing.js.map +7 -0
- package/src/types.d.ts +150 -10
- package/src/types.d.ts.map +1 -1
- package/src/utils/attr-utils.d.ts +5 -0
- package/src/utils/attr-utils.d.ts.map +1 -1
- package/src/utils/attr-utils.js +2 -0
- package/src/utils/attr-utils.js.map +2 -2
- package/src/view/IShadowObjectEnvProxy.d.ts +9 -0
- package/src/view/IShadowObjectEnvProxy.d.ts.map +1 -1
- package/src/view/LocalShadowObjectEnv.d.ts +7 -0
- package/src/view/LocalShadowObjectEnv.d.ts.map +1 -1
- package/src/view/LocalShadowObjectEnv.js +15 -1
- package/src/view/LocalShadowObjectEnv.js.map +2 -2
- package/src/view/RemoteWorkerEnv.d.ts +22 -3
- package/src/view/RemoteWorkerEnv.d.ts.map +1 -1
- package/src/view/RemoteWorkerEnv.js +50 -1
- package/src/view/RemoteWorkerEnv.js.map +2 -2
- package/src/view/ShadowEnv.d.ts +30 -0
- package/src/view/ShadowEnv.d.ts.map +1 -1
- package/src/view/ShadowEnv.js +101 -0
- package/src/view/ShadowEnv.js.map +3 -3
- package/src/worker/MessageRouter.d.ts.map +1 -1
- package/src/worker/MessageRouter.js +23 -0
- package/src/worker/MessageRouter.js.map +2 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { Entity } from '../in-the-dark/Entity.js';
|
|
2
|
+
import type { Kernel } from '../in-the-dark/Kernel.js';
|
|
3
|
+
import type { Registry } from '../in-the-dark/Registry.js';
|
|
4
|
+
import type { ShadowObjectConstructor, ShadowObjectConstructorFunc, ShadowObjectDescription, ShadowObjectsModule, ShadowObjectType } from '../types.js';
|
|
5
|
+
/** Either shape a Shadow Object can be defined in. */
|
|
6
|
+
export type AnyShadowObjectConstructor = ShadowObjectConstructor | ShadowObjectConstructorFunc;
|
|
7
|
+
/**
|
|
8
|
+
* The instance a constructor produces. A function constructor that returns nothing yields
|
|
9
|
+
* `object`, which is honest: there is an eventized instance, and it carries nothing a test can name.
|
|
10
|
+
*/
|
|
11
|
+
export type ShadowObjectInstance<C> = C extends new (...args: any[]) => infer R ? R : C extends (...args: any[]) => infer R ? R extends object ? R : object : object;
|
|
12
|
+
/** One report the Kernel made through its logger while a test kernel was recording. */
|
|
13
|
+
export interface KernelErrorRecord {
|
|
14
|
+
level: 'error' | 'warn';
|
|
15
|
+
/** The arguments as they were logged. `runGuarded()` puts its message first and the error last. */
|
|
16
|
+
args: readonly unknown[];
|
|
17
|
+
/** The last argument, where that argument is an `Error`. */
|
|
18
|
+
error?: Error;
|
|
19
|
+
}
|
|
20
|
+
/** One message an Entity sent towards the View. */
|
|
21
|
+
export interface ViewMessageRecord {
|
|
22
|
+
type: string;
|
|
23
|
+
data: unknown;
|
|
24
|
+
traverseChildren?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateEntityOptions {
|
|
27
|
+
uuid?: string;
|
|
28
|
+
order?: number;
|
|
29
|
+
parent?: TestEntity;
|
|
30
|
+
autoDestructionOnParentRemoval?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** One handle per Entity. The same uuid always answers with the same handle. */
|
|
33
|
+
export interface TestEntity {
|
|
34
|
+
readonly uuid: string;
|
|
35
|
+
/** The token the Kernel currently holds for this Entity. */
|
|
36
|
+
readonly token: string;
|
|
37
|
+
/** The Entity itself -- the way out for everything this handle does not cover. */
|
|
38
|
+
readonly entity: Entity;
|
|
39
|
+
/**
|
|
40
|
+
* What this Entity sent towards the View since the last `clearViewMessages()`.
|
|
41
|
+
*
|
|
42
|
+
* The list belongs to the test kernel and this is a view onto it, so it holds every message that
|
|
43
|
+
* was dispatched for this uuid -- the ones from before anything asked for a handle included.
|
|
44
|
+
*
|
|
45
|
+
* A message is recorded one settle after it was dispatched, so a test settles before it reads.
|
|
46
|
+
* One message never arrives, and it is the end of the road anyway: `TestKernel.dispose()`
|
|
47
|
+
* unsubscribes and releases the log in the same synchronous call, while a message its teardown
|
|
48
|
+
* dispatched is still queued. A test that wants a Shadow Object's farewell message destroys the
|
|
49
|
+
* Entity and settles first.
|
|
50
|
+
*/
|
|
51
|
+
readonly viewMessages: readonly ViewMessageRecord[];
|
|
52
|
+
createChild(token: string, props?: Record<string, unknown>, options?: Omit<CreateEntityOptions, 'parent'>): TestEntity;
|
|
53
|
+
setProps(props: Record<string, unknown>): void;
|
|
54
|
+
removeProps(...names: string[]): void;
|
|
55
|
+
readProp<T = unknown>(name: string): T | undefined;
|
|
56
|
+
readContext<T = unknown>(name: string | symbol): T | undefined;
|
|
57
|
+
setToken(token: string): void;
|
|
58
|
+
setParent(parent: TestEntity | undefined, order?: number): void;
|
|
59
|
+
/** Deliver a View event. Synchronous, as the Kernel's own delivery is. */
|
|
60
|
+
sendViewEvent(type: string, data?: unknown): void;
|
|
61
|
+
/** Emit on the Entity's event bus -- the channel Shadow Objects on one Entity talk to each other on. */
|
|
62
|
+
emit(eventName: string | symbol, ...args: unknown[]): void;
|
|
63
|
+
shadowObjects(): ShadowObjectType[];
|
|
64
|
+
/** The one Shadow Object on this Entity built from `constructa`. Throws for none and for more than one. */
|
|
65
|
+
shadowObjectOf<C extends AnyShadowObjectConstructor>(constructa: C): ShadowObjectInstance<C>;
|
|
66
|
+
describe(): ShadowObjectDescription[];
|
|
67
|
+
clearViewMessages(): void;
|
|
68
|
+
destroy(): void;
|
|
69
|
+
}
|
|
70
|
+
export interface TestKernelOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The Registry to build on. Default: a fresh `new Registry()`, isolated from the default Registry
|
|
73
|
+
* and from every other test kernel. Pass `Registry.get()` for Shadow Objects that registered
|
|
74
|
+
* themselves through `@ShadowObject` without a registry of their own.
|
|
75
|
+
*/
|
|
76
|
+
registry?: Registry;
|
|
77
|
+
/** Fail `dispose()` when unacknowledged reports of level `error` were recorded. Default: `true`. */
|
|
78
|
+
failOnKernelErrors?: boolean;
|
|
79
|
+
/** Keep the Kernel's logger output on the console as well as recording it. Default: `false`. */
|
|
80
|
+
echoKernelErrors?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface TestKernel {
|
|
83
|
+
/** The Kernel itself -- the way out for everything this facade does not cover. */
|
|
84
|
+
readonly kernel: Kernel;
|
|
85
|
+
readonly registry: Registry;
|
|
86
|
+
/** What the Kernel reported through its logger since the last `clearErrors()`. */
|
|
87
|
+
readonly errors: readonly KernelErrorRecord[];
|
|
88
|
+
define(token: string, constructa: AnyShadowObjectConstructor): void;
|
|
89
|
+
route(token: string, targets: string[]): void;
|
|
90
|
+
importModule(module: ShadowObjectsModule): Promise<void>;
|
|
91
|
+
createEntity(token: string, props?: Record<string, unknown>, options?: CreateEntityOptions): TestEntity;
|
|
92
|
+
/**
|
|
93
|
+
* The handle for a uuid. `undefined` for a uuid this test kernel has never handed out a handle
|
|
94
|
+
* for and the Kernel does not hold; a handle it has already handed out keeps answering after its
|
|
95
|
+
* Entity is destroyed. A uuid a Shadow Object created through `testKernel.kernel.createEntity()`
|
|
96
|
+
* gets a handle here on first ask, and the same uuid always answers with the same handle.
|
|
97
|
+
*/
|
|
98
|
+
entity(uuid: string): TestEntity | undefined;
|
|
99
|
+
settle(): Promise<void>;
|
|
100
|
+
clearErrors(): void;
|
|
101
|
+
dispose(): void;
|
|
102
|
+
}
|
|
103
|
+
export interface MountOptions {
|
|
104
|
+
props?: Record<string, unknown>;
|
|
105
|
+
/** Entity Contexts a synthetic parent Entity provides to the object under test. */
|
|
106
|
+
contexts?: Record<string | symbol, unknown>;
|
|
107
|
+
/** The token to register the constructor under. Default: a generated one. */
|
|
108
|
+
token?: string;
|
|
109
|
+
registry?: Registry;
|
|
110
|
+
failOnKernelErrors?: boolean;
|
|
111
|
+
echoKernelErrors?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface MountedShadowObject<C> extends Omit<TestEntity, 'createChild' | 'destroy'> {
|
|
114
|
+
readonly instance: ShadowObjectInstance<C>;
|
|
115
|
+
readonly testKernel: TestKernel;
|
|
116
|
+
settle(): Promise<void>;
|
|
117
|
+
dispose(): void;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/testing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,mBAAmB,EAC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W,mBAAmB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS,CAAC;IACzF,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
package/src/testing.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The testing utility: a real Kernel for a unit test, with the ceremony taken off.
|
|
3
|
+
*
|
|
4
|
+
* A subpath rather than an `index.ts` export, for the same reason `model-context.js` is one -- it
|
|
5
|
+
* has no place in an application bundle, and none at all in the worker bundle. Nothing here imports
|
|
6
|
+
* a test runner: what a test asserts on are plain arrays, so vitest, jest, `node:test` and the
|
|
7
|
+
* browser mode are served alike. Importing this module registers nothing and touches no global.
|
|
8
|
+
*/
|
|
9
|
+
export { createTestKernel } from './testing/createTestKernel.js';
|
|
10
|
+
export { mountShadowObject } from './testing/mountShadowObject.js';
|
|
11
|
+
export { type KernelErrorRecorder, recordKernelErrors } from './testing/recordKernelErrors.js';
|
|
12
|
+
export { settle } from './testing/settle.js';
|
|
13
|
+
export type { AnyShadowObjectConstructor, CreateEntityOptions, KernelErrorRecord, MountedShadowObject, MountOptions, ShadowObjectInstance, TestEntity, TestKernel, TestKernelOptions, ViewMessageRecord, } from './testing/types.js';
|
|
14
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAC,KAAK,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC3C,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/src/testing.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createTestKernel } from "./testing/createTestKernel.js";
|
|
2
|
+
import { mountShadowObject } from "./testing/mountShadowObject.js";
|
|
3
|
+
import { recordKernelErrors } from "./testing/recordKernelErrors.js";
|
|
4
|
+
import { settle } from "./testing/settle.js";
|
|
5
|
+
export {
|
|
6
|
+
createTestKernel,
|
|
7
|
+
mountShadowObject,
|
|
8
|
+
recordKernelErrors,
|
|
9
|
+
settle
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/testing.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The testing utility: a real Kernel for a unit test, with the ceremony taken off.\n *\n * A subpath rather than an `index.ts` export, for the same reason `model-context.js` is one -- it\n * has no place in an application bundle, and none at all in the worker bundle. Nothing here imports\n * a test runner: what a test asserts on are plain arrays, so vitest, jest, `node:test` and the\n * browser mode are served alike. Importing this module registers nothing and touches no global.\n */\nexport {createTestKernel} from './testing/createTestKernel.js';\nexport {mountShadowObject} from './testing/mountShadowObject.js';\nexport {type KernelErrorRecorder, recordKernelErrors} from './testing/recordKernelErrors.js';\nexport {settle} from './testing/settle.js';\nexport type {\n AnyShadowObjectConstructor,\n CreateEntityOptions,\n KernelErrorRecord,\n MountedShadowObject,\n MountOptions,\n ShadowObjectInstance,\n TestEntity,\n TestKernel,\n TestKernelOptions,\n ViewMessageRecord,\n} from './testing/types.js';\n"],
|
|
5
|
+
"mappings": "AAQA,SAAQ,wBAAuB;AAC/B,SAAQ,yBAAwB;AAChC,SAAkC,0BAAyB;AAC3D,SAAQ,cAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { AnyEventNames, EventArgs, EventizedObject,
|
|
1
|
+
import type { AnyEventNames, ArgsFor, DefaultEventMap, EventArgs, EventizedObject, EventKeysOf, EventListenerMethods, EventMap, EventName, ListenerFor, ListenerFuncType, MultiArgsFor, NonTypedEmitter, SubscribeArgs, UnsubscribeFunc } from '@spearwolf/eventize';
|
|
2
2
|
import type { CompareFunc, createEffect, createMemo, createSignal, Signal, SignalReader } from '@spearwolf/signalize';
|
|
3
|
-
import type { AppliedChangeTrail, ComponentChangeType, ImportedModule } from './constants.js';
|
|
3
|
+
import type { AppliedChangeTrail, ComponentChangeType, ImportedModule, Inspect, Inspected } from './constants.js';
|
|
4
4
|
import type { Entity } from './in-the-dark/Entity.js';
|
|
5
|
+
import type { InspectRequest, KernelSnapshot } from './inspect/types.js';
|
|
5
6
|
import type { Kernel, Registry } from './shadow-objects.js';
|
|
6
7
|
export type ChangeTrailType = IComponentChangeType[];
|
|
7
8
|
export type TransferablesType = Transferable[];
|
|
@@ -87,6 +88,29 @@ export interface AppliedChangeTrailEvent {
|
|
|
87
88
|
*/
|
|
88
89
|
appliedCount?: number;
|
|
89
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* What goes on the wire for an `inspect()` over a worker: the request as the caller gave it, and
|
|
93
|
+
* the serial the answer is matched by. The request is plain data and survives structured cloning.
|
|
94
|
+
*/
|
|
95
|
+
export interface InspectEvent {
|
|
96
|
+
type: typeof Inspect;
|
|
97
|
+
serial: number;
|
|
98
|
+
request: InspectRequest;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The worker's answer to an {@link InspectEvent}: the snapshot, or the two fields of a throw that
|
|
102
|
+
* survive structured cloning -- see {@link ImportedModuleEvent.errorName}. Exactly one of
|
|
103
|
+
* `snapshot` and `error` is set by the router; a reply carrying neither is rejected by the view
|
|
104
|
+
* side rather than read through. `serial` is what the request carried; `RemoteWorkerEnv` always
|
|
105
|
+
* sends one, and matches the answer by it.
|
|
106
|
+
*/
|
|
107
|
+
export interface InspectedEvent {
|
|
108
|
+
type: typeof Inspected;
|
|
109
|
+
serial: number;
|
|
110
|
+
snapshot?: KernelSnapshot;
|
|
111
|
+
error?: string;
|
|
112
|
+
errorName?: string;
|
|
113
|
+
}
|
|
90
114
|
export type EntityApi = Readonly<Pick<Entity, 'uuid' | 'order' | 'hasParent' | 'propKeys' | 'propEntries' | 'kernel'> & {
|
|
91
115
|
parent?: EntityApi | undefined;
|
|
92
116
|
children: readonly EntityApi[];
|
|
@@ -99,7 +123,41 @@ export interface ProvideContextOptions<T> extends SignalValueOptions<T> {
|
|
|
99
123
|
clearOnDestroy?: boolean;
|
|
100
124
|
}
|
|
101
125
|
export type Maybe<T = unknown> = NonNullable<T> | undefined;
|
|
102
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The event map of a Shadow Object read off its own shape: every method is an event of that name,
|
|
128
|
+
* carrying the method's parameters as its argument tuple. The map an `emit()` on the entity is
|
|
129
|
+
* checked against when it names a Shadow Object that listens there -- see `ShadowObjectCreationAPI`.
|
|
130
|
+
*
|
|
131
|
+
* It is the runtime read back into a type. The Kernel attaches every Shadow Object to its Entity as
|
|
132
|
+
* an eventize listener object, so an `emit('onPowerUp', 100)` on the entity calls `onPowerUp(100)`
|
|
133
|
+
* on each Shadow Object that has such a method. Every method takes part, the ones nobody meant as
|
|
134
|
+
* an event included -- and that is what the dispatch does, too. A `symbol`-keyed method, the
|
|
135
|
+
* lifecycle hooks among them, stays out: the eventize maps treat a symbol as the escape hatch. Two
|
|
136
|
+
* Shadow Objects on one entity make `EventsOf<A> & EventsOf<B>`.
|
|
137
|
+
*/
|
|
138
|
+
export type EventsOf<L> = {
|
|
139
|
+
[K in keyof L as L[K] extends (...args: any[]) => any ? (K extends EventName ? K : never) : never]: L[K] extends (...args: infer A) => any ? A : never;
|
|
140
|
+
};
|
|
141
|
+
/** `true` for a map that declares dynamic names -- eventize's `DefaultEventMap`, or one with an index signature. */
|
|
142
|
+
type IsLooseMap<T> = string extends EventKeysOf<T> ? true : false;
|
|
143
|
+
/**
|
|
144
|
+
* Where a subscription on the entity is checked against the map, this closes the loose forms for a
|
|
145
|
+
* typed map: a rest parameter of `never` is an overload no call matches. The same way eventize closes
|
|
146
|
+
* its loose overloads for a typed emitter.
|
|
147
|
+
*/
|
|
148
|
+
type LooseSubscribeArgs<TEvents> = IsLooseMap<TEvents> extends true ? SubscribeArgs : never;
|
|
149
|
+
type LooseEmitNames<TEvents> = IsLooseMap<TEvents> extends true ? AnyEventNames : never;
|
|
150
|
+
/**
|
|
151
|
+
* What a Shadow Object constructor is handed.
|
|
152
|
+
*
|
|
153
|
+
* `TEvents` is the event map of the entity bus as this Shadow Object sees it, in the shape eventize
|
|
154
|
+
* takes -- `{[eventName]: argumentTuple}` -- and it types the entity-implicit forms of `on()`,
|
|
155
|
+
* `once()` and `emit()`. `EventsOf<OtherShadowObject>` derives it from the Shadow Object that is meant
|
|
156
|
+
* to receive the event. Without it every form is as loose as eventize's default map, and the target
|
|
157
|
+
* forms are typed by the target's own map either way. The map is a compile-time contract: nothing
|
|
158
|
+
* at runtime holds two Shadow Objects on one entity to the same one.
|
|
159
|
+
*/
|
|
160
|
+
export interface ShadowObjectCreationAPI<TEvents extends EventMap = DefaultEventMap> {
|
|
103
161
|
entity: EntityApi;
|
|
104
162
|
dispatchMessageToView(type: string, data?: unknown, transferables?: TransferablesType, traverseChildren?: boolean): void;
|
|
105
163
|
provideContext<T = unknown>(name: string | symbol, sourceOrInitialValue?: T | SignalReader<T> | SignalReader<T | undefined>, options?: ProvideContextOptions<T> | CompareFunc<T | undefined>): Signal<Maybe<T>>;
|
|
@@ -116,10 +174,54 @@ export interface ShadowObjectCreationAPI {
|
|
|
116
174
|
createEffect: typeof createEffect;
|
|
117
175
|
createSignal: typeof createSignal;
|
|
118
176
|
createMemo<T = unknown>(...args: Parameters<typeof createMemo<T>>): SignalReader<T>;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
177
|
+
/**
|
|
178
|
+
* Subscribe on the *entity* of this shadow object, or on a *target* given in front. Every form
|
|
179
|
+
* eventize's standalone `on()` takes; the subscription ends with the shadow object, or earlier
|
|
180
|
+
* through the handle. On the entity the event names and the listener are checked against `TEvents`;
|
|
181
|
+
* on a target, against the target's own map. An object followed by anything is the target, an
|
|
182
|
+
* object standing alone is a listener object on the entity.
|
|
183
|
+
*/
|
|
184
|
+
on<K extends EventKeysOf<TEvents> | symbol>(eventName: K, listener: ListenerFor<TEvents, K>): UnsubscribeFunc;
|
|
185
|
+
on<K extends EventKeysOf<TEvents> | symbol>(eventName: K, priority: number, listener: ListenerFor<TEvents, K>): UnsubscribeFunc;
|
|
186
|
+
on<K extends EventKeysOf<TEvents>>(eventNames: Array<K | [K, number]>, listener: (...args: MultiArgsFor<TEvents, K>) => void): UnsubscribeFunc;
|
|
187
|
+
on<K extends EventKeysOf<TEvents>>(eventNames: Array<K | [K, number]>, priority: number, listener: (...args: MultiArgsFor<TEvents, K>) => void): UnsubscribeFunc;
|
|
188
|
+
on<K extends EventKeysOf<TEvents>>(eventNames: K | K[], methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
189
|
+
on<K extends EventKeysOf<TEvents>>(eventNames: K | K[], priority: number, methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
190
|
+
on(listenerObject: EventListenerMethods<TEvents>): UnsubscribeFunc;
|
|
191
|
+
on(priority: number, listenerObject: EventListenerMethods<TEvents>): UnsubscribeFunc;
|
|
192
|
+
on(listener: ListenerFuncType): UnsubscribeFunc;
|
|
193
|
+
on(priority: number, listener: ListenerFuncType): UnsubscribeFunc;
|
|
194
|
+
on(priority: number, methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
195
|
+
on(...args: LooseSubscribeArgs<TEvents>): UnsubscribeFunc;
|
|
196
|
+
on<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventName: K, listener: ListenerFor<M, K>): UnsubscribeFunc;
|
|
197
|
+
on<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventName: K, priority: number, listener: ListenerFor<M, K>): UnsubscribeFunc;
|
|
198
|
+
on<M extends EventMap, K extends EventKeysOf<M>>(target: EventizedObject<M>, eventNames: Array<K | [K, number]>, listener: (...args: MultiArgsFor<M, K>) => void): UnsubscribeFunc;
|
|
199
|
+
on<M extends EventMap>(target: EventizedObject<M>, listenerObject: EventListenerMethods<M>): UnsubscribeFunc;
|
|
200
|
+
on<T extends object>(target: NonTypedEmitter<T>, ...args: SubscribeArgs): UnsubscribeFunc;
|
|
201
|
+
/**
|
|
202
|
+
* Subscribe on the *entity* of this shadow object, or on a *target* given in front. Every form
|
|
203
|
+
* eventize's standalone `once()` takes; the subscription ends with the shadow object, or earlier
|
|
204
|
+
* through the handle. On the entity the event names and the listener are checked against `TEvents`;
|
|
205
|
+
* on a target, against the target's own map. An object followed by anything is the target, an
|
|
206
|
+
* object standing alone is a listener object on the entity.
|
|
207
|
+
*/
|
|
208
|
+
once<K extends EventKeysOf<TEvents> | symbol>(eventName: K, listener: ListenerFor<TEvents, K>): UnsubscribeFunc;
|
|
209
|
+
once<K extends EventKeysOf<TEvents> | symbol>(eventName: K, priority: number, listener: ListenerFor<TEvents, K>): UnsubscribeFunc;
|
|
210
|
+
once<K extends EventKeysOf<TEvents>>(eventNames: Array<K | [K, number]>, listener: (...args: MultiArgsFor<TEvents, K>) => void): UnsubscribeFunc;
|
|
211
|
+
once<K extends EventKeysOf<TEvents>>(eventNames: Array<K | [K, number]>, priority: number, listener: (...args: MultiArgsFor<TEvents, K>) => void): UnsubscribeFunc;
|
|
212
|
+
once<K extends EventKeysOf<TEvents>>(eventNames: K | K[], methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
213
|
+
once<K extends EventKeysOf<TEvents>>(eventNames: K | K[], priority: number, methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
214
|
+
once(listenerObject: EventListenerMethods<TEvents>): UnsubscribeFunc;
|
|
215
|
+
once(priority: number, listenerObject: EventListenerMethods<TEvents>): UnsubscribeFunc;
|
|
216
|
+
once(listener: ListenerFuncType): UnsubscribeFunc;
|
|
217
|
+
once(priority: number, listener: ListenerFuncType): UnsubscribeFunc;
|
|
218
|
+
once(priority: number, methodName: EventName, listenerObject: object): UnsubscribeFunc;
|
|
219
|
+
once(...args: LooseSubscribeArgs<TEvents>): UnsubscribeFunc;
|
|
220
|
+
once<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventName: K, listener: ListenerFor<M, K>): UnsubscribeFunc;
|
|
221
|
+
once<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventName: K, priority: number, listener: ListenerFor<M, K>): UnsubscribeFunc;
|
|
222
|
+
once<M extends EventMap, K extends EventKeysOf<M>>(target: EventizedObject<M>, eventNames: Array<K | [K, number]>, listener: (...args: MultiArgsFor<M, K>) => void): UnsubscribeFunc;
|
|
223
|
+
once<M extends EventMap>(target: EventizedObject<M>, listenerObject: EventListenerMethods<M>): UnsubscribeFunc;
|
|
224
|
+
once<T extends object>(target: NonTypedEmitter<T>, ...args: SubscribeArgs): UnsubscribeFunc;
|
|
123
225
|
onViewEvent(callback: (type: string, data: unknown) => any): void;
|
|
124
226
|
/**
|
|
125
227
|
* Emit an event on the *entity* associated with this shadow object.
|
|
@@ -131,15 +233,21 @@ export interface ShadowObjectCreationAPI {
|
|
|
131
233
|
* @param eventNames - The name(s) of the event(s) to emit.
|
|
132
234
|
* @param eventArgs - Arguments to pass to the event listeners.
|
|
133
235
|
*/
|
|
134
|
-
emit(
|
|
236
|
+
emit<K extends EventKeysOf<TEvents> | symbol>(eventName: K, ...eventArgs: ArgsFor<TEvents, K>): void;
|
|
237
|
+
emit<K extends EventKeysOf<TEvents> | symbol>(eventNames: K[], ...eventArgs: ArgsFor<TEvents, K>): void;
|
|
238
|
+
emit(eventNames: LooseEmitNames<TEvents>, ...eventArgs: EventArgs): void;
|
|
135
239
|
/**
|
|
136
|
-
* Emit an event on a specific *target* object
|
|
240
|
+
* Emit an event on a specific *target* object -- another Entity, a Shadow Object, any eventized
|
|
241
|
+
* object, or a plain one: eventize duck-types a target, so an object without listeners is a no-op.
|
|
242
|
+
* The event names and arguments are checked against the target's own map where it has one.
|
|
137
243
|
*
|
|
138
244
|
* @param target - The object to emit the event on.
|
|
139
245
|
* @param eventNames - The name(s) of the event(s) to emit.
|
|
140
246
|
* @param eventArgs - Arguments to pass to the event listeners.
|
|
141
247
|
*/
|
|
142
|
-
emit(target: EventizedObject
|
|
248
|
+
emit<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventName: K, ...eventArgs: ArgsFor<M, K>): void;
|
|
249
|
+
emit<M extends EventMap, K extends EventKeysOf<M> | symbol>(target: EventizedObject<M>, eventNames: K[], ...eventArgs: ArgsFor<M, K>): void;
|
|
250
|
+
emit<T extends object>(target: NonTypedEmitter<T>, eventNames: AnyEventNames, ...eventArgs: EventArgs): void;
|
|
143
251
|
onDestroy(callback: () => any): void;
|
|
144
252
|
}
|
|
145
253
|
export interface ShadowObjectConstructor {
|
|
@@ -152,6 +260,37 @@ export interface ShadowObjectConstructorFunc {
|
|
|
152
260
|
/** The name the Kernel reports a Shadow Object built from this constructor under; without it, the constructor's `name`. */
|
|
153
261
|
displayName?: string;
|
|
154
262
|
}
|
|
263
|
+
/** The four lifecycle hooks a Shadow Object can implement, by the name of their symbol. */
|
|
264
|
+
export type LifecycleHookName = 'onCreate' | 'onDestroy' | 'onParentChanged' | 'onViewEvent';
|
|
265
|
+
/**
|
|
266
|
+
* What a creation scope knows about its Shadow Object: the display name and the five name lists
|
|
267
|
+
* the creation API filled while the constructor ran. Read-only; a torn-down scope answers empty
|
|
268
|
+
* lists.
|
|
269
|
+
*/
|
|
270
|
+
export interface ShadowObjectScopeDescription {
|
|
271
|
+
displayName: string;
|
|
272
|
+
usesProperties: string[];
|
|
273
|
+
usesContexts: (string | symbol)[];
|
|
274
|
+
usesParentContexts: (string | symbol)[];
|
|
275
|
+
providesContexts: (string | symbol)[];
|
|
276
|
+
providesGlobalContexts: (string | symbol)[];
|
|
277
|
+
}
|
|
278
|
+
/** {@link ShadowObjectScopeDescription} plus what only the Kernel can add: the tokens and the hooks. */
|
|
279
|
+
export interface ShadowObjectDescription extends ShadowObjectScopeDescription {
|
|
280
|
+
/** The tokens the constructor is defined under in the Kernel's Registry, in definition order. */
|
|
281
|
+
definedUnder: string[];
|
|
282
|
+
/** Which of the four lifecycle hooks the instance implements. */
|
|
283
|
+
hooks: LifecycleHookName[];
|
|
284
|
+
}
|
|
285
|
+
/** The three maps of a Registry, with constructors reduced to display names. */
|
|
286
|
+
export interface RegistryDescription {
|
|
287
|
+
/** token -> display names of the constructors defined under it, in definition order. */
|
|
288
|
+
tokens: Record<string, string[]>;
|
|
289
|
+
/** token -> tokens it routes to. */
|
|
290
|
+
routes: Record<string, string[]>;
|
|
291
|
+
/** `@prop` and `token@prop` keys -> tokens (property routes). */
|
|
292
|
+
propRoutes: Record<string, string[]>;
|
|
293
|
+
}
|
|
155
294
|
export type ShadowObjectType = EventizedObject;
|
|
156
295
|
export type NamespaceType = string | symbol;
|
|
157
296
|
export type ShadowObjectsModuleInitializer = (shadowObjects: {
|
|
@@ -165,4 +304,5 @@ export interface ShadowObjectsModule {
|
|
|
165
304
|
routes?: Record<string, string[]>;
|
|
166
305
|
initialize?: ShadowObjectsModuleInitializer;
|
|
167
306
|
}
|
|
307
|
+
export {};
|
|
168
308
|
//# sourceMappingURL=types.d.ts.map
|
package/src/types.d.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AAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,8BAA8B,GAAG,CAAC,aAAa,EAAE;IAC3D,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,uBAAuB,GAAG,2BAA2B,KAAK,IAAI,CAAC;IACnG,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;CACpB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,2BAA2B,CAAC,CAAC;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,8BAA8B,CAAC;CAC7C"}
|
|
@@ -6,4 +6,9 @@ export declare const readBooleanAttribute: (el: HTMLElement, name: string) => bo
|
|
|
6
6
|
* or blank one reads as `0` — whoever asks decides what either of those means.
|
|
7
7
|
*/
|
|
8
8
|
export declare const readNumberAttribute: (el: HTMLElement, name: string) => number | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* The attribute read as a list of words: split on commas and whitespace, blanks dropped. A
|
|
11
|
+
* missing attribute is an empty list, and so is an empty or a blank one.
|
|
12
|
+
*/
|
|
13
|
+
export declare const readListAttribute: (el: HTMLElement, name: string) => string[];
|
|
9
14
|
//# sourceMappingURL=attr-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attr-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/attr-utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,OAAQ,WAAW,wCAAuD,CAAC;AAE9G,eAAO,MAAM,oBAAoB,OAAQ,WAAW,QAAQ,MAAM,YAMjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,WAAW,QAAQ,MAAM,KAAG,MAAM,GAAG,SACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"attr-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/attr-utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,OAAQ,WAAW,wCAAuD,CAAC;AAE9G,eAAO,MAAM,oBAAoB,OAAQ,WAAW,QAAQ,MAAM,YAMjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,WAAW,QAAQ,MAAM,KAAG,MAAM,GAAG,SACV,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,OAAQ,WAAW,QAAQ,MAAM,KAAG,MAAM,EACW,CAAC"}
|
package/src/utils/attr-utils.js
CHANGED
|
@@ -10,8 +10,10 @@ const readBooleanAttribute = (el, name) => {
|
|
|
10
10
|
return false;
|
|
11
11
|
};
|
|
12
12
|
const readNumberAttribute = (el, name) => el.hasAttribute(name) ? Number(el.getAttribute(name)) : void 0;
|
|
13
|
+
const readListAttribute = (el, name) => (el.getAttribute(name) ?? "").split(/[\s,]+/).filter((entry) => entry.length > 0);
|
|
13
14
|
export {
|
|
14
15
|
readBooleanAttribute,
|
|
16
|
+
readListAttribute,
|
|
15
17
|
readNamespaceAttribute,
|
|
16
18
|
readNumberAttribute
|
|
17
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/attr-utils.ts"],
|
|
4
|
-
"sourcesContent": ["import {ATTR_NS} from '../elements/constants.js';\nimport {TRUTHY_VALUES} from './constants.js';\nimport {toNamespace} from './toNamespace.js';\n\nexport const readNamespaceAttribute = (el: HTMLElement) => toNamespace(el.getAttribute(ATTR_NS) ?? undefined);\n\nexport const readBooleanAttribute = (el: HTMLElement, name: string) => {\n if (el.hasAttribute(name)) {\n const val = el.getAttribute(name)?.trim()?.toLowerCase() || '1';\n return TRUTHY_VALUES.has(val);\n }\n return false;\n};\n\n/**\n * The attribute read as a number, or `undefined` where the element does not carry it.\n * `Number()` does the reading, so a value that is not a number reads as `NaN` while an empty\n * or blank one reads as `0` \u2014 whoever asks decides what either of those means.\n */\nexport const readNumberAttribute = (el: HTMLElement, name: string): number | undefined =>\n el.hasAttribute(name) ? Number(el.getAttribute(name)) : undefined;\n"],
|
|
5
|
-
"mappings": "AAAA,SAAQ,eAAc;AACtB,SAAQ,qBAAoB;AAC5B,SAAQ,mBAAkB;AAEnB,MAAM,yBAAyB,CAAC,OAAoB,YAAY,GAAG,aAAa,OAAO,KAAK,MAAS;AAErG,MAAM,uBAAuB,CAAC,IAAiB,SAAiB;AACrE,MAAI,GAAG,aAAa,IAAI,GAAG;AACzB,UAAM,MAAM,GAAG,aAAa,IAAI,GAAG,KAAK,GAAG,YAAY,KAAK;AAC5D,WAAO,cAAc,IAAI,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AAOO,MAAM,sBAAsB,CAAC,IAAiB,SACnD,GAAG,aAAa,IAAI,IAAI,OAAO,GAAG,aAAa,IAAI,CAAC,IAAI;",
|
|
4
|
+
"sourcesContent": ["import {ATTR_NS} from '../elements/constants.js';\nimport {TRUTHY_VALUES} from './constants.js';\nimport {toNamespace} from './toNamespace.js';\n\nexport const readNamespaceAttribute = (el: HTMLElement) => toNamespace(el.getAttribute(ATTR_NS) ?? undefined);\n\nexport const readBooleanAttribute = (el: HTMLElement, name: string) => {\n if (el.hasAttribute(name)) {\n const val = el.getAttribute(name)?.trim()?.toLowerCase() || '1';\n return TRUTHY_VALUES.has(val);\n }\n return false;\n};\n\n/**\n * The attribute read as a number, or `undefined` where the element does not carry it.\n * `Number()` does the reading, so a value that is not a number reads as `NaN` while an empty\n * or blank one reads as `0` \u2014 whoever asks decides what either of those means.\n */\nexport const readNumberAttribute = (el: HTMLElement, name: string): number | undefined =>\n el.hasAttribute(name) ? Number(el.getAttribute(name)) : undefined;\n\n/**\n * The attribute read as a list of words: split on commas and whitespace, blanks dropped. A\n * missing attribute is an empty list, and so is an empty or a blank one.\n */\nexport const readListAttribute = (el: HTMLElement, name: string): string[] =>\n (el.getAttribute(name) ?? '').split(/[\\s,]+/).filter((entry) => entry.length > 0);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAQ,eAAc;AACtB,SAAQ,qBAAoB;AAC5B,SAAQ,mBAAkB;AAEnB,MAAM,yBAAyB,CAAC,OAAoB,YAAY,GAAG,aAAa,OAAO,KAAK,MAAS;AAErG,MAAM,uBAAuB,CAAC,IAAiB,SAAiB;AACrE,MAAI,GAAG,aAAa,IAAI,GAAG;AACzB,UAAM,MAAM,GAAG,aAAa,IAAI,GAAG,KAAK,GAAG,YAAY,KAAK;AAC5D,WAAO,cAAc,IAAI,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AAOO,MAAM,sBAAsB,CAAC,IAAiB,SACnD,GAAG,aAAa,IAAI,IAAI,OAAO,GAAG,aAAa,IAAI,CAAC,IAAI;AAMnD,MAAM,oBAAoB,CAAC,IAAiB,UAChD,GAAG,aAAa,IAAI,KAAK,IAAI,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,MAAM,SAAS,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InspectRequest, KernelSnapshot } from '../inspect/types.js';
|
|
1
2
|
import type { MessageToViewEvent } from '../shadow-objects.js';
|
|
2
3
|
import type { ChangeTrailType } from '../types.js';
|
|
3
4
|
export interface IShadowObjectEnvProxy {
|
|
@@ -23,6 +24,14 @@ export interface IShadowObjectEnvProxy {
|
|
|
23
24
|
* sent without it -- `RemoteWorkerEnv` is one of those.
|
|
24
25
|
*/
|
|
25
26
|
applyChangeTrail(data: ChangeTrailType, waitForConfirmation: boolean): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Describe the Kernel behind this proxy: a plain-data snapshot of its Entity Tree, cut by the
|
|
29
|
+
* limits of the request. Optional: a proxy that does not implement it makes `ShadowEnv.inspect()`
|
|
30
|
+
* report `kernel` as absent with an error naming the proxy as not inspectable, and everything
|
|
31
|
+
* else keeps working. Reject with the signal's reason when `signal` is aborted before or while
|
|
32
|
+
* the snapshot is built.
|
|
33
|
+
*/
|
|
34
|
+
inspect?(request: InspectRequest, signal?: AbortSignal): Promise<KernelSnapshot>;
|
|
26
35
|
destroy(): void;
|
|
27
36
|
/**
|
|
28
37
|
* Called with a message on its way out of the Shadow Environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IShadowObjectEnvProxy.d.ts","sourceRoot":"","sources":["../../../src/view/IShadowObjectEnvProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErF,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC;IAE1F;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC;CACxD"}
|
|
1
|
+
{"version":3,"file":"IShadowObjectEnvProxy.d.ts","sourceRoot":"","sources":["../../../src/view/IShadowObjectEnvProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErF;;;;;;OAMG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEjF,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC;IAE1F;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC;CACxD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Kernel } from '../in-the-dark/Kernel.js';
|
|
2
2
|
import { Registry } from '../in-the-dark/Registry.js';
|
|
3
|
+
import type { InspectRequest, KernelSnapshot } from '../inspect/types.js';
|
|
3
4
|
import type { ChangeTrailType, ShadowObjectsModule } from '../types.js';
|
|
4
5
|
import type { IShadowObjectEnvProxy } from './IShadowObjectEnvProxy.js';
|
|
5
6
|
export declare class LocalShadowObjectEnv implements IShadowObjectEnvProxy {
|
|
@@ -11,6 +12,12 @@ export declare class LocalShadowObjectEnv implements IShadowObjectEnvProxy {
|
|
|
11
12
|
constructor(registry?: Registry);
|
|
12
13
|
start(): Promise<void>;
|
|
13
14
|
applyChangeTrail(data: ChangeTrailType, waitForConfirmation: boolean): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* The snapshot of this environment's Kernel, built synchronously inside the call. Nothing is
|
|
17
|
+
* cloned: the builder emits plain data and the caller owns it. A signal that is already aborted
|
|
18
|
+
* rejects before anything is built; there is no later point to abort at.
|
|
19
|
+
*/
|
|
20
|
+
inspect(request?: InspectRequest, signal?: AbortSignal): Promise<KernelSnapshot>;
|
|
14
21
|
importScript(url: URL | string): Promise<void>;
|
|
15
22
|
importModule(module: ShadowObjectsModule): Promise<void>;
|
|
16
23
|
destroy(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalShadowObjectEnv.d.ts","sourceRoot":"","sources":["../../../src/view/LocalShadowObjectEnv.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAA0B,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"LocalShadowObjectEnv.d.ts","sourceRoot":"","sources":["../../../src/view/LocalShadowObjectEnv.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,MAAM,EAA0B,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAC,QAAQ,EAAC,MAAM,4BAA4B,CAAC;AAEpD,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAC,eAAe,EAAE,mBAAmB,EAAY,MAAM,aAAa,CAAC;AAGjF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAEtE,qBAAa,oBAAqB,YAAW,qBAAqB;;IAIhE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,QAAQ,CAAC,UAAU,QAAQ;IAE3B,sBAAsB,UAAS;IAE/B,YAAY,QAAQ,CAAC,EAAE,QAAQ,EAqB9B;IAED,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;IAED,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,mBAAmB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBnF;IAED;;;;OAIG;IACH,OAAO,CAAC,OAAO,GAAE,cAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAOnF;IAEK,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnD;IAEK,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;IAED,OAAO,IAAI,IAAI,CAMd;CACF"}
|
|
@@ -3,6 +3,7 @@ import { MessageToView, ShadowObjectsExport } from "../constants.js";
|
|
|
3
3
|
import { importModule, missingShadowObjectsExportMessage } from "../in-the-dark/importModule.js";
|
|
4
4
|
import { Kernel } from "../in-the-dark/Kernel.js";
|
|
5
5
|
import { Registry } from "../in-the-dark/Registry.js";
|
|
6
|
+
import { createKernelSnapshot } from "../inspect/createKernelSnapshot.js";
|
|
6
7
|
import { toUrlString } from "../utils/toUrlString.js";
|
|
7
8
|
import { cloneChangeTrail } from "./cloneChangeTrail.js";
|
|
8
9
|
class LocalShadowObjectEnv {
|
|
@@ -11,7 +12,7 @@ class LocalShadowObjectEnv {
|
|
|
11
12
|
this.isLocalEnv = true;
|
|
12
13
|
this.disableStructuredClone = false;
|
|
13
14
|
this.kernel = new Kernel(registry);
|
|
14
|
-
this.#usesDefaultRegistry = this.kernel.registry
|
|
15
|
+
this.#usesDefaultRegistry = Registry.isDefault(this.kernel.registry);
|
|
15
16
|
on(this.kernel, MessageToView, (message) => {
|
|
16
17
|
const onMessageToView = this.onMessageToView;
|
|
17
18
|
if (onMessageToView == null) return;
|
|
@@ -40,6 +41,19 @@ class LocalShadowObjectEnv {
|
|
|
40
41
|
if (!waitForConfirmation) return result;
|
|
41
42
|
return result.then(() => void 0);
|
|
42
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The snapshot of this environment's Kernel, built synchronously inside the call. Nothing is
|
|
46
|
+
* cloned: the builder emits plain data and the caller owns it. A signal that is already aborted
|
|
47
|
+
* rejects before anything is built; there is no later point to abort at.
|
|
48
|
+
*/
|
|
49
|
+
inspect(request = {}, signal) {
|
|
50
|
+
if (signal?.aborted) return Promise.reject(signal.reason);
|
|
51
|
+
try {
|
|
52
|
+
return Promise.resolve(createKernelSnapshot(this.kernel, request));
|
|
53
|
+
} catch (error) {
|
|
54
|
+
return Promise.reject(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
43
57
|
async importScript(url) {
|
|
44
58
|
const module = await import(
|
|
45
59
|
/* @vite-ignore */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/view/LocalShadowObjectEnv.ts"],
|
|
4
|
-
"sourcesContent": ["import {on} from '@spearwolf/eventize';\nimport {MessageToView, ShadowObjectsExport} from '../constants.js';\nimport {importModule, missingShadowObjectsExportMessage} from '../in-the-dark/importModule.js';\nimport {Kernel, type MessageToViewEvent} from '../in-the-dark/Kernel.js';\nimport {Registry} from '../in-the-dark/Registry.js';\nimport type {ChangeTrailType, ShadowObjectsModule, SyncEvent} from '../types.js';\nimport {toUrlString} from '../utils/toUrlString.js';\nimport {cloneChangeTrail} from './cloneChangeTrail.js';\nimport type {IShadowObjectEnvProxy} from './IShadowObjectEnvProxy.js';\n\nexport class LocalShadowObjectEnv implements IShadowObjectEnvProxy {\n #importedModules: Set<ShadowObjectsModule> = new Set();\n readonly #usesDefaultRegistry: boolean;\n\n readonly kernel: Kernel;\n\n get registry(): Registry {\n return this.kernel.registry;\n }\n\n readonly isLocalEnv = true;\n\n disableStructuredClone = false;\n\n constructor(registry?: Registry) {\n this.kernel = new Kernel(registry);\n // The default registry is shared with every other environment in this thread and holds\n // everything `@ShadowObject` and `shadowObjects.define()` register without a registry of\n // their own, so `destroy()` must not clear it. This check only tells the default registry\n // apart from any other instance \u2014 a custom registry handed to more than one environment is\n // cleared by the first one of them to be destroyed, same as the default registry would be\n // without this guard.\n this.#usesDefaultRegistry = this.kernel.registry
|
|
5
|
-
"mappings": "AAAA,SAAQ,UAAS;AACjB,SAAQ,eAAe,2BAA0B;AACjD,SAAQ,cAAc,yCAAwC;AAC9D,SAAQ,cAAsC;AAC9C,SAAQ,gBAAe;
|
|
4
|
+
"sourcesContent": ["import {on} from '@spearwolf/eventize';\nimport {MessageToView, ShadowObjectsExport} from '../constants.js';\nimport {importModule, missingShadowObjectsExportMessage} from '../in-the-dark/importModule.js';\nimport {Kernel, type MessageToViewEvent} from '../in-the-dark/Kernel.js';\nimport {Registry} from '../in-the-dark/Registry.js';\nimport {createKernelSnapshot} from '../inspect/createKernelSnapshot.js';\nimport type {InspectRequest, KernelSnapshot} from '../inspect/types.js';\nimport type {ChangeTrailType, ShadowObjectsModule, SyncEvent} from '../types.js';\nimport {toUrlString} from '../utils/toUrlString.js';\nimport {cloneChangeTrail} from './cloneChangeTrail.js';\nimport type {IShadowObjectEnvProxy} from './IShadowObjectEnvProxy.js';\n\nexport class LocalShadowObjectEnv implements IShadowObjectEnvProxy {\n #importedModules: Set<ShadowObjectsModule> = new Set();\n readonly #usesDefaultRegistry: boolean;\n\n readonly kernel: Kernel;\n\n get registry(): Registry {\n return this.kernel.registry;\n }\n\n readonly isLocalEnv = true;\n\n disableStructuredClone = false;\n\n constructor(registry?: Registry) {\n this.kernel = new Kernel(registry);\n // The default registry is shared with every other environment in this thread and holds\n // everything `@ShadowObject` and `shadowObjects.define()` register without a registry of\n // their own, so `destroy()` must not clear it. This check only tells the default registry\n // apart from any other instance \u2014 a custom registry handed to more than one environment is\n // cleared by the first one of them to be destroyed, same as the default registry would be\n // without this guard.\n this.#usesDefaultRegistry = Registry.isDefault(this.kernel.registry);\n\n on(this.kernel, MessageToView, (message: MessageToViewEvent) => {\n const onMessageToView = (this as IShadowObjectEnvProxy).onMessageToView;\n if (onMessageToView == null) return;\n\n const {type, uuid, traverseChildren} = message;\n // WebIDL defaults `transfer` to `[]`, so a missing key and an empty list are the same call.\n const data = structuredClone(message.data, {transfer: message.transferables ?? []});\n // call() keeps the binding a plain method call would have given it: an outside\n // implementation of the proxy interface need not hand over a bound callback\n onMessageToView.call(this, {type, uuid, data, traverseChildren});\n });\n }\n\n start(): Promise<void> {\n return Promise.resolve();\n }\n\n applyChangeTrail(data: ChangeTrailType, waitForConfirmation: boolean): Promise<void> {\n const syncData: SyncEvent = {changeTrail: this.disableStructuredClone ? data : cloneChangeTrail(data)};\n let result: Promise<void>;\n try {\n this.kernel.run(syncData);\n result = Promise.resolve();\n } catch (error) {\n result = Promise.reject(error);\n }\n if (!waitForConfirmation) return result;\n // The kernel above still runs synchronously, in the same tick this method is called in; only\n // the settling of the returned promise is deferred here, by one microtask, so it never\n // settles in the same microtask as the call that made it. That is the guarantee this gives \u2014\n // not the same relative ordering RemoteWorkerEnv has against its own promises, which settles\n // only after its worker round-trip and can land later still.\n return result.then(() => undefined);\n }\n\n /**\n * The snapshot of this environment's Kernel, built synchronously inside the call. Nothing is\n * cloned: the builder emits plain data and the caller owns it. A signal that is already aborted\n * rejects before anything is built; there is no later point to abort at.\n */\n inspect(request: InspectRequest = {}, signal?: AbortSignal): Promise<KernelSnapshot> {\n if (signal?.aborted) return Promise.reject(signal.reason);\n try {\n return Promise.resolve(createKernelSnapshot(this.kernel, request));\n } catch (error) {\n return Promise.reject(error);\n }\n }\n\n async importScript(url: URL | string): Promise<void> {\n const module = await import(/* @vite-ignore */ toUrlString(url));\n // A module without this export is wrong in both environments, and a local run rejects it\n // right here instead of staying quiet -- so a developer sees it before switching to a worker.\n if (!module[ShadowObjectsExport]) {\n throw new Error(missingShadowObjectsExportMessage);\n }\n await this.importModule(module[ShadowObjectsExport]);\n }\n\n async importModule(module: ShadowObjectsModule): Promise<void> {\n return importModule(this.kernel, module, this.#importedModules);\n }\n\n destroy(): void {\n this.kernel.destroy();\n if (!this.#usesDefaultRegistry) {\n this.registry.clear();\n }\n this.#importedModules.clear();\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAQ,UAAS;AACjB,SAAQ,eAAe,2BAA0B;AACjD,SAAQ,cAAc,yCAAwC;AAC9D,SAAQ,cAAsC;AAC9C,SAAQ,gBAAe;AACvB,SAAQ,4BAA2B;AAGnC,SAAQ,mBAAkB;AAC1B,SAAQ,wBAAuB;AAGxB,MAAM,qBAAsD;AAAA,EAcjE,YAAY,UAAqB;AAbjC,4BAA6C,oBAAI,IAAI;AASrD,SAAS,aAAa;AAEtB,kCAAyB;AAGvB,SAAK,SAAS,IAAI,OAAO,QAAQ;AAOjC,SAAK,uBAAuB,SAAS,UAAU,KAAK,OAAO,QAAQ;AAEnE,OAAG,KAAK,QAAQ,eAAe,CAAC,YAAgC;AAC9D,YAAM,kBAAmB,KAA+B;AACxD,UAAI,mBAAmB,KAAM;AAE7B,YAAM,EAAC,MAAM,MAAM,iBAAgB,IAAI;AAEvC,YAAM,OAAO,gBAAgB,QAAQ,MAAM,EAAC,UAAU,QAAQ,iBAAiB,CAAC,EAAC,CAAC;AAGlF,sBAAgB,KAAK,MAAM,EAAC,MAAM,MAAM,MAAM,iBAAgB,CAAC;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAlCA;AAAA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