@blac/core 2.0.4 → 2.0.6

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 (81) hide show
  1. package/README.md +98 -126
  2. package/dist/StateContainerRegistry-Brmferpf.js +588 -0
  3. package/dist/StateContainerRegistry-Brmferpf.js.map +1 -0
  4. package/dist/StateContainerRegistry-CVPTMaHn.cjs +629 -0
  5. package/dist/StateContainerRegistry-CVPTMaHn.cjs.map +1 -0
  6. package/dist/branded-DndTHjv2.cjs +18 -0
  7. package/dist/branded-DndTHjv2.cjs.map +1 -0
  8. package/dist/branded-mwGzzPF1.js +13 -0
  9. package/dist/branded-mwGzzPF1.js.map +1 -0
  10. package/dist/config-BInS_9WT.cjs +101 -0
  11. package/dist/config-BInS_9WT.cjs.map +1 -0
  12. package/dist/config-BmFnPVM0.js +42 -0
  13. package/dist/config-BmFnPVM0.js.map +1 -0
  14. package/dist/constants.d.cts +81 -0
  15. package/dist/constants.d.ts +81 -0
  16. package/dist/core/Cubit.d.ts +24 -0
  17. package/dist/core/StateContainer.d.ts +177 -0
  18. package/dist/core/StateContainerRegistry.d.ts +189 -0
  19. package/dist/debug.cjs +11 -26
  20. package/dist/debug.d.cts +35 -0
  21. package/dist/debug.d.ts +35 -0
  22. package/dist/debug.js +2 -18
  23. package/dist/decorators/blac.d.ts +40 -0
  24. package/dist/decorators/index.d.ts +1 -0
  25. package/dist/index.cjs +162 -55
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +17 -794
  28. package/dist/index.d.ts +17 -794
  29. package/dist/index.js +145 -31
  30. package/dist/index.js.map +1 -1
  31. package/dist/plugin/BlacPlugin.d.ts +143 -0
  32. package/dist/plugin/PluginManager.d.ts +81 -0
  33. package/dist/plugins.cjs +3 -3
  34. package/dist/plugins.d.cts +25 -0
  35. package/dist/plugins.d.ts +25 -0
  36. package/dist/plugins.js +2 -3
  37. package/dist/registry/acquire.d.ts +2 -0
  38. package/dist/registry/borrow.d.ts +9 -0
  39. package/dist/registry/config.d.ts +8 -0
  40. package/dist/registry/ensure.d.ts +2 -0
  41. package/dist/registry/index.d.ts +7 -0
  42. package/dist/registry/management.d.ts +4 -0
  43. package/dist/registry/queries.d.ts +5 -0
  44. package/dist/registry/release.d.ts +2 -0
  45. package/dist/resolve-dependencies-B22YjFGk.cjs +773 -0
  46. package/dist/resolve-dependencies-B22YjFGk.cjs.map +1 -0
  47. package/dist/resolve-dependencies-Cvq0glJF.js +648 -0
  48. package/dist/resolve-dependencies-Cvq0glJF.js.map +1 -0
  49. package/dist/tracked-B_MUXIpe.cjs +216 -0
  50. package/dist/tracked-B_MUXIpe.cjs.map +1 -0
  51. package/dist/tracked-I_q9buYg.js +181 -0
  52. package/dist/tracked-I_q9buYg.js.map +1 -0
  53. package/dist/tracking.cjs +3 -3
  54. package/dist/tracking.js +2 -3
  55. package/dist/types/branded.d.ts +26 -0
  56. package/dist/types/utilities.d.ts +51 -0
  57. package/dist/types.cjs +3 -14
  58. package/dist/types.js +1 -12
  59. package/dist/utils/idGenerator.d.ts +73 -0
  60. package/dist/utils/static-props.d.ts +35 -0
  61. package/dist/watch/index.d.ts +2 -0
  62. package/dist/watch/watch.d.ts +50 -0
  63. package/dist/watch-entry.cjs +7 -109
  64. package/dist/watch-entry.d.cts +26 -0
  65. package/dist/watch-entry.d.ts +26 -0
  66. package/dist/watch-entry.js +1 -104
  67. package/package.json +29 -51
  68. package/dist/StateContainerRegistry.cjs.map +0 -1
  69. package/dist/StateContainerRegistry.js.map +0 -1
  70. package/dist/debug.cjs.map +0 -1
  71. package/dist/debug.js.map +0 -1
  72. package/dist/management.cjs.map +0 -1
  73. package/dist/management.js.map +0 -1
  74. package/dist/resolve-dependencies.cjs.map +0 -1
  75. package/dist/resolve-dependencies.js.map +0 -1
  76. package/dist/types.cjs.map +0 -1
  77. package/dist/types.js.map +0 -1
  78. package/dist/watch-entry.cjs.map +0 -1
  79. package/dist/watch-entry.js.map +0 -1
  80. package/dist/watch.cjs.map +0 -1
  81. package/dist/watch.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Plugins Subpath Export
3
+ *
4
+ * Plugin system utilities for extending BlaC functionality.
5
+ * Import from '@blac/core/plugins'
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { PluginManager, getPluginManager, type BlacPlugin } from '@blac/core/plugins';
10
+ *
11
+ * const myPlugin: BlacPlugin = {
12
+ * name: 'my-plugin',
13
+ * onInstanceCreated(context) {
14
+ * console.log('Instance created:', context.instance);
15
+ * },
16
+ * };
17
+ *
18
+ * getPluginManager().register(myPlugin);
19
+ * ```
20
+ *
21
+ * @packageDocumentation
22
+ */
23
+ export { PluginManager } from './plugin/PluginManager';
24
+ export type { BlacPlugin, BlacPluginWithInit, PluginContext, PluginConfig, InstanceMetadata, } from './plugin/BlacPlugin';
25
+ export { getPluginManager } from './core/StateContainerRegistry';
package/dist/plugins.js CHANGED
@@ -1,3 +1,2 @@
1
- import { s as PluginManager, t as getPluginManager } from "./StateContainerRegistry.js";
2
-
3
- export { PluginManager, getPluginManager };
1
+ import { i as PluginManager, t as getPluginManager } from "./StateContainerRegistry-Brmferpf.js";
2
+ export { PluginManager, getPluginManager };
@@ -0,0 +1,2 @@
1
+ import type { StateContainerConstructor } from '../types/utilities';
2
+ export declare function acquire<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): InstanceType<T>;
@@ -0,0 +1,9 @@
1
+ import type { StateContainerConstructor } from '../types/utilities';
2
+ export declare function borrow<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): InstanceType<T>;
3
+ export declare function borrowSafe<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): {
4
+ error: Error;
5
+ instance: null;
6
+ } | {
7
+ error: null;
8
+ instance: InstanceType<T>;
9
+ };
@@ -0,0 +1,8 @@
1
+ import { StateContainerRegistry } from '../core/StateContainerRegistry';
2
+ export declare function getRegistry(): StateContainerRegistry;
3
+ export declare function setRegistry(registry: StateContainerRegistry): void;
4
+ export declare function getStats(): {
5
+ registeredTypes: number;
6
+ totalInstances: number;
7
+ typeBreakdown: Record<string, number>;
8
+ };
@@ -0,0 +1,2 @@
1
+ import type { StateContainerConstructor } from '../types/utilities';
2
+ export declare function ensure<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): InstanceType<T>;
@@ -0,0 +1,7 @@
1
+ export { acquire } from './acquire';
2
+ export { borrow, borrowSafe } from './borrow';
3
+ export { ensure } from './ensure';
4
+ export { release } from './release';
5
+ export { hasInstance, getRefCount, getAll, forEach } from './queries';
6
+ export { clear, clearAll, register } from './management';
7
+ export { getRegistry, setRegistry, getStats } from './config';
@@ -0,0 +1,4 @@
1
+ import type { StateContainerConstructor } from '../types/utilities';
2
+ export declare function clear<T extends StateContainerConstructor>(BlocClass: T): void;
3
+ export declare function clearAll(): void;
4
+ export declare function register<T extends StateContainerConstructor>(BlocClass: T, isolated?: boolean): void;
@@ -0,0 +1,5 @@
1
+ import type { StateContainerConstructor, InstanceReadonlyState } from '../types/utilities';
2
+ export declare function hasInstance<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): boolean;
3
+ export declare function getRefCount<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string): number;
4
+ export declare function getAll<T extends StateContainerConstructor>(BlocClass: T): InstanceReadonlyState<T>[];
5
+ export declare function forEach<T extends StateContainerConstructor>(BlocClass: T, callback: (instance: InstanceReadonlyState<T>) => void): void;
@@ -0,0 +1,2 @@
1
+ import type { StateContainerConstructor } from '../types/utilities';
2
+ export declare function release<T extends StateContainerConstructor>(BlocClass: T, instanceKey?: string, forceDispose?: boolean): void;