@raphy-js/raph 1.0.1-dev.25 → 1.0.1-dev.54
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/README.md +100 -0
- package/dist/api/Raph.d.ts +15 -15
- package/dist/api/RaphFacadeSession.d.ts +4 -4
- package/dist/api/RaphReactivityInstance.d.ts +4 -4
- package/dist/api/types.d.ts +11 -11
- package/dist/compact.cjs +1 -0
- package/dist/compact.js +4 -0
- package/dist/debug/reactivity/engine-core.cjs +1 -0
- package/dist/debug/reactivity/engine-core.js +1760 -0
- package/dist/debug/reactivity/engine.cjs +1 -1
- package/dist/debug/reactivity/engine.js +25 -1689
- package/dist/debug/reactivity/reactive-object.cjs +1 -1
- package/dist/debug/reactivity/reactive-object.js +604 -167
- package/dist/debug/runtime/RaphCompactExecutionRuntime.cjs +1 -0
- package/dist/debug/runtime/RaphCompactExecutionRuntime.js +9 -0
- package/dist/debug/runtime/RaphExecutionRuntime.cjs +1 -0
- package/dist/debug/runtime/RaphExecutionRuntime.js +11 -0
- package/dist/debug/runtime/RaphRuntime.cjs +1 -1
- package/dist/debug/runtime/RaphRuntime.js +115 -1176
- package/dist/debug/runtime/RaphRuntimeBase.cjs +1 -0
- package/dist/debug/runtime/RaphRuntimeBase.js +941 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -1
- package/dist/debug/runtime/diagnostics/RaphDebug.js +72 -66
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphNode.js +11 -0
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -1
- package/dist/debug/runtime/ownership/RaphScope.js +12 -12
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -1
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +361 -242
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.cjs +1 -1
- package/dist/debug/runtime/phases/RaphPhaseTaskRecord.js +23 -22
- package/dist/debug/runtime/reactivity/RaphSelector.cjs +1 -1
- package/dist/debug/runtime/reactivity/RaphSelector.js +111 -90
- package/dist/debug/runtime/reactivity/RuntimeObjectSupport.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeObjectSupport.js +11 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -1
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +118 -103
- package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeSelectorSupport.js +12 -0
- package/dist/entrypoints/compact.d.ts +2 -0
- package/dist/entrypoints/execution.d.ts +2 -0
- package/dist/entrypoints/machine-testing.d.ts +2 -2
- package/dist/entrypoints/machine.d.ts +5 -5
- package/dist/entrypoints/observable.d.ts +4 -0
- package/dist/entrypoints/path.d.ts +14 -14
- package/dist/entrypoints/reactivity.d.ts +1 -1
- package/dist/entrypoints/runtime.d.ts +19 -18
- package/dist/execution.cjs +1 -0
- package/dist/execution.js +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +23 -21
- package/dist/machine/compiler.d.ts +1 -1
- package/dist/machine/core.d.ts +2 -2
- package/dist/machine/persistence.d.ts +1 -1
- package/dist/machine/runtime.d.ts +3 -3
- package/dist/machine/testing.d.ts +1 -1
- package/dist/machine/types.d.ts +3 -3
- package/dist/main.d.ts +19 -19
- package/dist/observable/buffer.d.ts +6 -0
- package/dist/observable/class-admin.d.ts +63 -0
- package/dist/observable/class-plan.d.ts +46 -0
- package/dist/observable/classes.d.ts +10 -0
- package/dist/observable/context.d.ts +73 -0
- package/dist/observable/native.d.ts +2 -0
- package/dist/observable/observable.d.ts +13 -0
- package/dist/observable/types.d.ts +60 -0
- package/dist/observable.cjs +1 -0
- package/dist/observable.js +1187 -0
- package/dist/path/DataPath.d.ts +2 -2
- package/dist/path/PathRouter.d.ts +1 -1
- package/dist/path/RaphKernel.d.ts +6 -6
- package/dist/path/data-path.types.d.ts +1 -1
- package/dist/path/data-path.utils.d.ts +2 -2
- package/dist/path/derived/DerivedRegistry.d.ts +3 -3
- package/dist/path/derived/RaphDerivedHandle.d.ts +3 -3
- package/dist/path/derived/derived-collection.types.d.ts +1 -1
- package/dist/path/derived/derived-collection.utils.d.ts +3 -3
- package/dist/path/derived/derived-strategy.utils.d.ts +1 -1
- package/dist/path/meta/MetaController.d.ts +5 -5
- package/dist/path/meta/RaphMeta.d.ts +3 -3
- package/dist/path/meta/RaphMetaStore.d.ts +1 -1
- package/dist/path/meta/meta.types.d.ts +2 -2
- package/dist/path/path.types.d.ts +2 -2
- package/dist/path/pathSegmentKey.d.ts +1 -1
- package/dist/path/storage/AdapterPathStore.d.ts +2 -2
- package/dist/path/storage/DefaultDataAdapter.d.ts +2 -2
- package/dist/path/storage/PathEventHub.d.ts +1 -1
- package/dist/path/storage/PathStore.d.ts +2 -2
- package/dist/path/storage/data-adapter.types.d.ts +1 -1
- package/dist/raph.cjs +1 -1
- package/dist/raph.js +23 -21
- package/dist/reactivity/engine-core.d.ts +600 -0
- package/dist/reactivity/engine.d.ts +6 -550
- package/dist/reactivity/reactive-object.d.ts +143 -2
- package/dist/reactivity/scope.d.ts +7 -6
- package/dist/reactivity/types.d.ts +9 -12
- package/dist/reactivity/watch.d.ts +1 -1
- package/dist/runtime/RaphCompactExecutionRuntime.d.ts +7 -0
- package/dist/runtime/RaphExecutionRuntime.d.ts +6 -0
- package/dist/runtime/RaphRuntime.d.ts +19 -403
- package/dist/runtime/RaphRuntimeBase.d.ts +194 -0
- package/dist/runtime/diagnostics/RaphDebug.d.ts +8 -5
- package/dist/runtime/errors.d.ts +1 -1
- package/dist/runtime/ownership/RaphEffectScope.d.ts +13 -12
- package/dist/runtime/ownership/RaphNode.d.ts +28 -21
- package/dist/runtime/ownership/RaphScope.d.ts +32 -19
- package/dist/runtime/ownership/parent-graph.types.d.ts +1 -1
- package/dist/runtime/ownership/parentGraph.d.ts +2 -2
- package/dist/runtime/phases/RaphFrameLoop.d.ts +1 -1
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +80 -29
- package/dist/runtime/phases/RaphPhaseTaskRecord.d.ts +21 -21
- package/dist/runtime/phases/RaphPhaseWatch.d.ts +3 -3
- package/dist/runtime/phases/orderPhaseTasks.d.ts +4 -2
- package/dist/runtime/phases/phase.types.d.ts +36 -35
- package/dist/runtime/reactivity/PathHandle.d.ts +5 -5
- package/dist/runtime/reactivity/RaphMetaSource.d.ts +7 -7
- package/dist/runtime/reactivity/RaphSelector.d.ts +27 -6
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +40 -39
- package/dist/runtime/reactivity/RuntimeObjectSupport.d.ts +9 -0
- package/dist/runtime/reactivity/RuntimeReactivity.d.ts +27 -19
- package/dist/runtime/reactivity/RuntimeSelectorSupport.d.ts +10 -0
- package/dist/runtime/reactivity/RuntimeWatch.d.ts +1 -1
- package/dist/runtime/reactivity/disposal-sweep.utils.d.ts +1 -1
- package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +3 -3
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +13 -11
- package/package.json +22 -62
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
import { DerivedOptions, RaphDerivedHandle } from '../path/derived/RaphDerivedHandle';
|
|
2
|
-
import { RaphMeta } from '../path/meta/RaphMeta';
|
|
3
|
-
import { DataPathDef, PathOptions } from '../path/path.types';
|
|
4
|
-
import { RaphKernelRoot, RaphKernel } from '../path/RaphKernel';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { RaphMetaSourceOptions, RaphMetaSource } from './reactivity/RaphMetaSource';
|
|
12
|
-
import { RaphAggregate, RaphWorkGraph } from './reactivity/RaphWorkGraph';
|
|
13
|
-
import { RuntimeDisposalSweeper } from './reactivity/runtime-reactivity.types';
|
|
14
|
-
import { RaphScope } from './ownership/RaphScope';
|
|
15
|
-
import { PathHandle } from './reactivity/PathHandle';
|
|
16
|
-
import { RuntimeReactivity } from './reactivity/RuntimeReactivity';
|
|
1
|
+
import { DerivedOptions, RaphDerivedHandle } from '../path/derived/RaphDerivedHandle.js';
|
|
2
|
+
import { RaphMeta } from '../path/meta/RaphMeta.js';
|
|
3
|
+
import { DataPathDef, PathOptions } from '../path/path.types.js';
|
|
4
|
+
import { RaphKernelRoot, RaphKernel } from '../path/RaphKernel.js';
|
|
5
|
+
import { RaphDebugOptions, RaphRuntimeDebug, RaphDebugController } from './diagnostics/RaphDebug.js';
|
|
6
|
+
import { RaphSchedulerMode } from './phases/phase.types.js';
|
|
7
|
+
import { RaphMetaSourceOptions, RaphMetaSource } from './reactivity/RaphMetaSource.js';
|
|
8
|
+
import { RaphRuntimeBase } from './RaphRuntimeBase.js';
|
|
9
|
+
import { PathHandle } from './reactivity/PathHandle.js';
|
|
10
|
+
export type { RaphPausableRegistration } from './RaphRuntimeBase.js';
|
|
17
11
|
export interface RaphRuntimeOptions {
|
|
18
12
|
readonly adaptiveDependencyIndex?: boolean;
|
|
19
13
|
readonly debug?: RaphDebugOptions;
|
|
@@ -31,146 +25,19 @@ export interface RaphRuntimeConfiguration {
|
|
|
31
25
|
readonly scheduler: RaphSchedulerMode;
|
|
32
26
|
}
|
|
33
27
|
export type RaphRuntimeMeta = Pick<RaphMeta, 'delete' | 'get' | 'has' | 'merge' | 'set'>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
* только с регистрацией в качестве receiver.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export interface RaphPausableRegistration {
|
|
42
|
-
readonly active: boolean;
|
|
43
|
-
readonly dispose: (this: RaphPausableRegistration) => void;
|
|
44
|
-
readonly pause: (this: RaphPausableRegistration) => void;
|
|
45
|
-
readonly resume: (this: RaphPausableRegistration) => void;
|
|
46
|
-
}
|
|
47
|
-
/** Isolated Runtime execution plane with phase-bound work only. */
|
|
48
|
-
export declare class RaphRuntime {
|
|
49
|
-
private static _runtimeCounter;
|
|
50
|
-
readonly mode: "runtime";
|
|
28
|
+
export declare class RaphRuntime extends RaphRuntimeBase<RaphRuntime> {
|
|
29
|
+
readonly reactiveObjects: true;
|
|
30
|
+
readonly selectors: true;
|
|
51
31
|
readonly configuration: RaphRuntimeConfiguration;
|
|
52
|
-
readonly
|
|
53
|
-
|
|
54
|
-
readonly frameTick: ReadonlySignal<number>;
|
|
55
|
-
private readonly _reactivity;
|
|
56
|
-
private readonly _signalLifecycle;
|
|
57
|
-
private readonly _workGraph;
|
|
58
|
-
private readonly _frameTickSignal;
|
|
32
|
+
protected readonly _debugController: RaphDebugController;
|
|
33
|
+
constructor(options?: RaphRuntimeOptions);
|
|
59
34
|
private _pathHandles;
|
|
60
35
|
private _meta;
|
|
61
|
-
private _phases;
|
|
62
|
-
private _frameLoop;
|
|
63
36
|
private _debug;
|
|
64
|
-
private readonly _debugController;
|
|
65
|
-
private _parentGraph;
|
|
66
|
-
private readonly _topOwners;
|
|
67
|
-
private _ownerRegistrations;
|
|
68
|
-
private _ownersReleased;
|
|
69
|
-
private _batchDepth;
|
|
70
|
-
private _mutationDepth;
|
|
71
|
-
private _kernelBatchDepth;
|
|
72
|
-
private _ownerDisposalDepth;
|
|
73
|
-
private readonly _disposingNodes;
|
|
74
|
-
private _ownerDisposals;
|
|
75
|
-
private _disposalSweepers;
|
|
76
|
-
private _nextDisposalSweep;
|
|
77
|
-
private _actionDepth;
|
|
78
|
-
private _actionCounter;
|
|
79
|
-
private readonly _traceCauseStack;
|
|
80
|
-
private _phaseTraceOperations;
|
|
81
|
-
private _executionRequested;
|
|
82
|
-
private _disposed;
|
|
83
|
-
private readonly _disposedListeners;
|
|
84
|
-
constructor(options?: RaphRuntimeOptions);
|
|
85
|
-
/** @internal */
|
|
86
|
-
_getReactivity(): RuntimeReactivity;
|
|
87
|
-
/**
|
|
88
|
-
* Возвращает внутренний WorkGraph для optional execution layers.
|
|
89
|
-
*
|
|
90
|
-
* @internal
|
|
91
|
-
*/
|
|
92
|
-
_getWorkGraph(): RaphWorkGraph;
|
|
93
|
-
get id(): string;
|
|
94
37
|
get kernel(): RaphKernel;
|
|
95
|
-
get disposed(): boolean;
|
|
96
|
-
get graph(): DepGraph;
|
|
97
|
-
get loopEnabled(): boolean;
|
|
98
|
-
get frame(): import('./phases/phase.types').RaphFrameContext;
|
|
99
|
-
get phases(): readonly RaphPhase[];
|
|
100
|
-
/** Runtime metadata facade intentionally excludes unphased watch(). */
|
|
101
38
|
get meta(): RaphRuntimeMeta;
|
|
102
39
|
getDerivedSnapshot(): ReturnType<RaphKernel['getDerivedSnapshot']>;
|
|
103
40
|
get debug(): RaphRuntimeDebug;
|
|
104
|
-
signal<T>(value: T, owner?: RaphScope): Signal<T>;
|
|
105
|
-
/**
|
|
106
|
-
* Creates a deep reactive Proxy owned by this Runtime root scope.
|
|
107
|
-
* Property dependencies use the intrusive graph directly and intentionally
|
|
108
|
-
* do not create per-property WorkGraph producers or phase causes.
|
|
109
|
-
*/
|
|
110
|
-
reactive<T extends object>(value: T): T;
|
|
111
|
-
computed<T>(getter: () => T, owner?: RaphScope): ReadonlySignal<T>;
|
|
112
|
-
computed<T>(options: WritableComputedOptions<T>, owner?: RaphScope): Signal<T>;
|
|
113
|
-
/** Low-level adapter form. Prefer consumer.effect(). */
|
|
114
|
-
effect(consumer: RaphScope, phaseInput: string, callback: RaphPhaseEffect, options?: RaphEffectOptions): Disposer;
|
|
115
|
-
/**
|
|
116
|
-
* Регистрирует один implicit phase effect. Возвращаемая регистрация является
|
|
117
|
-
* записью binding: она одновременно ресурс владельца, задача engine и элемент
|
|
118
|
-
* очереди pipeline, поэтому на effect больше ничего не выделяется. Тело
|
|
119
|
-
* записи engine у всех bindings графа одно — `RuntimeReactivity._phaseBody`:
|
|
120
|
-
* свой binding оно находит через engine, а не через собственную closure.
|
|
121
|
-
*
|
|
122
|
-
* При `taskless` тело вызывается без task: запись получает `TASK_TASKLESS`,
|
|
123
|
-
* общее тело не читает `record.task`, и frozen facade этого binding не
|
|
124
|
-
* создаётся, пока его не запросит `process` своей phase. Режим — бит поля
|
|
125
|
-
* `state`: запись от него не растёт.
|
|
126
|
-
*
|
|
127
|
-
* @internal
|
|
128
|
-
*/
|
|
129
|
-
_effectRegistration(consumer: RaphScope, phaseInput: string, callback: RaphPhaseEffect, options?: RaphEffectOptions, startPaused?: boolean, taskless?: boolean, onExecutionFailure?: (error: unknown) => never, isExecutionCancelled?: () => boolean): RaphPausableRegistration;
|
|
130
|
-
/**
|
|
131
|
-
* Регистрирует группу из `count` implicit phase effects на одной записи
|
|
132
|
-
* binding. Каждый slot получает собственную запись графа engine, то есть
|
|
133
|
-
* собственный набор зависимостей и собственный признак invalidation, а
|
|
134
|
-
* запись binding и её место в очереди phase и в списке ресурсов владельца у
|
|
135
|
-
* группы одни. Тело записи engine у slots то же, что у всех bindings графа.
|
|
136
|
-
* Возвращаемая регистрация — эта запись; она же handle группы.
|
|
137
|
-
*
|
|
138
|
-
* Регистрация ничего не исполняет: каждый slot запускает `_startGroupSlot`.
|
|
139
|
-
* Запись входит в список владельца сразу, поэтому владелец освобождает
|
|
140
|
-
* группу после ресурсов, которые зарегистрируют тела её slots.
|
|
141
|
-
*
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
_effectGroupRegistration(consumer: RaphScope, phaseInput: string, count: number, runSlot: RaphEffectGroupSlot, context: unknown, options?: RaphEffectGroupOptions, startPaused?: boolean): RaphPhaseTaskRecord;
|
|
145
|
-
/**
|
|
146
|
-
* Запускает один slot группы: планирует его запись графа, ставит запись
|
|
147
|
-
* группы в очередь и, при `initial: 'sync'`, выполняет flush. Шаги те же, что
|
|
148
|
-
* у регистрации одиночного implicit effect после создания его записи.
|
|
149
|
-
*
|
|
150
|
-
* Сбой внутри вызова останавливает только этот slot и бросается вызывающему,
|
|
151
|
-
* как сбой первой доставки откатывает регистрацию одиночного binding; группа
|
|
152
|
-
* и остальные её slots остаются. Группа, у которой остановлен последний slot,
|
|
153
|
-
* освобождается.
|
|
154
|
-
*
|
|
155
|
-
* Запуск на освобождённом владельце бросает `RaphDisposedError`, как
|
|
156
|
-
* `bindEffect()`: и когда владелец освобождён до вызова, и когда его
|
|
157
|
-
* освободила первая доставка внутри вызова, при любом scheduler. Молчит
|
|
158
|
-
* только запуск slot группы, освобождённой при живом владельце.
|
|
159
|
-
*
|
|
160
|
-
* @internal
|
|
161
|
-
*/
|
|
162
|
-
_startGroupSlot(record: RaphPhaseTaskRecord, slot: number, initial: RaphEffectInitialMode, onExecutionFailure?: (error: unknown) => never): void;
|
|
163
|
-
/** Low-level adapter form. Prefer consumer.watch(). */
|
|
164
|
-
watch(consumer: RaphScope, source: RaphWatchSource, phaseInput: string, callback: RaphPhaseEffect, options?: RaphWatchOptions): Disposer;
|
|
165
|
-
/**
|
|
166
|
-
* Регистрирует один explicit phase watch. Возвращаемая запись binding является
|
|
167
|
-
* pausable-регистрацией и одновременно ресурсом владельца этого watch.
|
|
168
|
-
*
|
|
169
|
-
* @internal
|
|
170
|
-
*/
|
|
171
|
-
_watchRegistration(consumer: RaphScope, source: RaphWatchSource, phaseInput: string, callback: RaphPhaseEffect, options?: RaphWatchOptions, startPaused?: boolean, onExecutionFailure?: (error: unknown) => never, isExecutionCancelled?: () => boolean): RaphPhaseTaskRecord;
|
|
172
|
-
aggregate(consumer: RaphScope, sources: readonly RaphAggregateSource[]): RaphAggregate;
|
|
173
|
-
/** Creates a lazy root-owned metadata event source for phase watches. */
|
|
174
41
|
metaSource(masks: DataPathDef | readonly DataPathDef[], options?: RaphMetaSourceOptions): RaphMetaSource;
|
|
175
42
|
path<T>(path: DataPathDef, options?: PathOptions): PathHandle<T>;
|
|
176
43
|
get<T = RaphKernelRoot>(): T | undefined;
|
|
@@ -181,264 +48,13 @@ export declare class RaphRuntime {
|
|
|
181
48
|
set<T>(path: DataPathDef, value: T, options?: PathOptions): void;
|
|
182
49
|
merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
183
50
|
delete(path: DataPathDef, options?: PathOptions): void;
|
|
184
|
-
batch<T>(operation: () => T): T;
|
|
185
|
-
/** Batches an internal reactive-only commit without opening an unused Kernel boundary. @internal */
|
|
186
|
-
_batchReactive<T>(operation: () => T): T;
|
|
187
|
-
private _batch;
|
|
188
|
-
/**
|
|
189
|
-
* Закрывает один уровень batch: внешний уровень очищает transient causes и
|
|
190
|
-
* запускает фазы. Бросает ошибку операции, ошибки закрытия либо все вместе;
|
|
191
|
-
* после успешной операции и закрытия возвращает управление.
|
|
192
|
-
*/
|
|
193
|
-
private _closeBatch;
|
|
194
|
-
/**
|
|
195
|
-
* Исполняет тело action: `batch(() => _runUntracked(() => operation(...args)))`
|
|
196
|
-
* без closures и без промежуточных вызовов слоёв. Runtime, который один
|
|
197
|
-
* владеет своим Kernel без derived handles, metadata watchers и adapter,
|
|
198
|
-
* открывает границы reactive batch, Kernel и path batch явными вызовами и
|
|
199
|
-
* закрывает их в том же порядке и с теми же ошибками, что вложенные
|
|
200
|
-
* `batch()` этих слоёв. В любом другом состоянии исполняется сам `batch()`.
|
|
201
|
-
*/
|
|
202
|
-
private _applyBatch;
|
|
203
|
-
action<Args extends unknown[], Result>(operation: (...args: Args) => Result, owner?: RaphScope): (...args: Args) => Result;
|
|
204
|
-
action<Args extends unknown[], Result>(name: string, operation: (...args: Args) => Result, owner?: RaphScope): (...args: Args) => Result;
|
|
205
|
-
untracked<T>(operation: () => T): T;
|
|
206
|
-
scope(id: string): RaphScope;
|
|
207
|
-
node<TApi = void>(options: NodeOptions, setup?: (node: RaphNode) => TApi): RaphNode<TApi>;
|
|
208
|
-
/**
|
|
209
|
-
* Создаёт provisional node, выполняет setup и публикует результат; при ошибке
|
|
210
|
-
* setup откатывает node до выхода из границы mutation.
|
|
211
|
-
*/
|
|
212
|
-
private _createCommittedNode;
|
|
213
|
-
getNode(id: string): RaphNode | undefined;
|
|
214
|
-
definePhases(phases: readonly RaphPhase[]): void;
|
|
215
|
-
addPhase(phase: RaphPhase): void;
|
|
216
|
-
clearPhases(): void;
|
|
217
|
-
requestExecution(): void;
|
|
218
|
-
flush(): void;
|
|
219
|
-
afterFlush(): Promise<void>;
|
|
220
|
-
acquireLoop(owner: string): FrameLoopLease;
|
|
221
|
-
startLoop(): void;
|
|
222
|
-
stopLoop(): void;
|
|
223
51
|
derive<TSource, TTarget>(options: DerivedOptions<TSource, TTarget>): RaphDerivedHandle<TSource, TTarget>;
|
|
224
|
-
dispose(): void;
|
|
225
|
-
/** @internal */
|
|
226
|
-
_onDisposed(listener: () => void): Disposer;
|
|
227
|
-
/** @internal */
|
|
228
|
-
_notifyNodeStructure(node: RaphNode, structure: RaphStructureCause, oldAncestors: readonly RaphNode[], newAncestors: readonly RaphNode[]): void;
|
|
229
|
-
/**
|
|
230
|
-
* Сообщает, может ли structural publication этой node дойти до подписчика;
|
|
231
|
-
* `false` позволяет не строить structure cause и списки ancestors.
|
|
232
|
-
*
|
|
233
|
-
* @internal
|
|
234
|
-
*/
|
|
235
|
-
_hasNodeStructureDemand(node: RaphNode): boolean;
|
|
236
|
-
/**
|
|
237
|
-
* Сообщает, есть ли у Runtime хотя бы один подписчик на node: runtime-,
|
|
238
|
-
* subtree- или self-watcher. Пока он есть, node поддерживает выданный массив
|
|
239
|
-
* детей на месте, потому что structure cause берёт из него индексы.
|
|
240
|
-
*
|
|
241
|
-
* @internal
|
|
242
|
-
*/
|
|
243
|
-
_hasNodeSubscribers(): boolean;
|
|
244
|
-
/** @internal */
|
|
245
|
-
_notifyNodeTouch(node: RaphNode, metadata?: unknown): void;
|
|
246
|
-
/** @internal */
|
|
247
|
-
_assertNodeReparentAllowed(node: RaphNode, newParent: RaphNode): void;
|
|
248
|
-
/** @internal */
|
|
249
|
-
_releaseNode(node: RaphNode): void;
|
|
250
|
-
/** @internal */
|
|
251
|
-
_runNodeMutation<T>(operation: () => T): T;
|
|
252
|
-
/**
|
|
253
|
-
* Выполняет границу пустой node mutation без аллокаций: эквивалент
|
|
254
|
-
* `_runWrite(noop)` с тем же запросом исполнения и flush на внешней границе.
|
|
255
|
-
*
|
|
256
|
-
* @internal
|
|
257
|
-
*/
|
|
258
|
-
_touchMutationBoundary(): void;
|
|
259
|
-
/** @internal */
|
|
260
|
-
_runPhaseTransition<T>(operation: () => T): T;
|
|
261
|
-
/**
|
|
262
|
-
* Открывает границу освобождения. `node` передаёт только dispose самой node:
|
|
263
|
-
* Runtime помнит её до парного `_endOwnerDisposal`.
|
|
264
|
-
*
|
|
265
|
-
* @internal
|
|
266
|
-
*/
|
|
267
|
-
_beginOwnerDisposal(node?: RaphNode): void;
|
|
268
|
-
/** @internal */
|
|
269
|
-
_endOwnerDisposal(): void;
|
|
270
|
-
/**
|
|
271
|
-
* Возвращает число владельцев, освобождённых этим Runtime за всё время.
|
|
272
|
-
*
|
|
273
|
-
* @internal
|
|
274
|
-
*/
|
|
275
|
-
_ownerDisposalCount(): number;
|
|
276
|
-
/**
|
|
277
|
-
* Подключает участника уборки: Runtime вызовет его на первой внешней границе
|
|
278
|
-
* освобождения, к которой число освобождённых владельцев достигнет `due`.
|
|
279
|
-
* Подключённый участник остаётся в очереди, пока сам не откажется от
|
|
280
|
-
* следующего срока либо не будет отключён.
|
|
281
|
-
*
|
|
282
|
-
* @internal
|
|
283
|
-
*/
|
|
284
|
-
_addDisposalSweeper(sweeper: RuntimeDisposalSweeper, due: number): void;
|
|
285
|
-
/**
|
|
286
|
-
* Отключает участника уборки; отключение неизвестного участника безопасно.
|
|
287
|
-
*
|
|
288
|
-
* @internal
|
|
289
|
-
*/
|
|
290
|
-
_removeDisposalSweeper(sweeper: RuntimeDisposalSweeper): void;
|
|
291
|
-
/**
|
|
292
|
-
* Вызывает участников уборки, чей срок подошёл, и назначает ближайший
|
|
293
|
-
* следующий срок. Участник, чей срок не подошёл, вызова не получает:
|
|
294
|
-
* освобождение владельца стоит участникам работы, только когда подходит их
|
|
295
|
-
* собственный срок.
|
|
296
|
-
*/
|
|
297
|
-
private _sweepAfterDisposals;
|
|
298
|
-
/** @internal */
|
|
299
|
-
_ownerDisposalActive(): boolean;
|
|
300
|
-
/**
|
|
301
|
-
* Учитывает нового владельца и возвращает его порядковый номер регистрации.
|
|
302
|
-
* Plain scope сразу входит в набор владельцев вне списков детей; node входит
|
|
303
|
-
* в него сама через `_addTopOwner`, и только если у неё нет parent.
|
|
304
|
-
*
|
|
305
|
-
* @internal
|
|
306
|
-
*/
|
|
307
|
-
_registerOwner(owner: RaphScope): number;
|
|
308
|
-
/**
|
|
309
|
-
* Снимает владельца с учёта. Plain scope выходит и из набора владельцев вне
|
|
310
|
-
* списков детей; node без parent выходит из него сама через
|
|
311
|
-
* `_removeTopOwner`, а node с parent в нём не состоит.
|
|
312
|
-
*
|
|
313
|
-
* @internal
|
|
314
|
-
*/
|
|
315
|
-
_unregisterOwner(owner: RaphScope): void;
|
|
316
|
-
/**
|
|
317
|
-
* Вносит node без parent в набор владельцев вне списков детей.
|
|
318
|
-
*
|
|
319
|
-
* @internal
|
|
320
|
-
*/
|
|
321
|
-
_addTopOwner(node: RaphNode): void;
|
|
322
|
-
/**
|
|
323
|
-
* Убирает node из набора владельцев вне списков детей: она освобождена либо
|
|
324
|
-
* получила parent. Повторный вызов и вызов после освобождения Runtime
|
|
325
|
-
* безопасны.
|
|
326
|
-
*
|
|
327
|
-
* @internal
|
|
328
|
-
*/
|
|
329
|
-
_removeTopOwner(node: RaphNode): void;
|
|
330
|
-
/** @internal */
|
|
331
|
-
_assertOwnerRuntime(owner: RaphScope): void;
|
|
332
|
-
/** @internal */
|
|
333
|
-
_beginKernelBatch(): void;
|
|
334
|
-
/** @internal */
|
|
335
|
-
_endKernelBatch(): void;
|
|
336
|
-
/** Регистрирует read-only diagnostics projection optional Machine. @internal */
|
|
337
|
-
_registerMachineDebug(registration: RaphMachineDebugRegistration): Disposer;
|
|
338
|
-
/**
|
|
339
|
-
* Проверяет optional diagnostic identity без создания public facade.
|
|
340
|
-
*
|
|
341
|
-
* @internal
|
|
342
|
-
*/
|
|
343
|
-
_hasMachineDebug(id: string): boolean;
|
|
344
|
-
/**
|
|
345
|
-
* Проверяет optional trace path без выделения operation ID.
|
|
346
|
-
*
|
|
347
|
-
* @internal
|
|
348
|
-
*/
|
|
349
|
-
_traces(kind: RaphTraceKind): boolean;
|
|
350
|
-
/** Возвращает наследуемый cause для optional execution layers. @internal */
|
|
351
|
-
_currentTraceCauseId(): number | undefined;
|
|
352
|
-
/** Выдаёт operation id только на активном trace path. @internal */
|
|
353
|
-
_nextTraceOperation(kind: RaphTraceKind): number | undefined;
|
|
354
|
-
/**
|
|
355
|
-
* Проверяет, должен ли untracked work изолировать reactive или Runtime owner context.
|
|
356
|
-
*
|
|
357
|
-
* @internal
|
|
358
|
-
*/
|
|
359
|
-
_hasActiveReactiveContext(): boolean;
|
|
360
|
-
/** Записывает optional trace event без machine dependency. @internal */
|
|
361
|
-
_recordTrace(event: RaphTraceEventInput): void;
|
|
362
|
-
/** Наследует cause через outputs/tasks optional execution layers. @internal */
|
|
363
|
-
_runWithTraceCause<T>(causeId: number | undefined, operation: () => T): T;
|
|
364
|
-
/**
|
|
365
|
-
* Выполняет единственную проверку binding: pipeline доверяет её результату.
|
|
366
|
-
*/
|
|
367
|
-
private _validatePhaseBinding;
|
|
368
|
-
/**
|
|
369
|
-
* Освобождает binding, регистрация которого не удалась, и повторно бросает
|
|
370
|
-
* причину сбоя; ошибка самого освобождения присоединяется к ней.
|
|
371
|
-
*/
|
|
372
|
-
private _rollbackRegistration;
|
|
373
52
|
private _createDebugSnapshot;
|
|
374
53
|
private _createDebugTree;
|
|
375
54
|
private _createDebugStats;
|
|
376
|
-
/**
|
|
377
|
-
* Возвращает число владельцев, которых Runtime числит живыми: зарегистрированных
|
|
378
|
-
* и ещё не снятых с учёта. После освобождения Runtime их нет.
|
|
379
|
-
*/
|
|
380
|
-
private _liveOwnerCount;
|
|
381
|
-
/**
|
|
382
|
-
* Собирает всех владельцев, которых Runtime числит живыми. Владельцы вне
|
|
383
|
-
* списков детей идут в порядке регистрации, каждый — вместе с потомками по
|
|
384
|
-
* спискам детей. Node, чей dispose ещё исполняется, из списка parent уже
|
|
385
|
-
* вышла либо потеряла parent, который сбросил свой список: её и оставшихся
|
|
386
|
-
* у неё детей добавляют места границ освобождения.
|
|
387
|
-
*/
|
|
388
|
-
private _collectOwners;
|
|
389
55
|
private _releasePathHandle;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
* Записывает frame signal в собственной границе записи, минуя политику
|
|
395
|
-
* actions: кадр продвигает сам Runtime.
|
|
396
|
-
*/
|
|
397
|
-
private _setFrameTick;
|
|
398
|
-
private _attachWritableComputed;
|
|
399
|
-
private _own;
|
|
400
|
-
private _runTracked;
|
|
401
|
-
private _runUntracked;
|
|
402
|
-
private _runWrite;
|
|
403
|
-
/**
|
|
404
|
-
* Открывает границу записи без closure; повторяет начало `_runWrite`.
|
|
405
|
-
*
|
|
406
|
-
* @internal
|
|
407
|
-
*/
|
|
408
|
-
_enterWrite(): void;
|
|
409
|
-
/**
|
|
410
|
-
* Закрывает успешную запись, открытую `_enterWrite`; внешняя граница очищает
|
|
411
|
-
* transient causes и запускает фазы с теми же ошибками, что и `_runWrite`.
|
|
412
|
-
*
|
|
413
|
-
* @internal
|
|
414
|
-
*/
|
|
415
|
-
_exitWrite(): void;
|
|
416
|
-
/**
|
|
417
|
-
* Закрывает запись после ошибки операции и возвращает ошибку для throw:
|
|
418
|
-
* исходную либо AggregateError, если упало и закрытие внешней границы.
|
|
419
|
-
*
|
|
420
|
-
* @internal
|
|
421
|
-
*/
|
|
422
|
-
_failWrite(operationError: unknown): unknown;
|
|
423
|
-
/**
|
|
424
|
-
* Сообщает, что внешняя write-, batch-, Kernel- или disposal-граница ещё открыта.
|
|
425
|
-
* В этом состоянии оба шага `_finishExecutionBoundary` заведомо ничего не делают:
|
|
426
|
-
* transient causes очищаются и фазы запускаются только при нулевых глубинах.
|
|
427
|
-
*/
|
|
428
|
-
private _executionBoundaryOpen;
|
|
429
|
-
/** Закрывает внешнюю границу; массив ошибок создаётся только при первой ошибке. */
|
|
430
|
-
private _finishExecutionBoundary;
|
|
431
|
-
private _clearTransientCausesIfSettled;
|
|
432
|
-
private _requestExecution;
|
|
433
|
-
private _assertTrackedRead;
|
|
434
|
-
/**
|
|
435
|
-
* Проверяет tracked read из optional owned source.
|
|
436
|
-
*
|
|
437
|
-
* @internal
|
|
438
|
-
*/
|
|
439
|
-
_assertSourceReadable(owner: RaphScope): void;
|
|
440
|
-
private _assertImplicitDependency;
|
|
441
|
-
private _assertWriteAllowed;
|
|
442
|
-
private _throwCrossRuntime;
|
|
443
|
-
private _assertAlive;
|
|
56
|
+
protected _applyBatch<Args extends unknown[], Result>(operation: (...args: Args) => Result, args: ArrayLike<Args[number]>, receiver?: unknown): Result;
|
|
57
|
+
protected _runDataBatch<T>(operation: () => T): T;
|
|
58
|
+
protected _disposeDataSources(errors: unknown[]): void;
|
|
59
|
+
protected _detachDataPlane(errors: unknown[]): void;
|
|
444
60
|
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Disposer, ReadonlySignal, Signal, WritableComputedOptions } from '../reactivity/types.js';
|
|
2
|
+
import { RaphDebugController, RaphMachineDebugRegistration, RaphTraceEventInput, RaphTraceKind } from './diagnostics/RaphDebug.js';
|
|
3
|
+
import { DepGraph } from './ownership/parent-graph.types.js';
|
|
4
|
+
import { NodeOptions, RaphNode } from './ownership/RaphNode.js';
|
|
5
|
+
import { FrameLoopLease, RaphAggregateSource, RaphEffectGroupOptions, RaphEffectGroupSlot, RaphEffectInitialMode, RaphEffectOptions, RaphPhase, RaphPhaseEffect, RaphSchedulerMode, RaphStructureCause, RaphWatchOptions, RaphWatchSource } from './phases/phase.types.js';
|
|
6
|
+
import { RaphPhaseState, RaphPhasePipeline } from './phases/RaphPhasePipeline.js';
|
|
7
|
+
import { RaphAggregate, RaphWorkGraph } from './reactivity/RaphWorkGraph.js';
|
|
8
|
+
import { RuntimeDisposalSweeper, RuntimeSignalLifecycle } from './reactivity/runtime-reactivity.types.js';
|
|
9
|
+
import { RuntimeObjectSupport } from './reactivity/RuntimeObjectSupport.js';
|
|
10
|
+
import { RuntimeSignal, RuntimeReactivity } from './reactivity/RuntimeReactivity.js';
|
|
11
|
+
import { RuntimeSelectorSupport } from './reactivity/RuntimeSelectorSupport.js';
|
|
12
|
+
import { RaphScope } from './ownership/RaphScope.js';
|
|
13
|
+
import { RaphFrameLoop } from './phases/RaphFrameLoop.js';
|
|
14
|
+
import { RaphPhaseTaskRecord } from './phases/RaphPhaseTaskRecord.js';
|
|
15
|
+
export interface RaphPausableRegistration {
|
|
16
|
+
readonly active: boolean;
|
|
17
|
+
readonly dispose: (this: RaphPausableRegistration) => void;
|
|
18
|
+
readonly pause: (this: RaphPausableRegistration) => void;
|
|
19
|
+
readonly resume: (this: RaphPausableRegistration) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface RaphExecutionRuntimeOptions {
|
|
22
|
+
readonly adaptiveDependencyIndex?: boolean;
|
|
23
|
+
readonly id?: string;
|
|
24
|
+
readonly enforceActions?: boolean;
|
|
25
|
+
readonly scheduler?: RaphSchedulerMode;
|
|
26
|
+
}
|
|
27
|
+
export interface RaphExecutionRuntimeConfiguration {
|
|
28
|
+
readonly adaptiveDependencyIndex: boolean;
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly enforceActions: boolean;
|
|
31
|
+
readonly scheduler: RaphSchedulerMode;
|
|
32
|
+
}
|
|
33
|
+
export declare function resolveRuntimeConfiguration(options: RaphExecutionRuntimeOptions): RaphExecutionRuntimeConfiguration;
|
|
34
|
+
export declare class RaphRuntimeBase<Runtime extends RaphRuntimeBase<Runtime>> {
|
|
35
|
+
readonly reactiveObjects: boolean;
|
|
36
|
+
readonly selectors: boolean;
|
|
37
|
+
protected readonly _reactiveObjects: RuntimeObjectSupport | undefined;
|
|
38
|
+
readonly mode: "runtime";
|
|
39
|
+
readonly configuration: RaphExecutionRuntimeConfiguration;
|
|
40
|
+
readonly rootScope: RaphScope<Runtime>;
|
|
41
|
+
readonly root: RaphNode<unknown, Runtime>;
|
|
42
|
+
readonly frameTick: ReadonlySignal<number>;
|
|
43
|
+
protected readonly _reactivity: RuntimeReactivity;
|
|
44
|
+
protected readonly _signalLifecycle: RuntimeSignalLifecycle;
|
|
45
|
+
protected readonly _workGraph: RaphWorkGraph;
|
|
46
|
+
protected readonly _frameTickSignal: RuntimeSignal<number>;
|
|
47
|
+
protected _phases: RaphPhasePipeline | undefined;
|
|
48
|
+
protected _frameLoop: RaphFrameLoop | undefined;
|
|
49
|
+
protected readonly _debugController: RaphDebugController | undefined;
|
|
50
|
+
protected _parentGraph: DepGraph | undefined;
|
|
51
|
+
protected readonly _topOwners: Set<RaphScope<any>>;
|
|
52
|
+
protected _ownerRegistrations: number;
|
|
53
|
+
protected _ownersReleased: boolean;
|
|
54
|
+
protected _batchDepth: number;
|
|
55
|
+
protected _mutationDepth: number;
|
|
56
|
+
protected _kernelBatchDepth: number;
|
|
57
|
+
protected _ownerDisposalDepth: number;
|
|
58
|
+
protected readonly _disposingNodes: Array<RaphNode<unknown, any> | undefined>;
|
|
59
|
+
protected _ownerDisposals: number;
|
|
60
|
+
protected _disposalSweepers: RuntimeDisposalSweeper[] | undefined;
|
|
61
|
+
protected _nextDisposalSweep: number;
|
|
62
|
+
protected _actionDepth: number;
|
|
63
|
+
protected _actionCounter: number;
|
|
64
|
+
protected readonly _traceCauseStack: number[];
|
|
65
|
+
protected _phaseTraceOperations: Map<string, number> | undefined;
|
|
66
|
+
protected _executionRequested: boolean;
|
|
67
|
+
protected _disposed: boolean;
|
|
68
|
+
protected readonly _disposedListeners: Set<() => void>;
|
|
69
|
+
private _checkedObjectPolicy;
|
|
70
|
+
private _fastObjectPolicy;
|
|
71
|
+
constructor(configuration: RaphExecutionRuntimeConfiguration, diagnostics?: RaphDebugController, objects?: RuntimeObjectSupport, selectors?: RuntimeSelectorSupport);
|
|
72
|
+
_getReactivity(): RuntimeReactivity;
|
|
73
|
+
_getWorkGraph(): RaphWorkGraph;
|
|
74
|
+
get id(): string;
|
|
75
|
+
get disposed(): boolean;
|
|
76
|
+
get graph(): DepGraph;
|
|
77
|
+
get loopEnabled(): boolean;
|
|
78
|
+
get frame(): import('./phases/phase.types.js').RaphFrameContext;
|
|
79
|
+
get phases(): readonly RaphPhase<Runtime>[];
|
|
80
|
+
signal<T>(value: T, owner?: RaphScope<any>): Signal<T>;
|
|
81
|
+
reactive<T extends object>(value: this['reactiveObjects'] extends false ? never : T): T;
|
|
82
|
+
computed<T>(getter: () => T, owner?: RaphScope<any>): ReadonlySignal<T>;
|
|
83
|
+
computed<T>(options: WritableComputedOptions<T>, owner?: RaphScope<any>): Signal<T>;
|
|
84
|
+
effect(consumer: RaphScope<any>, phaseInput: string, callback: RaphPhaseEffect<Runtime>, options?: RaphEffectOptions): Disposer;
|
|
85
|
+
_effectRegistration(consumer: RaphScope<any>, phaseInput: string, callback: RaphPhaseEffect<Runtime>, options?: RaphEffectOptions, startPaused?: boolean, taskless?: boolean, onExecutionFailure?: (error: unknown) => never, isExecutionCancelled?: () => boolean): RaphPausableRegistration;
|
|
86
|
+
_effectGroupRegistration(consumer: RaphScope<any>, phaseInput: string, count: number, runSlot: RaphEffectGroupSlot, context: unknown, options?: RaphEffectGroupOptions, startPaused?: boolean): RaphPhaseTaskRecord;
|
|
87
|
+
_startGroupSlot(record: RaphPhaseTaskRecord, slot: number, initial: RaphEffectInitialMode, onExecutionFailure?: (error: unknown) => never): void;
|
|
88
|
+
watch(consumer: RaphScope<any>, source: RaphWatchSource<Runtime>, phaseInput: string, callback: RaphPhaseEffect<Runtime>, options?: RaphWatchOptions): Disposer;
|
|
89
|
+
_watchRegistration(consumer: RaphScope<any>, source: RaphWatchSource<Runtime>, phaseInput: string, callback: RaphPhaseEffect<Runtime>, options?: RaphWatchOptions, startPaused?: boolean, onExecutionFailure?: (error: unknown) => never, isExecutionCancelled?: () => boolean): RaphPhaseTaskRecord;
|
|
90
|
+
aggregate(consumer: RaphScope<Runtime>, sources: readonly RaphAggregateSource<Runtime>[]): RaphAggregate<Runtime>;
|
|
91
|
+
batch<T>(operation: () => T): T;
|
|
92
|
+
_batchReactive<T>(operation: () => T): T;
|
|
93
|
+
protected _batch<T>(operation: () => T, includeKernel: boolean): T;
|
|
94
|
+
protected _closeBatch(operationFailed: boolean, operationError: unknown): void;
|
|
95
|
+
protected _applyBatch<Args extends unknown[], Result>(operation: (...args: Args) => Result, args: ArrayLike<Args[number]>, receiver?: unknown): Result;
|
|
96
|
+
action<Args extends unknown[], Result>(operation: (...args: Args) => Result, owner?: RaphScope<any>): (...args: Args) => Result;
|
|
97
|
+
action<Args extends unknown[], Result>(name: string, operation: (...args: Args) => Result, owner?: RaphScope<any>): (...args: Args) => Result;
|
|
98
|
+
/**
|
|
99
|
+
* Общее исполнение public action и class methods, без второго массива аргументов.
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
_invokeAction<Args extends unknown[], Result>(name: string, owner: RaphScope<any>, operation: (...args: Args) => Result, args: ArrayLike<Args[number]>, receiver?: unknown): Result;
|
|
103
|
+
untracked<T>(operation: () => T): T;
|
|
104
|
+
/**
|
|
105
|
+
* Выполняет операцию вне owner context и сообщает, было ли в ней отслеживаемое
|
|
106
|
+
* чтение. Ни одной зависимости операция не оставляет. Renderer так проверяет,
|
|
107
|
+
* что значение зависит только от переданных данных и не требует effect.
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
_probeReads(operation: () => void): boolean;
|
|
111
|
+
scope(id: string): RaphScope<Runtime>;
|
|
112
|
+
node<TApi = void>(options: NodeOptions<Runtime>, setup?: (node: RaphNode<unknown, Runtime>) => TApi): RaphNode<TApi, Runtime>;
|
|
113
|
+
protected _createCommittedNode<TApi>(options: NodeOptions<Runtime>, setup: ((node: RaphNode<unknown, Runtime>) => TApi) | undefined): RaphNode<TApi, Runtime>;
|
|
114
|
+
getNode(id: string): RaphNode<unknown, Runtime> | undefined;
|
|
115
|
+
definePhases(phases: readonly RaphPhase<Runtime>[]): void;
|
|
116
|
+
addPhase(phase: RaphPhase<Runtime>): void;
|
|
117
|
+
clearPhases(): void;
|
|
118
|
+
requestExecution(): void;
|
|
119
|
+
flush(): void;
|
|
120
|
+
afterFlush(): Promise<void>;
|
|
121
|
+
acquireLoop(owner: string): FrameLoopLease;
|
|
122
|
+
startLoop(): void;
|
|
123
|
+
stopLoop(): void;
|
|
124
|
+
dispose(): void;
|
|
125
|
+
_onDisposed(listener: () => void): Disposer;
|
|
126
|
+
_notifyNodeStructure(node: RaphNode<unknown, any>, structure: RaphStructureCause<Runtime>, oldAncestors: readonly RaphNode<unknown, any>[], newAncestors: readonly RaphNode<unknown, any>[]): void;
|
|
127
|
+
_hasNodeStructureDemand(node: RaphNode<unknown, any>): boolean;
|
|
128
|
+
_hasNodeSubscribers(): boolean;
|
|
129
|
+
_notifyNodeTouch(node: RaphNode<unknown, any>, metadata?: unknown): void;
|
|
130
|
+
_assertNodeReparentAllowed(node: RaphNode<unknown, any>, newParent: RaphNode<unknown, any>): void;
|
|
131
|
+
_releaseNode(node: RaphNode<unknown, any>): void;
|
|
132
|
+
_runNodeMutation<T>(operation: () => T): T;
|
|
133
|
+
_touchMutationBoundary(): void;
|
|
134
|
+
_runPhaseTransition<T>(operation: () => T): T;
|
|
135
|
+
_beginOwnerDisposal(node?: RaphNode<unknown, any>): void;
|
|
136
|
+
_endOwnerDisposal(): void;
|
|
137
|
+
_ownerDisposalCount(): number;
|
|
138
|
+
_addDisposalSweeper(sweeper: RuntimeDisposalSweeper, due: number): void;
|
|
139
|
+
_removeDisposalSweeper(sweeper: RuntimeDisposalSweeper): void;
|
|
140
|
+
protected _sweepAfterDisposals(): void;
|
|
141
|
+
_ownerDisposalActive(): boolean;
|
|
142
|
+
_registerOwner(owner: RaphScope<any>): number;
|
|
143
|
+
_unregisterOwner(owner: RaphScope<any>): void;
|
|
144
|
+
_addTopOwner(node: RaphNode<unknown, any>): void;
|
|
145
|
+
_removeTopOwner(node: RaphNode<unknown, any>): void;
|
|
146
|
+
_assertOwnerRuntime(owner: RaphScope<any>): void;
|
|
147
|
+
_beginKernelBatch(): void;
|
|
148
|
+
_endKernelBatch(): void;
|
|
149
|
+
_registerMachineDebug(registration: RaphMachineDebugRegistration): Disposer;
|
|
150
|
+
_hasMachineDebug(id: string): boolean;
|
|
151
|
+
_traces(kind: RaphTraceKind): boolean;
|
|
152
|
+
_currentTraceCauseId(): number | undefined;
|
|
153
|
+
_nextTraceOperation(kind: RaphTraceKind): number | undefined;
|
|
154
|
+
_hasActiveReactiveContext(): boolean;
|
|
155
|
+
_recordTrace(event: RaphTraceEventInput): void;
|
|
156
|
+
_runWithTraceCause<T>(causeId: number | undefined, operation: () => T): T;
|
|
157
|
+
protected _validatePhaseBinding(execution: RaphPhasePipeline, phaseInput: string, callback: RaphPhaseEffect<Runtime>, options: RaphEffectOptions | RaphWatchOptions, allowNoInitial?: boolean): RaphPhaseState;
|
|
158
|
+
protected _rollbackRegistration(record: RaphPhaseTaskRecord, error: unknown, message: string, onExecutionFailure?: (error: unknown) => never): never;
|
|
159
|
+
protected _liveOwnerCount(): number;
|
|
160
|
+
protected _collectOwners(): RaphScope<any>[];
|
|
161
|
+
protected get _execution(): RaphPhasePipeline;
|
|
162
|
+
private _phaseTraceListener?;
|
|
163
|
+
protected _syncPhaseTrace(): void;
|
|
164
|
+
private _tracePhase;
|
|
165
|
+
protected get _clock(): RaphFrameLoop;
|
|
166
|
+
protected _tickFrameLoop(): void;
|
|
167
|
+
protected _setFrameTick(value: number): void;
|
|
168
|
+
protected _attachWritableComputed<T>(source: ReadonlySignal<T>, setter: (value: T) => void, owner: RaphScope<any>): Signal<T>;
|
|
169
|
+
protected _own(disposer: Disposer, owner: RaphScope<any>): Disposer;
|
|
170
|
+
protected _runTracked<T>(owner: RaphScope<any>, operation: () => T): T;
|
|
171
|
+
protected _runUntracked<T>(operation: () => T): T;
|
|
172
|
+
protected _runWrite<T>(operation: () => T, invalidate?: boolean): T;
|
|
173
|
+
/** @internal */
|
|
174
|
+
_isWriteBatchOpen(): boolean;
|
|
175
|
+
_enterWrite(): void;
|
|
176
|
+
_exitWrite(): void;
|
|
177
|
+
_failWrite(operationError: unknown): unknown;
|
|
178
|
+
protected _requestPendingExecution(): void;
|
|
179
|
+
protected _executionBoundaryOpen(): boolean;
|
|
180
|
+
protected _finishExecutionBoundary(): unknown[] | undefined;
|
|
181
|
+
protected _clearTransientCausesIfSettled(): void;
|
|
182
|
+
protected _requestExecution(): void;
|
|
183
|
+
/** @internal */
|
|
184
|
+
_applyObjectReadPolicy(checked: boolean): void;
|
|
185
|
+
protected _assertTrackedRead(): void;
|
|
186
|
+
_assertSourceReadable(owner: RaphScope<any>): void;
|
|
187
|
+
protected _assertImplicitDependency(sourceOwner: RaphScope<any>, consumerOwner: RaphScope<any>): void;
|
|
188
|
+
protected _assertWriteAllowed(): void;
|
|
189
|
+
protected _throwCrossRuntime(owner: RaphRuntimeBase<Runtime>): never;
|
|
190
|
+
protected _assertAlive(): void;
|
|
191
|
+
protected _runDataBatch<T>(operation: () => T): T;
|
|
192
|
+
protected _disposeDataSources(_errors: unknown[]): void;
|
|
193
|
+
protected _detachDataPlane(_errors: unknown[]): void;
|
|
194
|
+
}
|