@raphy-js/raph 1.0.0-dev.18
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/LICENSE +202 -0
- package/dist/api/Raph.d.ts +97 -0
- package/dist/api/RaphFacadeSession.d.ts +90 -0
- package/dist/api/RaphReactivityInstance.d.ts +72 -0
- package/dist/api/errors.d.ts +25 -0
- package/dist/api/types.d.ts +170 -0
- package/dist/core-CyilRD7s.js +1055 -0
- package/dist/core-ugchZNqC.cjs +1 -0
- package/dist/debug/api/Raph.cjs +1 -0
- package/dist/debug/api/Raph.js +421 -0
- package/dist/debug/api/RaphFacadeSession.cjs +1 -0
- package/dist/debug/api/RaphFacadeSession.js +306 -0
- package/dist/debug/api/RaphReactivityInstance.cjs +1 -0
- package/dist/debug/api/RaphReactivityInstance.js +149 -0
- package/dist/debug/api/errors.cjs +1 -0
- package/dist/debug/api/errors.js +17 -0
- package/dist/debug/api/types.cjs +1 -0
- package/dist/debug/api/types.js +1 -0
- package/dist/debug/path/DataPath.cjs +1 -0
- package/dist/debug/path/DataPath.js +394 -0
- package/dist/debug/path/PathRouter.cjs +1 -0
- package/dist/debug/path/PathRouter.js +86 -0
- package/dist/debug/path/RaphKernel.cjs +1 -0
- package/dist/debug/path/RaphKernel.js +687 -0
- package/dist/debug/path/data-path.types.cjs +1 -0
- package/dist/debug/path/data-path.types.js +1 -0
- package/dist/debug/path/data-path.utils.cjs +1 -0
- package/dist/debug/path/data-path.utils.js +56 -0
- package/dist/debug/path/derived/DerivedRegistry.cjs +1 -0
- package/dist/debug/path/derived/DerivedRegistry.js +157 -0
- package/dist/debug/path/derived/RaphDerivedHandle.cjs +1 -0
- package/dist/debug/path/derived/RaphDerivedHandle.js +125 -0
- package/dist/debug/path/derived/derived-collection.types.cjs +1 -0
- package/dist/debug/path/derived/derived-collection.types.js +1 -0
- package/dist/debug/path/derived/derived-collection.utils.cjs +1 -0
- package/dist/debug/path/derived/derived-collection.utils.js +179 -0
- package/dist/debug/path/derived/derived-strategy.types.cjs +1 -0
- package/dist/debug/path/derived/derived-strategy.types.js +1 -0
- package/dist/debug/path/derived/derived-strategy.utils.cjs +1 -0
- package/dist/debug/path/derived/derived-strategy.utils.js +20 -0
- package/dist/debug/path/meta/MetaController.cjs +1 -0
- package/dist/debug/path/meta/MetaController.js +214 -0
- package/dist/debug/path/meta/RaphMeta.cjs +1 -0
- package/dist/debug/path/meta/RaphMeta.js +68 -0
- package/dist/debug/path/meta/RaphMetaStore.cjs +1 -0
- package/dist/debug/path/meta/RaphMetaStore.js +184 -0
- package/dist/debug/path/meta/meta.types.cjs +1 -0
- package/dist/debug/path/meta/meta.types.js +1 -0
- package/dist/debug/path/path.types.cjs +1 -0
- package/dist/debug/path/path.types.js +1 -0
- package/dist/debug/path/pathSegmentKey.cjs +1 -0
- package/dist/debug/path/pathSegmentKey.js +12 -0
- package/dist/debug/path/storage/AdapterPathStore.cjs +1 -0
- package/dist/debug/path/storage/AdapterPathStore.js +133 -0
- package/dist/debug/path/storage/DefaultDataAdapter.cjs +1 -0
- package/dist/debug/path/storage/DefaultDataAdapter.js +356 -0
- package/dist/debug/path/storage/PathEventHub.cjs +1 -0
- package/dist/debug/path/storage/PathEventHub.js +148 -0
- package/dist/debug/path/storage/PathStore.cjs +1 -0
- package/dist/debug/path/storage/PathStore.js +326 -0
- package/dist/debug/path/storage/createDataDraft.cjs +1 -0
- package/dist/debug/path/storage/createDataDraft.js +71 -0
- package/dist/debug/path/storage/data-adapter.types.cjs +1 -0
- package/dist/debug/path/storage/data-adapter.types.js +1 -0
- package/dist/debug/reactivity/engine.cjs +1 -0
- package/dist/debug/reactivity/engine.js +1305 -0
- package/dist/debug/reactivity/reactive-object.cjs +1 -0
- package/dist/debug/reactivity/reactive-object.js +280 -0
- package/dist/debug/reactivity/scope.cjs +1 -0
- package/dist/debug/reactivity/scope.js +274 -0
- package/dist/debug/reactivity/types.cjs +1 -0
- package/dist/debug/reactivity/types.js +1 -0
- package/dist/debug/reactivity/watch.cjs +1 -0
- package/dist/debug/reactivity/watch.js +64 -0
- package/dist/debug/runtime/RaphRuntime.cjs +1 -0
- package/dist/debug/runtime/RaphRuntime.js +979 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.cjs +1 -0
- package/dist/debug/runtime/diagnostics/RaphDebug.js +297 -0
- package/dist/debug/runtime/errors.cjs +1 -0
- package/dist/debug/runtime/errors.js +15 -0
- package/dist/debug/runtime/ownership/RaphEffectScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphEffectScope.js +171 -0
- package/dist/debug/runtime/ownership/RaphNode.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphNode.js +206 -0
- package/dist/debug/runtime/ownership/RaphScope.cjs +1 -0
- package/dist/debug/runtime/ownership/RaphScope.js +101 -0
- package/dist/debug/runtime/ownership/parent-graph.types.cjs +1 -0
- package/dist/debug/runtime/ownership/parent-graph.types.js +1 -0
- package/dist/debug/runtime/ownership/parentGraph.cjs +1 -0
- package/dist/debug/runtime/ownership/parentGraph.js +10 -0
- package/dist/debug/runtime/ownership/throwDisposalErrors.cjs +1 -0
- package/dist/debug/runtime/ownership/throwDisposalErrors.js +9 -0
- package/dist/debug/runtime/phases/RaphFrameLoop.cjs +1 -0
- package/dist/debug/runtime/phases/RaphFrameLoop.js +106 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.cjs +1 -0
- package/dist/debug/runtime/phases/RaphPhasePipeline.js +587 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.cjs +1 -0
- package/dist/debug/runtime/phases/orderPhaseTasks.js +59 -0
- package/dist/debug/runtime/phases/phase.types.cjs +1 -0
- package/dist/debug/runtime/phases/phase.types.js +8 -0
- package/dist/debug/runtime/reactivity/PathHandle.cjs +1 -0
- package/dist/debug/runtime/reactivity/PathHandle.js +175 -0
- package/dist/debug/runtime/reactivity/RaphMetaSource.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphMetaSource.js +112 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.cjs +1 -0
- package/dist/debug/runtime/reactivity/RaphWorkGraph.js +995 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeReactivity.js +156 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.cjs +1 -0
- package/dist/debug/runtime/reactivity/RuntimeWatch.js +88 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.cjs +1 -0
- package/dist/debug/runtime/reactivity/runtime-reactivity.types.js +1 -0
- package/dist/entrypoints/machine-testing.d.ts +2 -0
- package/dist/entrypoints/machine.d.ts +5 -0
- package/dist/entrypoints/path.d.ts +14 -0
- package/dist/entrypoints/reactivity.d.ts +1 -0
- package/dist/entrypoints/runtime.d.ts +17 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +48 -0
- package/dist/machine/compiler.d.ts +71 -0
- package/dist/machine/core.d.ts +50 -0
- package/dist/machine/persistence.d.ts +5 -0
- package/dist/machine/runtime.d.ts +4 -0
- package/dist/machine/testing.d.ts +43 -0
- package/dist/machine/types.d.ts +155 -0
- package/dist/machine-testing.cjs +1 -0
- package/dist/machine-testing.js +188 -0
- package/dist/machine.cjs +1 -0
- package/dist/machine.js +837 -0
- package/dist/main.d.ts +20 -0
- package/dist/path/DataPath.d.ts +73 -0
- package/dist/path/PathRouter.d.ts +21 -0
- package/dist/path/RaphKernel.d.ts +169 -0
- package/dist/path/data-path.types.d.ts +34 -0
- package/dist/path/data-path.utils.d.ts +9 -0
- package/dist/path/derived/DerivedRegistry.d.ts +67 -0
- package/dist/path/derived/RaphDerivedHandle.d.ts +97 -0
- package/dist/path/derived/derived-collection.types.d.ts +12 -0
- package/dist/path/derived/derived-collection.utils.d.ts +20 -0
- package/dist/path/derived/derived-strategy.types.d.ts +12 -0
- package/dist/path/derived/derived-strategy.utils.d.ts +4 -0
- package/dist/path/meta/MetaController.d.ts +85 -0
- package/dist/path/meta/RaphMeta.d.ts +45 -0
- package/dist/path/meta/RaphMetaStore.d.ts +45 -0
- package/dist/path/meta/meta.types.d.ts +31 -0
- package/dist/path/path.types.d.ts +27 -0
- package/dist/path/pathSegmentKey.d.ts +2 -0
- package/dist/path/storage/AdapterPathStore.d.ts +45 -0
- package/dist/path/storage/DefaultDataAdapter.d.ts +63 -0
- package/dist/path/storage/PathEventHub.d.ts +48 -0
- package/dist/path/storage/PathStore.d.ts +51 -0
- package/dist/path/storage/createDataDraft.d.ts +4 -0
- package/dist/path/storage/data-adapter.types.d.ts +17 -0
- package/dist/path.cjs +1 -0
- package/dist/path.js +18 -0
- package/dist/raph.cjs +1 -0
- package/dist/raph.js +48 -0
- package/dist/reactivity/engine.d.ts +393 -0
- package/dist/reactivity/reactive-object.d.ts +36 -0
- package/dist/reactivity/scope.d.ts +146 -0
- package/dist/reactivity/types.d.ts +175 -0
- package/dist/reactivity/watch.d.ts +15 -0
- package/dist/reactivity.cjs +1 -0
- package/dist/reactivity.js +14 -0
- package/dist/runtime/RaphRuntime.d.ts +225 -0
- package/dist/runtime/diagnostics/RaphDebug.d.ts +239 -0
- package/dist/runtime/errors.d.ts +21 -0
- package/dist/runtime/ownership/RaphEffectScope.d.ts +29 -0
- package/dist/runtime/ownership/RaphNode.d.ts +40 -0
- package/dist/runtime/ownership/RaphScope.d.ts +38 -0
- package/dist/runtime/ownership/parent-graph.types.d.ts +4 -0
- package/dist/runtime/ownership/parentGraph.d.ts +3 -0
- package/dist/runtime/ownership/throwDisposalErrors.d.ts +1 -0
- package/dist/runtime/phases/RaphFrameLoop.d.ts +51 -0
- package/dist/runtime/phases/RaphPhasePipeline.d.ts +79 -0
- package/dist/runtime/phases/orderPhaseTasks.d.ts +6 -0
- package/dist/runtime/phases/phase.types.d.ts +92 -0
- package/dist/runtime/reactivity/PathHandle.d.ts +80 -0
- package/dist/runtime/reactivity/RaphMetaSource.d.ts +32 -0
- package/dist/runtime/reactivity/RaphWorkGraph.d.ts +171 -0
- package/dist/runtime/reactivity/RuntimeReactivity.d.ts +45 -0
- package/dist/runtime/reactivity/RuntimeWatch.d.ts +34 -0
- package/dist/runtime/reactivity/runtime-reactivity.types.d.ts +11 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.js +23 -0
- package/package.json +141 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { RaphCapabilityError, RaphConfigurationError, RaphDefaultInstanceError, RaphError, RaphFacadeDisposedError, } from './api/errors';
|
|
2
|
+
export { Raph } from './api/Raph';
|
|
3
|
+
export { RaphReactivityInstance } from './api/RaphReactivityInstance';
|
|
4
|
+
export type { ConfiguredRaph, RaphConfigureOptions, RaphFlatConfigureOptions, RaphInstance, RaphInstanceDefinition, RaphInstanceDefinitions, RaphInstanceMode, RaphInstancesConfigureOptions, RaphReactiveApi, RaphReactivityApi, RaphReactivityConfigureOptions, RaphReactivityInstanceDefinition, RaphReactivityInstanceOptions, RaphRuntimeApi, RaphRuntimeConfigureOptions, RaphRuntimeInstanceDefinition, StrictRaphConfigureOptions, } from './api/types';
|
|
5
|
+
export * from './entrypoints/runtime';
|
|
6
|
+
export type { DataPathParseOptions, PathScalar, PathSegment, PlainDataPath, } from './path/data-path.types';
|
|
7
|
+
export { DataPath } from './path/DataPath';
|
|
8
|
+
export type { DerivedCollectionByKeyStrategy, DerivedFilterByKeyStrategy, DerivedFullStrategy, DerivedStrategy, } from './path/derived/derived-strategy.types';
|
|
9
|
+
export { collectionByKey, filterByKey, full } from './path/derived/derived-strategy.utils';
|
|
10
|
+
export { RaphDerivedHandle, RaphDerivedTargetWriteError } from './path/derived/RaphDerivedHandle';
|
|
11
|
+
export type { DerivedOptions } from './path/derived/RaphDerivedHandle';
|
|
12
|
+
export type { RaphMetaApi, RaphMetaEvents, RaphMetaMutationCause, RaphMetaMutationEvent, RaphMetaMutationKind, RaphMetaReadOptions, RaphMetaWatchCallback, RaphMetaWatchOptions, RaphMetaWriteOptions, } from './path/meta/meta.types';
|
|
13
|
+
export { RaphMeta } from './path/meta/RaphMeta';
|
|
14
|
+
export type { DataPathDef, PathEvent, PathEvents, PathMutationKind, PathOptions, PathWatchCallback, } from './path/path.types';
|
|
15
|
+
export { RaphKernel } from './path/RaphKernel';
|
|
16
|
+
export type { RaphKernelOptions, RaphKernelRoot, RaphKernelRuntime, } from './path/RaphKernel';
|
|
17
|
+
export type { DataAdapter, DataObject, DefaultAdapterOptions, } from './path/storage/data-adapter.types';
|
|
18
|
+
export { DefaultDataAdapter } from './path/storage/DefaultDataAdapter';
|
|
19
|
+
export type { Disposer, ReadonlySignal, Signal, WatchOptions, WatchSource, WatchValue, WritableComputedOptions, } from './reactivity/types';
|
|
20
|
+
export type PhaseName = string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { DataPathParseOptions, ParsedDataPath, ParsedPathMask, PathSegment, PlainDataPath } from './data-path.types';
|
|
2
|
+
import { DataPathDef, PathOptions } from './path.types';
|
|
3
|
+
/**
|
|
4
|
+
* Неизменяемый публичный value object строгой E2 path grammar.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DataPath {
|
|
7
|
+
private static _cache;
|
|
8
|
+
private readonly _canonical;
|
|
9
|
+
private readonly _segments;
|
|
10
|
+
private _exact;
|
|
11
|
+
private _mask;
|
|
12
|
+
/**
|
|
13
|
+
* Сохраняет уже разобранный immutable path value.
|
|
14
|
+
*/
|
|
15
|
+
private constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Нормализует поддерживаемое определение пути в DataPath.
|
|
18
|
+
*/
|
|
19
|
+
static from(input: DataPathDef, options?: DataPathParseOptions): DataPath;
|
|
20
|
+
/**
|
|
21
|
+
* Разбирает строковый path согласно строгой грамматике.
|
|
22
|
+
*/
|
|
23
|
+
static fromString(path: string, options?: DataPathParseOptions): DataPath;
|
|
24
|
+
/**
|
|
25
|
+
* Восстанавливает DataPath из сериализованного представления.
|
|
26
|
+
*/
|
|
27
|
+
static fromPlain(plain: PlainDataPath): DataPath;
|
|
28
|
+
/**
|
|
29
|
+
* Разбирает строку exact path без создания публичного value object.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
static _parseExactString(path: string, options?: PathOptions): ParsedDataPath;
|
|
33
|
+
/**
|
|
34
|
+
* Разбирает строку path mask без создания публичного value object.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
static _parseMaskString(mask: string): ParsedPathMask;
|
|
38
|
+
/**
|
|
39
|
+
* Формирует canonical path из уже проверенных сегментов.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
static _renderSegments(segments: readonly PathSegment[]): string;
|
|
43
|
+
/**
|
|
44
|
+
* Сериализует path в независимое plain-представление.
|
|
45
|
+
*/
|
|
46
|
+
toPlain(): PlainDataPath;
|
|
47
|
+
/**
|
|
48
|
+
* Возвращает canonical строковое представление пути.
|
|
49
|
+
*/
|
|
50
|
+
toStringPath(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Возвращает canonical строковое представление пути.
|
|
53
|
+
*/
|
|
54
|
+
toString(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Возвращает immutable список сегментов пути.
|
|
57
|
+
*/
|
|
58
|
+
segments(): readonly PathSegment[];
|
|
59
|
+
/**
|
|
60
|
+
* Проверяет соответствие exact path указанной маске.
|
|
61
|
+
*/
|
|
62
|
+
static match(mask: DataPathDef, target: DataPathDef): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Возвращает exact path либо отклоняет wildcard-сегменты.
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
_asExact(): ParsedDataPath;
|
|
68
|
+
/**
|
|
69
|
+
* Возвращает path mask с проверкой позиции wildcard.
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
_asMask(): ParsedPathMask;
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ParsedPathMask, PathSegment } from './data-path.types';
|
|
2
|
+
/**
|
|
3
|
+
* Индексирует exact и wildcard path-masks без участия reactive graph.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathRouter<Payload> {
|
|
6
|
+
private readonly _root;
|
|
7
|
+
/**
|
|
8
|
+
* Регистрирует route mask и возвращает функцию удаления.
|
|
9
|
+
*/
|
|
10
|
+
add(mask: ParsedPathMask, payload: Payload): () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Возвращает routes, чьи masks соответствуют указанному событию.
|
|
13
|
+
*/
|
|
14
|
+
match(path: readonly Exclude<PathSegment, {
|
|
15
|
+
kind: 'wildcard';
|
|
16
|
+
}>[]): Set<Payload>;
|
|
17
|
+
/**
|
|
18
|
+
* При замене root возвращает все зарегистрированные path masks.
|
|
19
|
+
*/
|
|
20
|
+
matchAll(): Set<Payload>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { DerivedOptions, RaphDerivedHandle } from './derived/RaphDerivedHandle';
|
|
2
|
+
import { RaphMetaEvents, RaphMetaReadOptions, RaphMetaWatchOptions, RaphMetaWriteOptions } from './meta/meta.types';
|
|
3
|
+
import { RaphMeta } from './meta/RaphMeta';
|
|
4
|
+
import { DataPathDef, PathOptions, PathWatchCallback } from './path.types';
|
|
5
|
+
import { DataAdapter, DataObject, DefaultAdapterOptions } from './storage/data-adapter.types';
|
|
6
|
+
export type RaphKernelRoot = DataObject;
|
|
7
|
+
export interface RaphKernelOptions {
|
|
8
|
+
readonly id?: string;
|
|
9
|
+
readonly initial?: RaphKernelRoot;
|
|
10
|
+
readonly adapter?: DataAdapter;
|
|
11
|
+
readonly adapterOptions?: DefaultAdapterOptions;
|
|
12
|
+
}
|
|
13
|
+
export interface RaphKernelRuntime {
|
|
14
|
+
dispose: () => void;
|
|
15
|
+
_beginKernelBatch?: () => void;
|
|
16
|
+
_endKernelBatch?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Независимый владелец одного path data-plane без signal/runtime state.
|
|
20
|
+
*/
|
|
21
|
+
export declare class RaphKernel {
|
|
22
|
+
private static _kernelCounter;
|
|
23
|
+
readonly id: string;
|
|
24
|
+
private _paths;
|
|
25
|
+
private _derivedController;
|
|
26
|
+
private _runtimes;
|
|
27
|
+
private _metaController;
|
|
28
|
+
private _batchDepth;
|
|
29
|
+
private _runtimeMutationDepth;
|
|
30
|
+
private _stabilizing;
|
|
31
|
+
private _derivedWriteDepth;
|
|
32
|
+
/**
|
|
33
|
+
* Создаёт data/meta owner с независимым lifecycle и derived registry.
|
|
34
|
+
*/
|
|
35
|
+
constructor(options?: RaphKernelOptions);
|
|
36
|
+
/**
|
|
37
|
+
* Показывает, освобождён ли Kernel.
|
|
38
|
+
*/
|
|
39
|
+
get disposed(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Формирует диагностический снимок materialized derived registry.
|
|
42
|
+
*/
|
|
43
|
+
getDerivedSnapshot(): {
|
|
44
|
+
registrations: number;
|
|
45
|
+
errors: number;
|
|
46
|
+
pending: number;
|
|
47
|
+
stabilizing: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Возвращает лениво созданный metadata facade.
|
|
51
|
+
*/
|
|
52
|
+
get meta(): RaphMeta;
|
|
53
|
+
/**
|
|
54
|
+
* Возвращает весь path-root Kernel.
|
|
55
|
+
*/
|
|
56
|
+
get<T = RaphKernelRoot>(): T | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
59
|
+
*/
|
|
60
|
+
get<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Читает весь path-root Kernel.
|
|
63
|
+
*/
|
|
64
|
+
peek<T = RaphKernelRoot>(): T | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Читает значение по пути без регистрации реактивной зависимости.
|
|
67
|
+
*/
|
|
68
|
+
peek<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Проверяет наличие значения по указанному пути.
|
|
71
|
+
*/
|
|
72
|
+
has(path: DataPathDef, options?: PathOptions): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Записывает значение и публикует соответствующее изменение.
|
|
75
|
+
*/
|
|
76
|
+
set<T>(path: DataPathDef, value: T, options?: PathOptions): void;
|
|
77
|
+
/**
|
|
78
|
+
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
79
|
+
*/
|
|
80
|
+
merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
81
|
+
/**
|
|
82
|
+
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
83
|
+
*/
|
|
84
|
+
delete(path: DataPathDef, options?: PathOptions): void;
|
|
85
|
+
/**
|
|
86
|
+
* Выполняет операцию в общей синхронной batch boundary.
|
|
87
|
+
*/
|
|
88
|
+
batch<T>(operation: () => T): T;
|
|
89
|
+
/**
|
|
90
|
+
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
91
|
+
*/
|
|
92
|
+
watch(masks: DataPathDef | readonly DataPathDef[], callback: PathWatchCallback): () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Возвращает metadata указанного data-owner.
|
|
95
|
+
*/
|
|
96
|
+
getMeta(path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions): unknown;
|
|
97
|
+
/**
|
|
98
|
+
* Проверяет наличие metadata у указанного data-owner.
|
|
99
|
+
*/
|
|
100
|
+
hasMeta(path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Записывает metadata указанного data-owner.
|
|
103
|
+
*/
|
|
104
|
+
setMeta(path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
105
|
+
/**
|
|
106
|
+
* Объединяет metadata указанного data-owner.
|
|
107
|
+
*/
|
|
108
|
+
mergeMeta(path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
109
|
+
/**
|
|
110
|
+
* Удаляет metadata указанного data-owner.
|
|
111
|
+
*/
|
|
112
|
+
deleteMeta(path: DataPathDef, namespace?: string, options?: RaphMetaWriteOptions): void;
|
|
113
|
+
/**
|
|
114
|
+
* Подписывает runtime adapter на metadata-события Kernel.
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
_watchMeta(maskOrMasks: DataPathDef | readonly DataPathDef[], callback: (payload: RaphMetaEvents) => void, options?: RaphMetaWatchOptions, afterPublish?: (invalidate: boolean) => void): () => void;
|
|
118
|
+
/**
|
|
119
|
+
* Создаёт управляемое derived-представление source path в target path.
|
|
120
|
+
*/
|
|
121
|
+
derive<TSource, TTarget>(options: DerivedOptions<TSource, TTarget>): RaphDerivedHandle<TSource, TTarget>;
|
|
122
|
+
/**
|
|
123
|
+
* Регистрирует runtime, разделяющий этот Kernel.
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
_attachRuntime(runtime: RaphKernelRuntime): void;
|
|
127
|
+
/**
|
|
128
|
+
* Удаляет runtime из shared Kernel registry.
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
_detachRuntime(runtime: RaphKernelRuntime): void;
|
|
132
|
+
/**
|
|
133
|
+
* Освобождает shared runtimes, derived handles и data/meta state Kernel.
|
|
134
|
+
*/
|
|
135
|
+
dispose(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Пересчитывает указанный derived handle через его стратегию.
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
_recomputeDerived<TSource, TTarget>(handle: RaphDerivedHandle<TSource, TTarget>): void;
|
|
141
|
+
/**
|
|
142
|
+
* Удаляет derived handle из registry и освобождает его routes.
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
_removeDerived(handle: RaphDerivedHandle<any, any>): void;
|
|
146
|
+
private get _store();
|
|
147
|
+
private get _metadata();
|
|
148
|
+
/** Keeps every attached Runtime quiescent until one Kernel publication completes. */
|
|
149
|
+
private _withAttachedRuntimeBoundary;
|
|
150
|
+
private _assertWritablePath;
|
|
151
|
+
private _writeDerivedTarget;
|
|
152
|
+
private _mutateDerived;
|
|
153
|
+
private _runDerivedBatch;
|
|
154
|
+
private _mutateWithMetaLifecycle;
|
|
155
|
+
private _pruneMissingMetaOwners;
|
|
156
|
+
private _metaPath;
|
|
157
|
+
private _exactMetaPath;
|
|
158
|
+
private _assertMetaNamespace;
|
|
159
|
+
private _assertMetaOwner;
|
|
160
|
+
private _queueDerived;
|
|
161
|
+
private _queueDerivedReplacement;
|
|
162
|
+
private _replaceDerivedTarget;
|
|
163
|
+
private _stabilizeDerived;
|
|
164
|
+
private _recomputePendingDerived;
|
|
165
|
+
private _recomputeDerivedFull;
|
|
166
|
+
private _recomputeDerivedCollection;
|
|
167
|
+
private _recomputeDerivedFilter;
|
|
168
|
+
private _patchSingleFilterMembership;
|
|
169
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PathOptions } from './path.types';
|
|
2
|
+
export type PathScalar = string | number | boolean | null;
|
|
3
|
+
export type PathSegment = {
|
|
4
|
+
readonly kind: 'key';
|
|
5
|
+
readonly key: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'index';
|
|
8
|
+
readonly index: number;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'selector';
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly value: PathScalar;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'wildcard';
|
|
15
|
+
readonly indexed: boolean;
|
|
16
|
+
};
|
|
17
|
+
export interface ParsedDataPath {
|
|
18
|
+
readonly canonical: string;
|
|
19
|
+
readonly segments: readonly Exclude<PathSegment, {
|
|
20
|
+
kind: 'wildcard';
|
|
21
|
+
}>[];
|
|
22
|
+
}
|
|
23
|
+
export interface ParsedPathMask {
|
|
24
|
+
readonly canonical: string;
|
|
25
|
+
readonly deep: boolean;
|
|
26
|
+
readonly segments: readonly PathSegment[];
|
|
27
|
+
}
|
|
28
|
+
export interface DataPathParseOptions extends PathOptions {
|
|
29
|
+
readonly wildcardDynamic?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PlainDataPath {
|
|
32
|
+
readonly deepOnTail?: boolean;
|
|
33
|
+
readonly segs: readonly unknown[];
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParsedDataPath, ParsedPathMask } from './data-path.types';
|
|
2
|
+
import { DataPathDef, PathOptions } from './path.types';
|
|
3
|
+
export declare function parseDataPath(path: DataPathDef, options?: PathOptions): ParsedDataPath;
|
|
4
|
+
export declare function parsePathMask(mask: DataPathDef): ParsedPathMask;
|
|
5
|
+
/**
|
|
6
|
+
* Формирует masks для публикации всех отношений exact path.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function pathRelationMasks(path: ParsedDataPath): readonly string[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ParsedDataPath } from '../data-path.types';
|
|
2
|
+
import { CollectionDerivedState, DerivedCollectionKey } from './derived-collection.types';
|
|
3
|
+
import { RaphDerivedHandle } from './RaphDerivedHandle';
|
|
4
|
+
/**
|
|
5
|
+
* Владеет регистрациями, routes и pending-state materialized derived.
|
|
6
|
+
* Вычисление значений остаётся у Kernel, который координирует data-plane.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DerivedRegistry {
|
|
9
|
+
private _router;
|
|
10
|
+
private _handles;
|
|
11
|
+
private _matches;
|
|
12
|
+
private _pending;
|
|
13
|
+
private _collections;
|
|
14
|
+
private _counter;
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает число зарегистрированных записей.
|
|
17
|
+
*/
|
|
18
|
+
get size(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Возвращает очередь derived-вычислений, ожидающих стабилизации.
|
|
21
|
+
*/
|
|
22
|
+
get pending(): Set<RaphDerivedHandle<any, any>> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Выделяет следующий стабильный идентификатор registry.
|
|
25
|
+
*/
|
|
26
|
+
nextId(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Проверяет наличие derived handle с указанным id.
|
|
29
|
+
*/
|
|
30
|
+
has(id: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Возвращает зарегистрированные derived handles.
|
|
33
|
+
*/
|
|
34
|
+
values(): IterableIterator<RaphDerivedHandle<any, any>>;
|
|
35
|
+
/**
|
|
36
|
+
* Возвращает внутреннее состояние зарегистрированного handle.
|
|
37
|
+
*/
|
|
38
|
+
state(handle: RaphDerivedHandle<any, any>): CollectionDerivedState | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Регистрирует derived handle и его зависимости.
|
|
41
|
+
*/
|
|
42
|
+
register(handle: RaphDerivedHandle<any, any>, from: ParsedDataPath, strategy: {
|
|
43
|
+
readonly kind: 'collection-by-key' | 'filter-by-key';
|
|
44
|
+
readonly key: string;
|
|
45
|
+
} | undefined): void;
|
|
46
|
+
/**
|
|
47
|
+
* Удаляет регистрацию и связанные pending-записи.
|
|
48
|
+
*/
|
|
49
|
+
remove(handle: RaphDerivedHandle<any, any>): void;
|
|
50
|
+
/**
|
|
51
|
+
* Добавляет derived handle в очередь пересчёта.
|
|
52
|
+
*/
|
|
53
|
+
queue(path: ParsedDataPath): void;
|
|
54
|
+
/**
|
|
55
|
+
* Запоминает полную замену, которую нужно применить при стабилизации.
|
|
56
|
+
*/
|
|
57
|
+
queueReplacement(path: ParsedDataPath, keys: ReadonlySet<DerivedCollectionKey>): void;
|
|
58
|
+
/**
|
|
59
|
+
* Сбрасывает pending-состояние после опустошения очереди.
|
|
60
|
+
*/
|
|
61
|
+
clearPendingIfEmpty(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Освобождает все handles и очищает derived registry.
|
|
64
|
+
*/
|
|
65
|
+
dispose(): void;
|
|
66
|
+
private _matching;
|
|
67
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { DataPathDef } from '../path.types';
|
|
2
|
+
import { RaphKernel } from '../RaphKernel';
|
|
3
|
+
import { DerivedStrategy } from './derived-strategy.types';
|
|
4
|
+
/**
|
|
5
|
+
* Сообщает о прямой записи в target, которым владеет derived-вычисление.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RaphDerivedTargetWriteError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Создаёт ошибку с canonical path защищённого derived target.
|
|
10
|
+
*/
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
}
|
|
13
|
+
export interface DerivedOptions<TSource = unknown, TTarget = unknown> {
|
|
14
|
+
readonly id?: string;
|
|
15
|
+
readonly from: DataPathDef;
|
|
16
|
+
readonly to: DataPathDef;
|
|
17
|
+
readonly strategy?: DerivedStrategy;
|
|
18
|
+
readonly compute: (source: TSource) => TTarget;
|
|
19
|
+
readonly immediate?: boolean;
|
|
20
|
+
readonly disposeTarget?: 'keep' | 'delete';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Управляет lifecycle одной materialized path dependency.
|
|
24
|
+
*/
|
|
25
|
+
export declare class RaphDerivedHandle<TSource = unknown, TTarget = unknown> {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly options: DerivedOptions<TSource, TTarget>;
|
|
28
|
+
private readonly _kernel;
|
|
29
|
+
private _removeRoutes;
|
|
30
|
+
private _paused;
|
|
31
|
+
private _disposed;
|
|
32
|
+
private _status;
|
|
33
|
+
private _lastError;
|
|
34
|
+
/**
|
|
35
|
+
* Создаёт internal handle, которым управляет owning Kernel.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
constructor(kernel: RaphKernel, id: string, options: DerivedOptions<TSource, TTarget>);
|
|
39
|
+
/**
|
|
40
|
+
* Показывает, приостановлено ли derived-вычисление.
|
|
41
|
+
*/
|
|
42
|
+
get paused(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Показывает, освобождён ли derived handle.
|
|
45
|
+
*/
|
|
46
|
+
get disposed(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Возвращает состояние последнего derived-пересчёта.
|
|
49
|
+
*/
|
|
50
|
+
get status(): 'idle' | 'success' | 'error';
|
|
51
|
+
/**
|
|
52
|
+
* Возвращает последнюю ошибку derived-пересчёта либо null.
|
|
53
|
+
*/
|
|
54
|
+
get lastError(): Error | null;
|
|
55
|
+
/**
|
|
56
|
+
* Фиксирует успешное завершение derived-пересчёта.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
_recordSuccess(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Фиксирует ошибку derived-пересчёта без потери handle.
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
_recordFailure(error: unknown): void;
|
|
65
|
+
/**
|
|
66
|
+
* Приостанавливает автоматические пересчёты без освобождения handle.
|
|
67
|
+
*/
|
|
68
|
+
pause(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Возобновляет пересчёты и синхронизирует устаревший target.
|
|
71
|
+
*/
|
|
72
|
+
resume(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Принудительно пересчитывает derived target.
|
|
75
|
+
*/
|
|
76
|
+
recompute(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Удаляет derived registration и применяет выбранную политику target cleanup.
|
|
79
|
+
*/
|
|
80
|
+
dispose(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Сохраняет disposers source routes текущей стратегии.
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
_attachRoutes(removers: readonly (() => void)[]): void;
|
|
86
|
+
/**
|
|
87
|
+
* Отсоединяет все source routes текущей стратегии.
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
_detachRoutes(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Помечает handle освобождённым после cleanup owning Kernel.
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
_disposeFromKernel(): void;
|
|
96
|
+
private _assertAlive;
|
|
97
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ParsedDataPath } from '../data-path.types';
|
|
2
|
+
export type DerivedCollectionKey = string | number;
|
|
3
|
+
export interface CollectionDerivedState {
|
|
4
|
+
readonly from: ParsedDataPath;
|
|
5
|
+
readonly kind: 'collection-by-key' | 'filter-by-key';
|
|
6
|
+
readonly key: string;
|
|
7
|
+
initialized: boolean;
|
|
8
|
+
full: boolean;
|
|
9
|
+
readonly keys: Set<DerivedCollectionKey>;
|
|
10
|
+
sourceIndex: Map<DerivedCollectionKey, number> | undefined;
|
|
11
|
+
targetIndex: Map<DerivedCollectionKey, number> | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParsedDataPath } from '../data-path.types';
|
|
2
|
+
import { DataPathDef } from '../path.types';
|
|
3
|
+
import { DerivedCollectionKey } from './derived-collection.types';
|
|
4
|
+
export declare function collectionMutationImpact(source: ParsedDataPath, keyField: string, mutation: ParsedDataPath): {
|
|
5
|
+
readonly kind: 'full';
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'key';
|
|
8
|
+
readonly key: DerivedCollectionKey;
|
|
9
|
+
};
|
|
10
|
+
export declare function keyedPath(collection: DataPathDef, keyField: string, key: DerivedCollectionKey): string;
|
|
11
|
+
export declare function validateFullCollection(id: string, keyField: string, source: unknown, output: unknown): void;
|
|
12
|
+
export declare function validateIncrementalCollection(id: string, keyField: string, inputKeys: readonly DerivedCollectionKey[], output: unknown): void;
|
|
13
|
+
export declare function validateFullFilter(id: string, keyField: string, source: unknown, output: unknown): void;
|
|
14
|
+
export declare function validateIncrementalFilter(id: string, keyField: string, inputKeys: readonly DerivedCollectionKey[], output: unknown): void;
|
|
15
|
+
export declare function collectionKeys(collection: readonly unknown[], keyField: string, label: string): Array<DerivedCollectionKey | undefined>;
|
|
16
|
+
export declare function collectionIndex(collection: readonly unknown[], keyField: string, label: string): Map<DerivedCollectionKey, number>;
|
|
17
|
+
export declare function indexesAreStale(collection: readonly unknown[], keyField: string, index: ReadonlyMap<DerivedCollectionKey, number>, keys: ReadonlySet<DerivedCollectionKey>): boolean;
|
|
18
|
+
export declare function collectionError(id: string, message: string): TypeError;
|
|
19
|
+
export declare function filterError(id: string, message: string): TypeError;
|
|
20
|
+
export declare function cloneMaterializedValue<T>(value: T): T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DerivedFullStrategy {
|
|
2
|
+
readonly kind: 'full';
|
|
3
|
+
}
|
|
4
|
+
export interface DerivedCollectionByKeyStrategy {
|
|
5
|
+
readonly kind: 'collection-by-key';
|
|
6
|
+
readonly key: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DerivedFilterByKeyStrategy {
|
|
9
|
+
readonly kind: 'filter-by-key';
|
|
10
|
+
readonly key: string;
|
|
11
|
+
}
|
|
12
|
+
export type DerivedStrategy = DerivedFullStrategy | DerivedCollectionByKeyStrategy | DerivedFilterByKeyStrategy;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DerivedCollectionByKeyStrategy, DerivedFilterByKeyStrategy, DerivedFullStrategy } from './derived-strategy.types';
|
|
2
|
+
export declare function full(): DerivedFullStrategy;
|
|
3
|
+
export declare function collectionByKey(key: string): DerivedCollectionByKeyStrategy;
|
|
4
|
+
export declare function filterByKey(key: string): DerivedFilterByKeyStrategy;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { DataPathDef } from '../path.types';
|
|
2
|
+
import { RaphKernel } from '../RaphKernel';
|
|
3
|
+
import { RaphMetaEvents, RaphMetaMutationCause, RaphMetaMutationEvent, RaphMetaWatchOptions, RaphMetaWriteOptions } from './meta.types';
|
|
4
|
+
import { DataPath } from '../DataPath';
|
|
5
|
+
import { RaphMeta } from './RaphMeta';
|
|
6
|
+
/**
|
|
7
|
+
* Владеет metadata storage, routing и пакетной публикацией.
|
|
8
|
+
* Kernel сообщает контроллеру только о lifecycle data-owner.
|
|
9
|
+
*/
|
|
10
|
+
export declare class MetaController {
|
|
11
|
+
private readonly _kernel;
|
|
12
|
+
private readonly _ownerExists;
|
|
13
|
+
private readonly _publicationDeferred;
|
|
14
|
+
private _facade;
|
|
15
|
+
private _store;
|
|
16
|
+
private _router;
|
|
17
|
+
private _pending;
|
|
18
|
+
private _publishing;
|
|
19
|
+
private _watcherCount;
|
|
20
|
+
private _deferredWatcherCount;
|
|
21
|
+
/**
|
|
22
|
+
* Создаёт lifecycle-контроллер metadata для одного Kernel.
|
|
23
|
+
*/
|
|
24
|
+
constructor(_kernel: RaphKernel, _ownerExists: (path: DataPathDef) => boolean, _publicationDeferred: () => boolean);
|
|
25
|
+
/**
|
|
26
|
+
* Возвращает metadata facade, принадлежащий контроллеру.
|
|
27
|
+
*/
|
|
28
|
+
get facade(): RaphMeta;
|
|
29
|
+
/**
|
|
30
|
+
* Возвращает число зарегистрированных записей.
|
|
31
|
+
*/
|
|
32
|
+
get size(): number;
|
|
33
|
+
/**
|
|
34
|
+
* Показывает, есть ли активные синхронные metadata/path watchers.
|
|
35
|
+
*/
|
|
36
|
+
get hasWatchers(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Показывает, есть ли watchers с отложенной публикацией.
|
|
39
|
+
*/
|
|
40
|
+
get hasDeferredWatchers(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
43
|
+
*/
|
|
44
|
+
get(path: DataPath, namespace?: string): unknown;
|
|
45
|
+
/**
|
|
46
|
+
* Проверяет наличие значения по указанному пути.
|
|
47
|
+
*/
|
|
48
|
+
has(path: DataPath, namespace?: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Записывает значение и публикует соответствующее изменение.
|
|
51
|
+
*/
|
|
52
|
+
set(path: DataPath, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
53
|
+
/**
|
|
54
|
+
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
55
|
+
*/
|
|
56
|
+
merge(path: DataPath, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
57
|
+
/**
|
|
58
|
+
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
59
|
+
*/
|
|
60
|
+
delete(path: DataPath, namespace?: string, options?: RaphMetaWriteOptions): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Удаляет metadata всего поддерева указанного data-owner.
|
|
63
|
+
*/
|
|
64
|
+
deleteSubtree(path: DataPath, cause: Extract<RaphMetaMutationCause, 'owner-delete' | 'owner-replaced'>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Удаляет metadata, владельцы которой отсутствуют в data tree.
|
|
67
|
+
*/
|
|
68
|
+
pruneMissing(path: DataPath, cause: Extract<RaphMetaMutationCause, 'owner-delete' | 'owner-replaced'>): void;
|
|
69
|
+
/**
|
|
70
|
+
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
71
|
+
*/
|
|
72
|
+
watch(maskOrMasks: DataPathDef | readonly DataPathDef[], callback: (payload: RaphMetaEvents) => void, options?: RaphMetaWatchOptions, afterPublish?: (invalidate: boolean) => void): () => void;
|
|
73
|
+
/**
|
|
74
|
+
* Добавляет событие в текущую batch либо публикует его сразу.
|
|
75
|
+
*/
|
|
76
|
+
record(kind: RaphMetaMutationEvent['kind'], path: DataPath, namespace: string | null, cause: RaphMetaMutationCause, options?: RaphMetaWriteOptions): void;
|
|
77
|
+
/**
|
|
78
|
+
* Публикует накопленные metadata-события с учётом watcher mode.
|
|
79
|
+
*/
|
|
80
|
+
publish(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Очищает metadata storage, subscriptions и pending publication state.
|
|
83
|
+
*/
|
|
84
|
+
dispose(): void;
|
|
85
|
+
}
|