@raphy-js/raph 1.0.0-dev.2 → 1.0.1-dev.25

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 (246) hide show
  1. package/README.md +1096 -0
  2. package/dist/api/Raph.d.ts +59 -190
  3. package/dist/api/RaphFacadeSession.d.ts +90 -0
  4. package/dist/api/RaphReactivityInstance.d.ts +72 -0
  5. package/dist/api/errors.d.ts +9 -4
  6. package/dist/api/types.d.ts +162 -17
  7. package/dist/core-CClhT8WR.js +1044 -0
  8. package/dist/core-cPQWYD4K.cjs +1 -0
  9. package/dist/debug/api/Raph.cjs +1 -1
  10. package/dist/debug/api/Raph.js +368 -367
  11. package/dist/debug/api/RaphFacadeSession.cjs +1 -0
  12. package/dist/debug/api/RaphFacadeSession.js +302 -0
  13. package/dist/debug/api/RaphReactivityInstance.cjs +1 -0
  14. package/dist/debug/api/RaphReactivityInstance.js +146 -0
  15. package/dist/debug/api/errors.cjs +1 -1
  16. package/dist/debug/api/errors.js +10 -7
  17. package/dist/debug/path/DataPath.cjs +1 -0
  18. package/dist/debug/path/DataPath.js +390 -0
  19. package/dist/debug/path/PathRouter.cjs +1 -0
  20. package/dist/debug/path/PathRouter.js +80 -0
  21. package/dist/debug/path/RaphKernel.cjs +1 -1
  22. package/dist/debug/path/RaphKernel.js +316 -236
  23. package/dist/debug/path/data-path.utils.cjs +1 -0
  24. package/dist/debug/path/data-path.utils.js +56 -0
  25. package/dist/debug/path/derived/DerivedRegistry.cjs +1 -0
  26. package/dist/debug/path/derived/DerivedRegistry.js +143 -0
  27. package/dist/debug/path/derived/RaphDerivedHandle.cjs +1 -0
  28. package/dist/debug/path/{RaphDerivedHandle.js → derived/RaphDerivedHandle.js} +19 -22
  29. package/dist/debug/path/derived/derived-collection.utils.cjs +1 -0
  30. package/dist/debug/path/{derived-collection.js → derived/derived-collection.utils.js} +71 -71
  31. package/dist/debug/path/derived/derived-strategy.types.cjs +1 -0
  32. package/dist/debug/path/derived/derived-strategy.types.js +1 -0
  33. package/dist/debug/path/meta/MetaController.cjs +1 -0
  34. package/dist/debug/path/{MetaController.js → meta/MetaController.js} +58 -66
  35. package/dist/debug/path/meta/RaphMeta.cjs +1 -0
  36. package/dist/debug/path/meta/RaphMeta.js +62 -0
  37. package/dist/debug/path/meta/RaphMetaStore.cjs +1 -0
  38. package/dist/debug/path/{RaphMetaStore.js → meta/RaphMetaStore.js} +24 -30
  39. package/dist/debug/path/meta/meta.types.cjs +1 -0
  40. package/dist/debug/path/meta/meta.types.js +1 -0
  41. package/dist/debug/path/storage/AdapterPathStore.cjs +1 -0
  42. package/dist/debug/path/storage/AdapterPathStore.js +128 -0
  43. package/dist/debug/path/storage/DefaultDataAdapter.cjs +1 -0
  44. package/dist/debug/path/{data-adapter.js → storage/DefaultDataAdapter.js} +47 -57
  45. package/dist/debug/path/storage/PathEventHub.cjs +1 -0
  46. package/dist/debug/path/storage/PathEventHub.js +161 -0
  47. package/dist/debug/path/storage/PathStore.cjs +1 -0
  48. package/dist/debug/path/{PathStore.js → storage/PathStore.js} +88 -98
  49. package/dist/debug/path/storage/createDataDraft.cjs +1 -0
  50. package/dist/debug/path/{data-draft.js → storage/createDataDraft.js} +24 -28
  51. package/dist/debug/path/storage/data-adapter.types.cjs +1 -0
  52. package/dist/debug/path/storage/data-adapter.types.js +1 -0
  53. package/dist/debug/reactivity/disposal.cjs +1 -0
  54. package/dist/debug/reactivity/disposal.js +32 -0
  55. package/dist/debug/reactivity/engine.cjs +1 -1
  56. package/dist/debug/reactivity/engine.js +888 -321
  57. package/dist/debug/reactivity/reactive-object.cjs +1 -0
  58. package/dist/debug/reactivity/reactive-object.js +265 -0
  59. package/dist/debug/reactivity/scope.cjs +1 -1
  60. package/dist/debug/reactivity/scope.js +221 -117
  61. package/dist/debug/reactivity/watch.cjs +1 -1
  62. package/dist/debug/reactivity/watch.js +1 -1
  63. package/dist/debug/runtime/RaphRuntime.cjs +1 -1
  64. package/dist/debug/runtime/RaphRuntime.js +1134 -502
  65. package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -0
  66. package/dist/debug/runtime/diagnostics/RaphDebug.js +287 -0
  67. package/dist/debug/runtime/errors.cjs +1 -1
  68. package/dist/debug/runtime/errors.js +6 -3
  69. package/dist/debug/runtime/ownership/RaphEffectScope.cjs +1 -0
  70. package/dist/debug/runtime/ownership/RaphEffectScope.js +304 -0
  71. package/dist/debug/runtime/ownership/RaphNode.cjs +1 -0
  72. package/dist/debug/runtime/ownership/RaphNode.js +665 -0
  73. package/dist/debug/runtime/ownership/RaphScope.cjs +1 -0
  74. package/dist/debug/runtime/ownership/RaphScope.js +236 -0
  75. package/dist/debug/runtime/ownership/parent-graph.types.cjs +1 -0
  76. package/dist/debug/runtime/ownership/parent-graph.types.js +1 -0
  77. package/dist/debug/runtime/phases/RaphFrameLoop.cjs +1 -0
  78. package/dist/debug/runtime/{RaphFrameLoop.js → phases/RaphFrameLoop.js} +13 -17
  79. package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -0
  80. package/dist/debug/runtime/phases/RaphPhasePipeline.js +848 -0
  81. package/dist/debug/runtime/phases/RaphPhaseTaskRecord.cjs +1 -0
  82. package/dist/debug/runtime/phases/RaphPhaseTaskRecord.js +176 -0
  83. package/dist/debug/runtime/phases/RaphPhaseWatch.cjs +1 -0
  84. package/dist/debug/runtime/phases/RaphPhaseWatch.js +20 -0
  85. package/dist/debug/runtime/phases/orderPhaseTasks.cjs +1 -0
  86. package/dist/debug/runtime/phases/orderPhaseTasks.js +59 -0
  87. package/dist/debug/runtime/reactivity/PathHandle.cjs +1 -0
  88. package/dist/debug/runtime/reactivity/PathHandle.js +165 -0
  89. package/dist/debug/runtime/reactivity/RaphMetaSource.cjs +1 -0
  90. package/dist/debug/runtime/reactivity/RaphMetaSource.js +108 -0
  91. package/dist/debug/runtime/reactivity/RaphSelector.cjs +1 -0
  92. package/dist/debug/runtime/reactivity/RaphSelector.js +503 -0
  93. package/dist/debug/runtime/reactivity/RaphWorkGraph.cjs +1 -0
  94. package/dist/debug/runtime/reactivity/RaphWorkGraph.js +1157 -0
  95. package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -0
  96. package/dist/debug/runtime/reactivity/RuntimeReactivity.js +550 -0
  97. package/dist/debug/runtime/reactivity/RuntimeWatch.cjs +1 -0
  98. package/dist/debug/runtime/reactivity/RuntimeWatch.js +77 -0
  99. package/dist/debug/runtime/reactivity/disposal-sweep.utils.cjs +1 -0
  100. package/dist/debug/runtime/reactivity/disposal-sweep.utils.js +42 -0
  101. package/dist/debug/runtime/reactivity/runtime-reactivity.types.cjs +1 -0
  102. package/dist/debug/runtime/reactivity/runtime-reactivity.types.js +1 -0
  103. package/dist/entrypoints/machine-testing.d.ts +2 -0
  104. package/dist/entrypoints/machine.d.ts +5 -0
  105. package/dist/entrypoints/path.d.ts +14 -0
  106. package/dist/entrypoints/reactivity.d.ts +1 -0
  107. package/dist/entrypoints/runtime.d.ts +18 -0
  108. package/dist/index.cjs +1 -1
  109. package/dist/index.js +46 -38
  110. package/dist/machine/compiler.d.ts +71 -0
  111. package/dist/machine/core.d.ts +50 -0
  112. package/dist/machine/persistence.d.ts +5 -0
  113. package/dist/machine/runtime.d.ts +4 -0
  114. package/dist/machine/testing.d.ts +43 -0
  115. package/dist/machine/types.d.ts +155 -0
  116. package/dist/machine-testing.cjs +1 -0
  117. package/dist/machine-testing.js +188 -0
  118. package/dist/machine.cjs +1 -0
  119. package/dist/machine.js +822 -0
  120. package/dist/main.d.ts +20 -0
  121. package/dist/path/{data-path.d.ts → DataPath.d.ts} +16 -40
  122. package/dist/path/{path-router.d.ts → PathRouter.d.ts} +1 -1
  123. package/dist/path/RaphKernel.d.ts +37 -10
  124. package/dist/path/data-path.types.d.ts +34 -0
  125. package/dist/path/data-path.utils.d.ts +9 -0
  126. package/dist/path/{DerivedRegistry.d.ts → derived/DerivedRegistry.d.ts} +2 -2
  127. package/dist/path/{RaphDerivedHandle.d.ts → derived/RaphDerivedHandle.d.ts} +3 -3
  128. package/dist/path/derived/derived-collection.types.d.ts +12 -0
  129. package/dist/path/{derived-collection.d.ts → derived/derived-collection.utils.d.ts} +3 -13
  130. package/dist/path/{derived-strategies.d.ts → derived/derived-strategy.types.d.ts} +0 -3
  131. package/dist/path/derived/derived-strategy.utils.d.ts +4 -0
  132. package/dist/path/{MetaController.d.ts → meta/MetaController.d.ts} +4 -4
  133. package/dist/path/{RaphMeta.d.ts → meta/RaphMeta.d.ts} +2 -2
  134. package/dist/path/{RaphMetaStore.d.ts → meta/RaphMetaStore.d.ts} +1 -1
  135. package/dist/path/{meta.types.d.ts → meta/meta.types.d.ts} +2 -4
  136. package/dist/path/path.types.d.ts +3 -2
  137. package/dist/path/{segment-key.d.ts → pathSegmentKey.d.ts} +1 -1
  138. package/dist/path/{AdapterPathStore.d.ts → storage/AdapterPathStore.d.ts} +4 -4
  139. package/dist/path/{data-adapter.d.ts → storage/DefaultDataAdapter.d.ts} +2 -17
  140. package/dist/path/storage/PathEventHub.d.ts +62 -0
  141. package/dist/path/{PathStore.d.ts → storage/PathStore.d.ts} +7 -7
  142. package/dist/path/storage/data-adapter.types.d.ts +17 -0
  143. package/dist/path.cjs +1 -1
  144. package/dist/path.js +16 -16
  145. package/dist/raph.cjs +1 -1
  146. package/dist/raph.js +46 -38
  147. package/dist/reactivity/disposal.d.ts +14 -0
  148. package/dist/reactivity/engine.d.ts +193 -6
  149. package/dist/reactivity/reactive-object.d.ts +36 -0
  150. package/dist/reactivity/scope.d.ts +108 -30
  151. package/dist/reactivity/types.d.ts +25 -0
  152. package/dist/reactivity.cjs +1 -1
  153. package/dist/reactivity.js +12 -12
  154. package/dist/runtime/RaphRuntime.d.ts +319 -160
  155. package/dist/runtime/diagnostics/RaphDebug.d.ts +239 -0
  156. package/dist/runtime/errors.d.ts +5 -0
  157. package/dist/runtime/ownership/RaphEffectScope.d.ts +98 -0
  158. package/dist/runtime/ownership/RaphNode.d.ts +310 -0
  159. package/dist/runtime/ownership/RaphScope.d.ts +168 -0
  160. package/dist/runtime/{parent-graph.d.ts → ownership/parent-graph.types.d.ts} +0 -1
  161. package/dist/runtime/ownership/parentGraph.d.ts +3 -0
  162. package/dist/runtime/phases/RaphPhasePipeline.d.ts +253 -0
  163. package/dist/runtime/phases/RaphPhaseTaskRecord.d.ts +195 -0
  164. package/dist/runtime/phases/RaphPhaseWatch.d.ts +22 -0
  165. package/dist/runtime/phases/orderPhaseTasks.d.ts +6 -0
  166. package/dist/runtime/phases/phase.types.d.ts +171 -0
  167. package/dist/runtime/{PathHandle.d.ts → reactivity/PathHandle.d.ts} +14 -6
  168. package/dist/runtime/reactivity/RaphMetaSource.d.ts +32 -0
  169. package/dist/runtime/reactivity/RaphSelector.d.ts +338 -0
  170. package/dist/runtime/reactivity/RaphWorkGraph.d.ts +309 -0
  171. package/dist/runtime/reactivity/RuntimeReactivity.d.ts +293 -0
  172. package/dist/runtime/{RuntimeWatch.d.ts → reactivity/RuntimeWatch.d.ts} +12 -6
  173. package/dist/runtime/reactivity/disposal-sweep.utils.d.ts +19 -0
  174. package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +56 -0
  175. package/dist/runtime.cjs +1 -1
  176. package/dist/runtime.js +21 -16
  177. package/package.json +76 -35
  178. package/ReadMe.md +0 -153
  179. package/dist/api/public.d.ts +0 -22
  180. package/dist/debug/api/public.cjs +0 -1
  181. package/dist/debug/api/public.js +0 -40
  182. package/dist/debug/path/AdapterPathStore.cjs +0 -1
  183. package/dist/debug/path/AdapterPathStore.js +0 -133
  184. package/dist/debug/path/DerivedRegistry.cjs +0 -1
  185. package/dist/debug/path/DerivedRegistry.js +0 -157
  186. package/dist/debug/path/MetaController.cjs +0 -1
  187. package/dist/debug/path/PathEventHub.cjs +0 -1
  188. package/dist/debug/path/PathEventHub.js +0 -148
  189. package/dist/debug/path/PathStore.cjs +0 -1
  190. package/dist/debug/path/RaphDerivedHandle.cjs +0 -1
  191. package/dist/debug/path/RaphMeta.cjs +0 -1
  192. package/dist/debug/path/RaphMeta.js +0 -68
  193. package/dist/debug/path/RaphMetaStore.cjs +0 -1
  194. package/dist/debug/path/data-adapter.cjs +0 -1
  195. package/dist/debug/path/data-draft.cjs +0 -1
  196. package/dist/debug/path/data-path.cjs +0 -1
  197. package/dist/debug/path/data-path.js +0 -423
  198. package/dist/debug/path/derived-collection.cjs +0 -1
  199. package/dist/debug/path/path-router.cjs +0 -1
  200. package/dist/debug/path/path-router.js +0 -86
  201. package/dist/debug/path/public.cjs +0 -1
  202. package/dist/debug/path/public.js +0 -18
  203. package/dist/debug/runtime/PathHandle.cjs +0 -1
  204. package/dist/debug/runtime/PathHandle.js +0 -139
  205. package/dist/debug/runtime/RaphDebug.cjs +0 -1
  206. package/dist/debug/runtime/RaphDebug.js +0 -15
  207. package/dist/debug/runtime/RaphFrameLoop.cjs +0 -1
  208. package/dist/debug/runtime/RaphNode.cjs +0 -1
  209. package/dist/debug/runtime/RaphNode.js +0 -143
  210. package/dist/debug/runtime/RaphPhasePipeline.cjs +0 -1
  211. package/dist/debug/runtime/RaphPhasePipeline.js +0 -526
  212. package/dist/debug/runtime/RaphScope.cjs +0 -1
  213. package/dist/debug/runtime/RaphScope.js +0 -64
  214. package/dist/debug/runtime/RuntimeReactivity.cjs +0 -1
  215. package/dist/debug/runtime/RuntimeReactivity.js +0 -154
  216. package/dist/debug/runtime/RuntimeWatch.cjs +0 -1
  217. package/dist/debug/runtime/RuntimeWatch.js +0 -71
  218. package/dist/debug/runtime/public.cjs +0 -1
  219. package/dist/debug/runtime/public.js +0 -18
  220. package/dist/path/PathEventHub.d.ts +0 -48
  221. package/dist/path/public.d.ts +0 -14
  222. package/dist/runtime/RaphDebug.d.ts +0 -32
  223. package/dist/runtime/RaphNode.d.ts +0 -68
  224. package/dist/runtime/RaphPhasePipeline.d.ts +0 -133
  225. package/dist/runtime/RaphScope.d.ts +0 -50
  226. package/dist/runtime/RuntimeReactivity.d.ts +0 -40
  227. package/dist/runtime/phase.types.d.ts +0 -49
  228. package/dist/runtime/public.d.ts +0 -13
  229. package/dist/runtime/runtime-reactivity.types.d.ts +0 -9
  230. /package/dist/debug/path/{meta.types.cjs → data-path.types.cjs} +0 -0
  231. /package/dist/debug/path/{meta.types.js → data-path.types.js} +0 -0
  232. /package/dist/debug/{runtime/runtime-reactivity.types.cjs → path/derived/derived-collection.types.cjs} +0 -0
  233. /package/dist/debug/{runtime/runtime-reactivity.types.js → path/derived/derived-collection.types.js} +0 -0
  234. /package/dist/debug/path/{derived-strategies.cjs → derived/derived-strategy.utils.cjs} +0 -0
  235. /package/dist/debug/path/{derived-strategies.js → derived/derived-strategy.utils.js} +0 -0
  236. /package/dist/debug/path/{segment-key.cjs → pathSegmentKey.cjs} +0 -0
  237. /package/dist/debug/path/{segment-key.js → pathSegmentKey.js} +0 -0
  238. /package/dist/debug/runtime/{parent-graph.cjs → ownership/parentGraph.cjs} +0 -0
  239. /package/dist/debug/runtime/{parent-graph.js → ownership/parentGraph.js} +0 -0
  240. /package/dist/debug/runtime/{disposal.cjs → ownership/throwDisposalErrors.cjs} +0 -0
  241. /package/dist/debug/runtime/{disposal.js → ownership/throwDisposalErrors.js} +0 -0
  242. /package/dist/debug/runtime/{phase.types.cjs → phases/phase.types.cjs} +0 -0
  243. /package/dist/debug/runtime/{phase.types.js → phases/phase.types.js} +0 -0
  244. /package/dist/path/{data-draft.d.ts → storage/createDataDraft.d.ts} +0 -0
  245. /package/dist/runtime/{disposal.d.ts → ownership/throwDisposalErrors.d.ts} +0 -0
  246. /package/dist/runtime/{RaphFrameLoop.d.ts → phases/RaphFrameLoop.d.ts} +0 -0
@@ -1,228 +1,97 @@
1
- import { DataPathDef, PathEvents, PathOptions } from '../path/path.types';
2
- import { DerivedOptions, RaphDerivedHandle } from '../path/RaphDerivedHandle';
3
- import { RaphKernelOptions, RaphKernelRoot, RaphKernel } from '../path/RaphKernel';
4
- import { RaphMeta } from '../path/RaphMeta';
1
+ import { DerivedOptions, RaphDerivedHandle } from '../path/derived/RaphDerivedHandle';
2
+ import { DataPathDef, PathOptions } from '../path/path.types';
3
+ import { RaphKernel, RaphKernelOptions, RaphKernelRoot } from '../path/RaphKernel';
5
4
  import { ScopeNode } from '../reactivity/scope';
6
5
  import { Disposer, ReadonlySignal, Signal, WatchOptions, WatchSource, WatchValue, WritableComputedOptions } from '../reactivity/types';
7
- import { PathHandle } from '../runtime/PathHandle';
8
- import { FrameLoopLease, RaphEffectOptions, RaphPhase } from '../runtime/phase.types';
9
- import { RaphRuntimeDebug } from '../runtime/RaphDebug';
10
- import { NodeOptions, RaphNode } from '../runtime/RaphNode';
11
- import { RaphRuntimeOptions, RaphRuntime } from '../runtime/RaphRuntime';
12
- import { RaphScope } from '../runtime/RaphScope';
13
- import { RaphConfigureOptions, RaphMode } from './types';
14
- import { collectionByKey, filterByKey, full } from '../path/derived-strategies';
15
- interface RaphComputed {
16
- <T>(getter: () => T): ReadonlySignal<T>;
17
- <T>(options: WritableComputedOptions<T>): Signal<T>;
18
- }
19
- interface RaphEffect {
20
- (callback: () => void | Disposer): Disposer;
21
- (phase: string, callback: () => void | Disposer, options?: RaphEffectOptions): Disposer;
22
- }
23
- interface RaphWatch {
24
- (masks: DataPathDef | readonly DataPathDef[], callback: (payload: PathEvents) => void | Disposer, options?: WatchOptions): Disposer;
25
- <S extends WatchSource | readonly WatchSource[]>(source: S, callback: (value: WatchValue<S>, previous: WatchValue<S> | undefined) => void | Disposer, options?: WatchOptions): Disposer;
26
- }
27
- interface RaphScopeFactory {
28
- (): ScopeNode;
29
- (id: string): RaphScope;
30
- }
6
+ import { RaphRuntimeDebug } from '../runtime/diagnostics/RaphDebug';
7
+ import { NodeOptions, RaphNode } from '../runtime/ownership/RaphNode';
8
+ import { RaphScope } from '../runtime/ownership/RaphScope';
9
+ import { FrameLoopLease, RaphAggregateSource, RaphEffectOptions, RaphPhase, RaphPhaseEffect, RaphWatchOptions, RaphWatchSource } from '../runtime/phases/phase.types';
10
+ import { RaphRuntimeMeta, RaphRuntimeOptions, RaphRuntime } from '../runtime/RaphRuntime';
11
+ import { PathHandle } from '../runtime/reactivity/PathHandle';
12
+ import { RaphAggregate } from '../runtime/reactivity/RaphWorkGraph';
13
+ import { ConfiguredRaph, RaphFlatConfigureOptions, RaphInstance, RaphInstanceDefinitions, RaphInstancesConfigureOptions, RaphReactivityInstanceOptions, StrictRaphConfigureOptions } from './types';
14
+ import { collectionByKey, filterByKey, full } from '../path/derived/derived-strategy.utils';
15
+ import { RaphReactivityInstance } from './RaphReactivityInstance';
16
+ type WithoutRuntimePathHandle<Source> = Source extends PathHandle<unknown> ? never : Source extends readonly unknown[] ? {
17
+ [Key in keyof Source]: Source[Key] extends PathHandle<unknown> ? never : Source[Key];
18
+ } : Source;
31
19
  /**
32
- * Плоский фасад над одним явно выбранным backend текущей сессии.
20
+ * Process-level convenience facade над одной явно configured heterogeneous session.
33
21
  */
34
22
  export declare class Raph {
35
- private static _state;
36
- private static _mode;
37
- private static _defaultRuntime;
38
- private static _reactivity;
39
- private static _runtimes;
40
- private static _runtimeOrder;
41
- private static _runtimeCounter;
42
- private static _runtimeDefaults;
43
- static signal: <T>(value: T) => Signal<T>;
44
- static computed: RaphComputed;
45
- static effect: RaphEffect;
46
- static watch: RaphWatch;
47
- static batch: <T>(operation: () => T) => T;
48
- static untracked: <T>(operation: () => T) => T;
49
- static scope: RaphScopeFactory;
50
- /**
51
- * Показывает, завершена ли явная конфигурация facade.
52
- */
23
+ private static _handle;
24
+ private constructor();
53
25
  static get configured(): boolean;
54
- /**
55
- * Возвращает выбранный режим либо `undefined` до конфигурации.
56
- */
57
- static get mode(): RaphMode | undefined;
58
- /**
59
- * Однократно выбирает backend и устанавливает публичные операции facade.
60
- */
61
- static configure(options: RaphConfigureOptions): void;
62
- /**
63
- * Освобождает принадлежащие facade runtimes и возвращает его в исходное состояние.
64
- */
65
- static reset(): void;
66
- /**
67
- * Возвращает default runtime текущей runtime-сессии.
68
- */
69
- static get runtime(): RaphRuntime;
70
- /**
71
- * Возвращает metadata facade default runtime.
72
- */
73
- static get meta(): RaphMeta;
74
- /**
75
- * Возвращает диагностический facade default runtime.
76
- */
26
+ static get defaultInstanceId(): string | undefined;
27
+ static get kernel(): RaphKernel;
28
+ static get meta(): RaphRuntimeMeta;
77
29
  static get debug(): RaphRuntimeDebug;
78
- /**
79
- * Возвращает корневой node default runtime.
80
- */
81
30
  static get root(): RaphNode;
82
- /**
83
- * Формирует снимок materialized derived default runtime.
84
- */
85
- static getDerivedSnapshot(): ReturnType<RaphKernel['getDerivedSnapshot']>;
86
- /**
87
- * Создаёт независимый path/kernel owner в runtime-режиме.
88
- */
89
- static createKernel(options?: RaphKernelOptions): RaphKernel;
90
- /**
91
- * Создаёт и регистрирует принадлежащий facade runtime.
92
- */
31
+ static get rootScope(): RaphScope;
32
+ static get frameTick(): ReadonlySignal<number>;
33
+ static get frame(): RaphRuntime['frame'];
34
+ static get phases(): readonly RaphPhase[];
35
+ static get loopEnabled(): boolean;
36
+ static configure<const Definitions extends RaphInstanceDefinitions>(options: StrictRaphConfigureOptions<RaphInstancesConfigureOptions<Definitions>>): ConfiguredRaph<RaphInstancesConfigureOptions<Definitions>>;
37
+ static configure<const Options extends RaphFlatConfigureOptions>(options: StrictRaphConfigureOptions<Options>): ConfiguredRaph<Options>;
38
+ static reset(): void;
39
+ static instance(id?: string): RaphInstance;
40
+ static getInstance(id: string): RaphInstance | undefined;
41
+ static hasInstance(id: string): boolean;
42
+ static disposeInstance(id: string): boolean;
43
+ static runtime(id?: string): RaphRuntime;
44
+ static reactivity(id?: string): RaphReactivityInstance;
93
45
  static createRuntime(options?: RaphRuntimeOptions): RaphRuntime;
94
- /**
95
- * Возвращает зарегистрированный runtime без ошибки при его отсутствии.
96
- */
97
- static getRuntime(id: string): RaphRuntime | undefined;
98
- /**
99
- * Возвращает зарегистрированный runtime либо отклоняет неизвестный id.
100
- */
101
- static requireRuntime(id: string): RaphRuntime;
102
- /**
103
- * Проверяет наличие runtime в registry текущей сессии.
104
- */
105
- static hasRuntime(id: string): boolean;
106
- /**
107
- * Освобождает зарегистрированный runtime с указанным id.
108
- */
109
- static disposeRuntime(id: string): boolean;
110
- /**
111
- * Заменяет phases default runtime до первого выполнения pipeline.
112
- */
46
+ static createReactivity(options?: RaphReactivityInstanceOptions): RaphReactivityInstance;
47
+ static createKernel(options?: RaphKernelOptions): RaphKernel;
48
+ static signal<T>(value: T): Signal<T>;
49
+ static reactive<T extends object>(value: T): T;
50
+ static computed<T>(getter: () => T): ReadonlySignal<T>;
51
+ static computed<T>(options: WritableComputedOptions<T>): Signal<T>;
52
+ static effect(callback: () => void | Disposer): Disposer;
53
+ static effect(phase: string, callback: RaphPhaseEffect, options?: RaphEffectOptions): Disposer;
54
+ static watch<Source extends WatchSource | readonly WatchSource[]>(source: Source & WithoutRuntimePathHandle<Source>, callback: (value: WatchValue<Source>, previous: WatchValue<Source> | undefined) => void | Disposer, options?: WatchOptions): Disposer;
55
+ static watch(source: RaphWatchSource, phase: string, callback: RaphPhaseEffect, options?: RaphWatchOptions): Disposer;
56
+ static batch<T>(operation: () => T): T;
57
+ static untracked<T>(operation: () => T): T;
58
+ static scope(): ScopeNode;
59
+ static scope(id: string): RaphScope;
60
+ static action<Args extends unknown[], Result>(operation: (...args: Args) => Result): (...args: Args) => Result;
61
+ static action<Args extends unknown[], Result>(name: string, operation: (...args: Args) => Result): (...args: Args) => Result;
113
62
  static definePhases(phases: readonly RaphPhase[]): void;
114
- /**
115
- * Добавляет phase в default runtime до первого выполнения pipeline.
116
- */
117
63
  static addPhase(phase: RaphPhase): void;
118
- /**
119
- * Удаляет phases default runtime до первого выполнения pipeline.
120
- */
121
64
  static clearPhases(): void;
122
- /**
123
- * Синхронно выполняет накопленную работу default runtime.
124
- */
65
+ static requestExecution(): void;
125
66
  static flush(): void;
126
- /**
127
- * Удерживает frame loop активным от имени указанного owner.
128
- */
67
+ static afterFlush(): Promise<void>;
129
68
  static acquireLoop(owner: string): FrameLoopLease;
130
- /**
131
- * Явно запускает frame loop default runtime.
132
- */
133
69
  static startLoop(): void;
134
- /**
135
- * Снимает явный запуск frame loop default runtime.
136
- */
137
70
  static stopLoop(): void;
138
- /**
139
- * Создаёт принадлежащий default runtime node и выполняет его setup.
140
- */
141
- static node<TApi>(options: NodeOptions, setup: (node: RaphNode) => TApi): RaphNode<TApi>;
142
- /**
143
- * Регистрирует materialized path dependency в default runtime.
144
- */
71
+ static aggregate(sources: readonly RaphAggregateSource[]): RaphAggregate;
72
+ static node<TApi = void>(options: NodeOptions, setup?: (node: RaphNode) => TApi): RaphNode<TApi>;
73
+ static getNode(id: string): RaphNode | undefined;
145
74
  static derive<TSource, TTarget>(options: DerivedOptions<TSource, TTarget>): RaphDerivedHandle<TSource, TTarget>;
146
- /**
147
- * Создаёт lifecycle-aware handle указанного data path.
148
- */
75
+ static getDerivedSnapshot(): ReturnType<RaphKernel['getDerivedSnapshot']>;
149
76
  static path<T>(path: DataPathDef, options?: PathOptions): PathHandle<T>;
150
- /**
151
- * Читает весь path-root Kernel default runtime с реактивным tracking.
152
- */
153
77
  static get<T = RaphKernelRoot>(): T | undefined;
154
- /**
155
- * Читает значение path с реактивным tracking текущего owner.
156
- */
157
78
  static get<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
158
- /**
159
- * Читает весь path-root Kernel default runtime без tracking.
160
- */
161
79
  static peek<T = RaphKernelRoot>(): T | undefined;
162
- /**
163
- * Читает значение path без регистрации реактивной зависимости.
164
- */
165
80
  static peek<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
166
- /**
167
- * Проверяет наличие значения по указанному path.
168
- */
169
81
  static has(path: DataPathDef, options?: PathOptions): boolean;
170
- /**
171
- * Заменяет значение по указанному path.
172
- */
173
82
  static set<T>(path: DataPathDef, value: T, options?: PathOptions): void;
174
- /**
175
- * Объединяет значение с существующим объектом по указанному path.
176
- */
177
83
  static merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
178
- /**
179
- * Удаляет значение по указанному path.
180
- */
181
84
  static delete(path: DataPathDef, options?: PathOptions): void;
182
- /**
183
- * Выполняет несколько mutations как одну реактивную транзакцию.
184
- */
185
- static transaction<T>(operation: () => T): T;
186
- /**
187
- * Оборачивает операцию в именованную action текущего runtime.
188
- */
189
- static action<Args extends unknown[], Result>(name: string, operation: (...args: Args) => Result): (...args: Args) => Result;
190
- /**
191
- * Немедленно выполняет именованную action текущего runtime.
192
- */
193
- static runInAction<T>(name: string, operation: () => T): T;
194
- private static _configureReactivity;
195
- private static _configureRuntime;
196
- private static _bindRuntime;
197
- private static _registerRuntime;
198
- private static _requireDefault;
199
- private static _requireMode;
200
- private static _resolveRuntimeId;
201
- private static _validateRuntimeId;
202
- private static _validateConfigureOptions;
203
- private static _assertKnownOptions;
204
- private static _installMissingDefaultBindings;
205
- private static _clearBindings;
206
- private static _clearSession;
207
- /**
208
- * Запрещает создание экземпляров статического facade.
209
- */
210
- private constructor();
211
- /**
212
- * Предоставляет режимы scheduler без отдельного импорта константы.
213
- */
214
85
  static readonly Scheduler: Readonly<{
215
86
  readonly AnimationFrame: "animationFrame";
216
87
  readonly Microtask: "microtask";
217
88
  readonly Sync: "sync";
218
89
  }>;
219
- /**
220
- * Предоставляет стратегии materialized derived рядом с facade API.
221
- */
222
90
  static readonly DerivedStrategy: Readonly<{
223
91
  full: typeof full;
224
92
  collectionByKey: typeof collectionByKey;
225
93
  filterByKey: typeof filterByKey;
226
94
  }>;
95
+ private static _require;
227
96
  }
228
97
  export {};
@@ -0,0 +1,90 @@
1
+ import { RaphRuntimeOptions, RaphRuntime } from '../runtime/RaphRuntime';
2
+ import { RaphConfigureOptions, RaphInstance, RaphReactivityInstanceOptions } from './types';
3
+ import { RaphKernel } from '../path/RaphKernel';
4
+ import { RaphReactivityInstance } from './RaphReactivityInstance';
5
+ /**
6
+ * Владеет registry, default pointer и lifecycle одной facade generation.
7
+ */
8
+ export declare class RaphFacadeSession {
9
+ private static _runtimeCounter;
10
+ private static _reactivityCounter;
11
+ private readonly _instances;
12
+ private readonly _instanceOrder;
13
+ private _defaultInstance;
14
+ private _disposed;
15
+ private constructor();
16
+ /**
17
+ * Валидирует всю конфигурацию до construction и атомарно создаёт session.
18
+ */
19
+ static create(options: RaphConfigureOptions): RaphFacadeSession;
20
+ /**
21
+ * Показывает, завершен ли lifecycle session.
22
+ */
23
+ get disposed(): boolean;
24
+ /**
25
+ * Возвращает ID default instance без создания fallback.
26
+ */
27
+ get defaultInstanceId(): string | undefined;
28
+ /**
29
+ * Возвращает default либо явно адресованный instance.
30
+ */
31
+ instance(id?: string): RaphInstance;
32
+ /**
33
+ * Читает registry без ошибки для неизвестного ID.
34
+ */
35
+ getInstance(id: string): RaphInstance | undefined;
36
+ /**
37
+ * Проверяет наличие managed instance.
38
+ */
39
+ hasInstance(id: string): boolean;
40
+ /**
41
+ * Возвращает Runtime или сообщает о capability mismatch.
42
+ */
43
+ runtime(id?: string): RaphRuntime;
44
+ /**
45
+ * Возвращает pure-reactivity instance или сообщает о capability mismatch.
46
+ */
47
+ reactivity(id?: string): RaphReactivityInstance;
48
+ /**
49
+ * Создаёт managed Runtime без неявного изменения default pointer.
50
+ */
51
+ createRuntime(options?: RaphRuntimeOptions): RaphRuntime;
52
+ /**
53
+ * Создаёт managed pure-reactivity instance без изменения default pointer.
54
+ */
55
+ createReactivity(options?: RaphReactivityInstanceOptions): RaphReactivityInstance;
56
+ /** Создаёт unmanaged Kernel, сохраняя generation-bound lifecycle check. */
57
+ createKernel(options?: ConstructorParameters<typeof RaphKernel>[0]): RaphKernel;
58
+ /**
59
+ * Освобождает managed instance и сразу удаляет его из registry.
60
+ */
61
+ disposeInstance(id: string): boolean;
62
+ /**
63
+ * Освобождает managed instances в обратном порядке construction.
64
+ */
65
+ dispose(): void;
66
+ /**
67
+ * Создаёт instance из заранее проверенного definition.
68
+ */
69
+ private _construct;
70
+ /**
71
+ * Регистрирует единственный managed owner и его terminal cleanup.
72
+ */
73
+ private _register;
74
+ /**
75
+ * Удаляет точную identity после её terminal disposal.
76
+ */
77
+ private _forget;
78
+ /**
79
+ * Формирует свободный ID для dynamic factory.
80
+ */
81
+ private _generateId;
82
+ /**
83
+ * Отклоняет duplicate resolved ID до registration.
84
+ */
85
+ private _assertFreeId;
86
+ /**
87
+ * Запрещает stale typed/global handle после reset.
88
+ */
89
+ private _assertActive;
90
+ }
@@ -0,0 +1,72 @@
1
+ import { Disposer, ReadonlySignal, Signal, WatchCallback, WatchOptions, WatchSource, WritableComputedOptions } from '../reactivity/types';
2
+ import { RaphReactivityInstanceOptions } from './types';
3
+ import { RaphReactivity } from '../reactivity/engine';
4
+ import { ScopeNode } from '../reactivity/scope';
5
+ /**
6
+ * Управляемый pure-reactivity instance одной facade session.
7
+ */
8
+ export declare class RaphReactivityInstance {
9
+ readonly id: string;
10
+ readonly mode: "reactivity";
11
+ readonly engine: RaphReactivity;
12
+ readonly rootScope: ScopeNode;
13
+ private _disposed;
14
+ private readonly _disposedListeners;
15
+ /**
16
+ * Создаёт изолированный graph с общим lifecycle owner.
17
+ */
18
+ constructor(id: string, options?: Omit<RaphReactivityInstanceOptions, 'id'>);
19
+ /**
20
+ * Показывает, завершён ли lifecycle instance.
21
+ */
22
+ get disposed(): boolean;
23
+ /**
24
+ * Создаёт signal, принадлежащий root scope instance.
25
+ */
26
+ signal<T>(value: T): Signal<T>;
27
+ /**
28
+ * Создаёт deep reactive Proxy в изолированном graph instance.
29
+ */
30
+ reactive<T extends object>(value: T): T;
31
+ /**
32
+ * Создаёт root-owned computed только для чтения.
33
+ */
34
+ computed<T>(getter: () => T): ReadonlySignal<T>;
35
+ /**
36
+ * Создаёт root-owned writable computed.
37
+ */
38
+ computed<T>(options: WritableComputedOptions<T>): Signal<T>;
39
+ /**
40
+ * Создаёт синхронный effect в root scope instance.
41
+ */
42
+ effect(callback: () => void | Disposer): Disposer;
43
+ /**
44
+ * Создаёт value watch в root scope instance.
45
+ */
46
+ watch<S extends WatchSource | readonly WatchSource[]>(source: S, callback: WatchCallback<S>, options?: WatchOptions): Disposer;
47
+ /**
48
+ * Группирует propagation одного reactive graph.
49
+ */
50
+ batch<T>(operation: () => T): T;
51
+ /**
52
+ * Выполняет операцию без dependency tracking.
53
+ */
54
+ untracked<T>(operation: () => T): T;
55
+ /**
56
+ * Создаёт дочерний resource scope, освобождаемый вместе с instance.
57
+ */
58
+ scope(): ScopeNode;
59
+ /**
60
+ * Освобождает owned resources и делает retained reactive proxies терминальными.
61
+ */
62
+ dispose(): void;
63
+ /**
64
+ * Привязывает registry cleanup к lifecycle managed instance.
65
+ * @internal
66
+ */
67
+ _onDisposed(listener: () => void): Disposer;
68
+ /**
69
+ * Запрещает операции после завершения lifecycle.
70
+ */
71
+ private _assertAlive;
72
+ }
@@ -9,12 +9,17 @@ export declare class RaphError extends Error {
9
9
  export declare class RaphConfigurationError extends RaphError {
10
10
  }
11
11
  /**
12
- * Сообщает, что операция недоступна в выбранном режиме facade.
12
+ * Сообщает, что выбранный instance не поддерживает запрошенную capability.
13
13
  */
14
- export declare class RaphModeError extends RaphConfigurationError {
14
+ export declare class RaphCapabilityError extends RaphConfigurationError {
15
15
  }
16
16
  /**
17
- * Сообщает об отсутствии default runtime у runtime-сессии.
17
+ * Сообщает об отсутствии default instance у facade session.
18
18
  */
19
- export declare class RaphDefaultRuntimeError extends RaphConfigurationError {
19
+ export declare class RaphDefaultInstanceError extends RaphConfigurationError {
20
+ }
21
+ /**
22
+ * Сообщает, что generation-bound handle относится к уже освобождённой session.
23
+ */
24
+ export declare class RaphFacadeDisposedError extends RaphConfigurationError {
20
25
  }