@blac/core 2.0.21 → 2.0.22
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/dist/StateContainerRegistry-141uHhtF.cjs.map +1 -1
- package/dist/StateContainerRegistry-BH7aOMWV.js +892 -0
- package/dist/StateContainerRegistry-BH7aOMWV.js.map +1 -0
- package/dist/StateContainerRegistry-BsH_s0pJ.js +895 -0
- package/dist/StateContainerRegistry-BsH_s0pJ.js.map +1 -0
- package/dist/StateContainerRegistry-CBLeHObO.cjs +1002 -0
- package/dist/StateContainerRegistry-CBLeHObO.cjs.map +1 -0
- package/dist/StateContainerRegistry-MkT0W4C2.cjs +999 -0
- package/dist/StateContainerRegistry-MkT0W4C2.cjs.map +1 -0
- package/dist/StateContainerRegistry-vWgsD-RP.js.map +1 -1
- package/dist/constants.d.cts +0 -7
- package/dist/constants.d.ts +0 -7
- package/dist/core/StateContainer.d.ts +16 -7
- package/dist/core/StateContainerRegistry.d.ts +9 -4
- package/dist/core/meta.d.ts +34 -41
- package/dist/ensure-BjhbDW8Z.cjs +761 -0
- package/dist/ensure-BjhbDW8Z.cjs.map +1 -0
- package/dist/ensure-BnVyd6s4.js +730 -0
- package/dist/ensure-BnVyd6s4.js.map +1 -0
- package/dist/ensure-CneMkpbI.js +731 -0
- package/dist/ensure-CneMkpbI.js.map +1 -0
- package/dist/ensure-D15vGnk5.cjs +783 -0
- package/dist/ensure-D15vGnk5.cjs.map +1 -0
- package/dist/ensure-D3w6YGp9.cjs +784 -0
- package/dist/ensure-D3w6YGp9.cjs.map +1 -0
- package/dist/ensure-dsqWhIuO.js +708 -0
- package/dist/ensure-dsqWhIuO.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/PluginManager.d.ts +9 -4
- package/dist/plugins.cjs +7 -4
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.js +7 -4
- package/dist/plugins.js.map +1 -1
- package/dist/testing.cjs +2 -2
- package/dist/testing.js +2 -2
- package/package.json +2 -3
package/dist/core/meta.d.ts
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `$blac` meta namespace for `StateContainer`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* `BlacMeta` and `BlacHydration` are classes whose accessors live on the
|
|
5
|
+
* prototype and read the container through one `#private` back-reference, so
|
|
6
|
+
* a container allocates a single small object here instead of a literal with
|
|
7
|
+
* seven closures. Members are therefore not own-enumerable: `Object.keys` and
|
|
8
|
+
* `JSON.stringify` see an empty object. Read the fields by name.
|
|
9
9
|
*/
|
|
10
10
|
import type { HydrationStatus } from './StateContainer';
|
|
11
11
|
import type { StateContainerConstructor } from '../types/utilities';
|
|
12
|
+
/**
|
|
13
|
+
* Non-enumerable brand carried on every `$blac` object. Used by the clobber
|
|
14
|
+
* guard in `StateContainer` to detect a subclass class-field shadowing the
|
|
15
|
+
* base's own `$blac` property, and by the meta tests. Intentionally NOT
|
|
16
|
+
* re-exported from the package barrel.
|
|
17
|
+
*/
|
|
18
|
+
export declare const META_BRAND: unique symbol;
|
|
12
19
|
/**
|
|
13
20
|
* Hydration sub-surface of {@link BlacMeta}. Exposes the container's
|
|
14
21
|
* hydration state machine — the `begin`/`apply`/`finish`/`fail`/`wait`
|
|
15
22
|
* methods and the `status`/`error`/`isHydrated`/`changedWhileHydrating`
|
|
16
23
|
* getters — namespaced under `$blac`.
|
|
17
24
|
*/
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
export declare class BlacHydration<S extends object> {
|
|
26
|
+
#private;
|
|
27
|
+
/** @internal */
|
|
28
|
+
constructor(container: object);
|
|
29
|
+
get status(): HydrationStatus;
|
|
30
|
+
get error(): Error | undefined;
|
|
31
|
+
get isHydrated(): boolean;
|
|
32
|
+
get changedWhileHydrating(): boolean;
|
|
23
33
|
begin(): void;
|
|
24
34
|
apply(next: S): boolean;
|
|
25
35
|
finish(): void;
|
|
@@ -32,36 +42,19 @@ export interface BlacHydration<S extends object> {
|
|
|
32
42
|
* `createdAt`, `disposed`, `dependencies`, and the hydration methods) under one
|
|
33
43
|
* namespace, keeping the generic names free for userland blocs.
|
|
34
44
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* are never snapshotted.
|
|
45
|
+
* Allocated once per container and frozen. Every accessor reads the
|
|
46
|
+
* container's current `_`-private fields live — values are never snapshotted.
|
|
38
47
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
export declare class BlacMeta<S extends object = any> {
|
|
49
|
+
#private;
|
|
50
|
+
/** @internal Called from the `StateContainer` field initializer. */
|
|
51
|
+
constructor(container: object);
|
|
52
|
+
get name(): string;
|
|
53
|
+
get id(): string;
|
|
54
|
+
get debug(): boolean;
|
|
55
|
+
get createdAt(): number;
|
|
56
|
+
get disposed(): boolean;
|
|
57
|
+
get dependencies(): ReadonlyMap<StateContainerConstructor, string>;
|
|
58
|
+
/** Built on first access; identity-stable afterwards. */
|
|
59
|
+
get hydration(): BlacHydration<S>;
|
|
47
60
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Non-enumerable brand carried on every `$blac` object produced by
|
|
50
|
-
* {@link createMeta}. Used by the clobber guard in `StateContainer` to detect
|
|
51
|
-
* a subclass class-field shadowing the base's own `$blac` property, and by the
|
|
52
|
-
* meta tests. Intentionally NOT re-exported from the package barrel.
|
|
53
|
-
*/
|
|
54
|
-
export declare const META_BRAND: unique symbol;
|
|
55
|
-
/**
|
|
56
|
-
* Build the frozen, branded `$blac` meta object for a container.
|
|
57
|
-
*
|
|
58
|
-
* Called from a `StateContainer` field initializer (`$blac = createMeta(this)`).
|
|
59
|
-
* Only the back-reference is captured at this point; every getter/method reads
|
|
60
|
-
* the container's `_`-private fields lazily on access, so field-initializer
|
|
61
|
-
* ordering relative to those private fields is irrelevant.
|
|
62
|
-
*
|
|
63
|
-
* The getters close over `container` (the real instance), never over a
|
|
64
|
-
* `this`-receiver — this is what keeps `$blac` reads safe through
|
|
65
|
-
* `buildTrackedProxy`.
|
|
66
|
-
*/
|
|
67
|
-
export declare function createMeta<S extends object>(container: object): BlacMeta<S>;
|