@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.
Files changed (37) hide show
  1. package/dist/StateContainerRegistry-141uHhtF.cjs.map +1 -1
  2. package/dist/StateContainerRegistry-BH7aOMWV.js +892 -0
  3. package/dist/StateContainerRegistry-BH7aOMWV.js.map +1 -0
  4. package/dist/StateContainerRegistry-BsH_s0pJ.js +895 -0
  5. package/dist/StateContainerRegistry-BsH_s0pJ.js.map +1 -0
  6. package/dist/StateContainerRegistry-CBLeHObO.cjs +1002 -0
  7. package/dist/StateContainerRegistry-CBLeHObO.cjs.map +1 -0
  8. package/dist/StateContainerRegistry-MkT0W4C2.cjs +999 -0
  9. package/dist/StateContainerRegistry-MkT0W4C2.cjs.map +1 -0
  10. package/dist/StateContainerRegistry-vWgsD-RP.js.map +1 -1
  11. package/dist/constants.d.cts +0 -7
  12. package/dist/constants.d.ts +0 -7
  13. package/dist/core/StateContainer.d.ts +16 -7
  14. package/dist/core/StateContainerRegistry.d.ts +9 -4
  15. package/dist/core/meta.d.ts +34 -41
  16. package/dist/ensure-BjhbDW8Z.cjs +761 -0
  17. package/dist/ensure-BjhbDW8Z.cjs.map +1 -0
  18. package/dist/ensure-BnVyd6s4.js +730 -0
  19. package/dist/ensure-BnVyd6s4.js.map +1 -0
  20. package/dist/ensure-CneMkpbI.js +731 -0
  21. package/dist/ensure-CneMkpbI.js.map +1 -0
  22. package/dist/ensure-D15vGnk5.cjs +783 -0
  23. package/dist/ensure-D15vGnk5.cjs.map +1 -0
  24. package/dist/ensure-D3w6YGp9.cjs +784 -0
  25. package/dist/ensure-D3w6YGp9.cjs.map +1 -0
  26. package/dist/ensure-dsqWhIuO.js +708 -0
  27. package/dist/ensure-dsqWhIuO.js.map +1 -0
  28. package/dist/index.cjs +2 -2
  29. package/dist/index.js +2 -2
  30. package/dist/plugin/PluginManager.d.ts +9 -4
  31. package/dist/plugins.cjs +7 -4
  32. package/dist/plugins.cjs.map +1 -1
  33. package/dist/plugins.js +7 -4
  34. package/dist/plugins.js.map +1 -1
  35. package/dist/testing.cjs +2 -2
  36. package/dist/testing.js +2 -2
  37. package/package.json +2 -3
@@ -1,25 +1,35 @@
1
1
  /**
2
2
  * `$blac` meta namespace for `StateContainer`.
3
3
  *
4
- * Getters/methods here close over the *real* container instance captured at
5
- * `createMeta` time rather than reading a `this`-receiver. `buildTrackedProxy`
6
- * no longer uses a `this`-Proxy (getters run with `this` = the real instance),
7
- * so ES `#private` is safe here now; the closure style is kept because it also
8
- * keeps this own, frozen property independent of the proxy entirely.
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 interface BlacHydration<S extends object> {
19
- readonly status: HydrationStatus;
20
- readonly error: Error | undefined;
21
- readonly isHydrated: boolean;
22
- readonly changedWhileHydrating: boolean;
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
- * The object is allocated once per container, frozen, branded, and exposes
36
- * live getters that read the container's current `_`-private fields — values
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 interface BlacMeta<S extends object = any> {
40
- readonly name: string;
41
- readonly id: string;
42
- readonly debug: boolean;
43
- readonly createdAt: number;
44
- readonly disposed: boolean;
45
- readonly dependencies: ReadonlyMap<StateContainerConstructor, string>;
46
- readonly hydration: BlacHydration<S>;
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>;