@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DataPathDef } from '../path.types';
|
|
2
|
+
import { RaphKernel } from '../RaphKernel';
|
|
3
|
+
import { RaphMetaApi, RaphMetaReadOptions, RaphMetaWatchCallback, RaphMetaWatchOptions, RaphMetaWriteOptions } from './meta.types';
|
|
4
|
+
export interface RaphMetaBinding {
|
|
5
|
+
readonly assertReadable?: () => void;
|
|
6
|
+
readonly assertWritable?: () => void;
|
|
7
|
+
readonly runWrite?: <Result>(operation: () => Result, invalidate: boolean) => Result;
|
|
8
|
+
readonly watch?: (masks: DataPathDef | readonly DataPathDef[], callback: RaphMetaWatchCallback, options: RaphMetaWatchOptions) => () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Тонкий фасад отдельного Kernel-owned Meta-plane.
|
|
12
|
+
*/
|
|
13
|
+
export declare class RaphMeta implements RaphMetaApi {
|
|
14
|
+
private readonly _kernel;
|
|
15
|
+
private readonly _binding;
|
|
16
|
+
/**
|
|
17
|
+
* Создаёт metadata facade поверх указанного Kernel.
|
|
18
|
+
*/
|
|
19
|
+
constructor(_kernel: RaphKernel, _binding?: RaphMetaBinding);
|
|
20
|
+
/**
|
|
21
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
22
|
+
*/
|
|
23
|
+
get(path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions): unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Проверяет наличие значения по указанному пути.
|
|
26
|
+
*/
|
|
27
|
+
has(path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Записывает значение и публикует соответствующее изменение.
|
|
30
|
+
*/
|
|
31
|
+
set(path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
32
|
+
/**
|
|
33
|
+
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
34
|
+
*/
|
|
35
|
+
merge(path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions): void;
|
|
36
|
+
/**
|
|
37
|
+
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
38
|
+
*/
|
|
39
|
+
delete(path: DataPathDef, namespace?: string, options?: RaphMetaWriteOptions): void;
|
|
40
|
+
/**
|
|
41
|
+
* Подписывает callback на metadata-изменения и возвращает disposer.
|
|
42
|
+
*/
|
|
43
|
+
watch(masks: DataPathDef | readonly DataPathDef[], callback: RaphMetaWatchCallback, options?: RaphMetaWatchOptions): () => void;
|
|
44
|
+
private _write;
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DataPath } from '../DataPath';
|
|
2
|
+
/**
|
|
3
|
+
* Kernel-owned дерево metadata, адресованное каноническими DataPath.
|
|
4
|
+
*/
|
|
5
|
+
export declare class RaphMetaStore {
|
|
6
|
+
private readonly _root;
|
|
7
|
+
size: number;
|
|
8
|
+
/**
|
|
9
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
10
|
+
*/
|
|
11
|
+
get(path: DataPath, namespace?: string): unknown;
|
|
12
|
+
/**
|
|
13
|
+
* Проверяет наличие значения по указанному пути.
|
|
14
|
+
*/
|
|
15
|
+
has(path: DataPath, namespace?: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Записывает значение namespace в metadata tree.
|
|
18
|
+
*/
|
|
19
|
+
set(path: DataPath, namespace: string, value: unknown): void;
|
|
20
|
+
/**
|
|
21
|
+
* Объединяет object metadata либо заменяет значение namespace.
|
|
22
|
+
*/
|
|
23
|
+
merge(path: DataPath, namespace: string, value: unknown): void;
|
|
24
|
+
/**
|
|
25
|
+
* Удаляет namespace либо все metadata указанного owner.
|
|
26
|
+
*/
|
|
27
|
+
delete(path: DataPath, namespace?: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Удаляет metadata всего поддерева указанного data-owner.
|
|
30
|
+
*/
|
|
31
|
+
deleteSubtree(path: DataPath): DataPath[];
|
|
32
|
+
/**
|
|
33
|
+
* Удаляет metadata, владельцы которой отсутствуют в data tree.
|
|
34
|
+
*/
|
|
35
|
+
pruneMissing(path: DataPath, ownerExists: (candidate: DataPath) => boolean): DataPath[];
|
|
36
|
+
/**
|
|
37
|
+
* Полностью очищает metadata storage.
|
|
38
|
+
*/
|
|
39
|
+
clear(): DataPath[];
|
|
40
|
+
private _find;
|
|
41
|
+
private _ensure;
|
|
42
|
+
private _findStack;
|
|
43
|
+
private _pruneEmpty;
|
|
44
|
+
private _pruneMissingNode;
|
|
45
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DataPath } from '../DataPath';
|
|
2
|
+
import { DataPathDef, PathOptions } from '../path.types';
|
|
3
|
+
export type RaphMetaMutationKind = 'set' | 'merge' | 'delete';
|
|
4
|
+
export type RaphMetaMutationCause = 'explicit' | 'owner-delete' | 'owner-replaced';
|
|
5
|
+
export interface RaphMetaMutationEvent {
|
|
6
|
+
readonly kind: RaphMetaMutationKind;
|
|
7
|
+
readonly path: DataPath;
|
|
8
|
+
readonly namespace: string | null;
|
|
9
|
+
readonly cause: RaphMetaMutationCause;
|
|
10
|
+
}
|
|
11
|
+
export interface RaphMetaEvents {
|
|
12
|
+
readonly events: readonly RaphMetaMutationEvent[];
|
|
13
|
+
}
|
|
14
|
+
export interface RaphMetaReadOptions extends PathOptions {
|
|
15
|
+
}
|
|
16
|
+
export interface RaphMetaWriteOptions extends RaphMetaReadOptions {
|
|
17
|
+
readonly invalidate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface RaphMetaWatchOptions extends RaphMetaReadOptions {
|
|
20
|
+
readonly namespace?: string;
|
|
21
|
+
readonly wildcardDynamic?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type RaphMetaWatchCallback = (payload: RaphMetaEvents) => void | (() => void);
|
|
24
|
+
export interface RaphMetaApi {
|
|
25
|
+
get: (path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions) => unknown;
|
|
26
|
+
has: (path: DataPathDef, namespace?: string, options?: RaphMetaReadOptions) => boolean;
|
|
27
|
+
set: (path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions) => void;
|
|
28
|
+
merge: (path: DataPathDef, namespace: string, value: unknown, options?: RaphMetaWriteOptions) => void;
|
|
29
|
+
delete: (path: DataPathDef, namespace?: string, options?: RaphMetaWriteOptions) => void;
|
|
30
|
+
watch: (masks: DataPathDef | readonly DataPathDef[], callback: RaphMetaWatchCallback, options?: RaphMetaWatchOptions) => () => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PlainDataPath } from './data-path.types';
|
|
2
|
+
import { DataPath } from './DataPath';
|
|
3
|
+
export type DataPathDef = string | DataPath | PlainDataPath;
|
|
4
|
+
export interface PathOptions {
|
|
5
|
+
readonly vars?: Readonly<Record<string, unknown>>;
|
|
6
|
+
}
|
|
7
|
+
export type PathMutationKind = 'set' | 'merge' | 'delete';
|
|
8
|
+
export interface PathEvent {
|
|
9
|
+
readonly kind: PathMutationKind;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly previous: unknown;
|
|
12
|
+
readonly value: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface PathEvents {
|
|
15
|
+
readonly events: readonly PathEvent[];
|
|
16
|
+
}
|
|
17
|
+
export type PathWatchCallback = (payload: PathEvents) => void;
|
|
18
|
+
export interface PathApi {
|
|
19
|
+
get: <T = unknown>(path: DataPathDef, options?: PathOptions) => T | undefined;
|
|
20
|
+
peek: <T = unknown>(path: DataPathDef, options?: PathOptions) => T | undefined;
|
|
21
|
+
has: (path: DataPathDef, options?: PathOptions) => boolean;
|
|
22
|
+
set: <T>(path: DataPathDef, value: T, options?: PathOptions) => void;
|
|
23
|
+
merge: (path: DataPathDef, value: unknown, options?: PathOptions) => void;
|
|
24
|
+
delete: (path: DataPathDef, options?: PathOptions) => void;
|
|
25
|
+
batch: <T>(operation: () => T) => T;
|
|
26
|
+
watch: (masks: DataPathDef | readonly DataPathDef[], callback: PathWatchCallback) => () => void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DataPathDef, PathOptions, PathWatchCallback } from '../path.types';
|
|
2
|
+
import { DataAdapter } from './data-adapter.types';
|
|
3
|
+
/**
|
|
4
|
+
* Связывает events и watchers только для Kernel поверх внешнего DataAdapter.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AdapterPathStore {
|
|
7
|
+
private readonly _adapter;
|
|
8
|
+
private readonly _eventHub;
|
|
9
|
+
/**
|
|
10
|
+
* Связывает внешний DataAdapter с path events и watchers Kernel.
|
|
11
|
+
*/
|
|
12
|
+
constructor(_adapter: DataAdapter);
|
|
13
|
+
/**
|
|
14
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
15
|
+
*/
|
|
16
|
+
get<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Читает значение по пути без регистрации реактивной зависимости.
|
|
19
|
+
*/
|
|
20
|
+
peek<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Проверяет наличие значения по указанному пути.
|
|
23
|
+
*/
|
|
24
|
+
has(path: DataPathDef, options?: PathOptions): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Записывает значение и публикует соответствующее изменение.
|
|
27
|
+
*/
|
|
28
|
+
set<T>(path: DataPathDef, value: T, options?: PathOptions): void;
|
|
29
|
+
/**
|
|
30
|
+
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
31
|
+
*/
|
|
32
|
+
merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
33
|
+
/**
|
|
34
|
+
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
35
|
+
*/
|
|
36
|
+
delete(path: DataPathDef, options?: PathOptions): void;
|
|
37
|
+
/**
|
|
38
|
+
* Выполняет операцию в общей синхронной batch boundary.
|
|
39
|
+
*/
|
|
40
|
+
batch<T>(operation: () => T): T;
|
|
41
|
+
/**
|
|
42
|
+
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
43
|
+
*/
|
|
44
|
+
watch(maskOrMasks: DataPathDef | readonly DataPathDef[], callback: PathWatchCallback): () => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DataPathDef, PathOptions } from '../path.types';
|
|
2
|
+
import { DataAdapter, DataObject, DefaultAdapterOptions } from './data-adapter.types';
|
|
3
|
+
/**
|
|
4
|
+
* Настраиваемый in-memory adapter, включаемый явно.
|
|
5
|
+
* Kernel без опций продолжает работать напрямую через PathStore без дополнительной ветки.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultDataAdapter implements DataAdapter {
|
|
8
|
+
private _root;
|
|
9
|
+
private readonly _options;
|
|
10
|
+
private _indexes;
|
|
11
|
+
/**
|
|
12
|
+
* Создаёт in-memory adapter с заданным начальным root и опциями.
|
|
13
|
+
*/
|
|
14
|
+
constructor(initial?: DataObject, options?: DefaultAdapterOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает текущий корневой объект adapter.
|
|
17
|
+
*/
|
|
18
|
+
root(): DataObject;
|
|
19
|
+
/**
|
|
20
|
+
* Создаёт изолированную copy-on-write проекцию для синхронной проверки mutation.
|
|
21
|
+
*/
|
|
22
|
+
fork(): DefaultDataAdapter;
|
|
23
|
+
/**
|
|
24
|
+
* Заменяет корневой объект без path-level публикации.
|
|
25
|
+
*/
|
|
26
|
+
replaceRoot(root: DataObject): void;
|
|
27
|
+
/**
|
|
28
|
+
* Обновляет изменяемые опции adapter и сбрасывает построенные indexes.
|
|
29
|
+
*/
|
|
30
|
+
options(options: DefaultAdapterOptions): void;
|
|
31
|
+
/**
|
|
32
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
33
|
+
*/
|
|
34
|
+
get(path: DataPathDef, options?: PathOptions): unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Проверяет наличие значения по указанному пути.
|
|
37
|
+
*/
|
|
38
|
+
has(path: DataPathDef, options?: PathOptions): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Записывает значение по пути и обновляет затронутые selector indexes.
|
|
41
|
+
*/
|
|
42
|
+
set(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
43
|
+
/**
|
|
44
|
+
* Объединяет object value либо заменяет значение по пути.
|
|
45
|
+
*/
|
|
46
|
+
merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
47
|
+
/**
|
|
48
|
+
* Удаляет значение согласно arrayDelete policy adapter.
|
|
49
|
+
*/
|
|
50
|
+
delete(path: DataPathDef, options?: PathOptions): void;
|
|
51
|
+
/**
|
|
52
|
+
* Находит индекс элемента массива по selector-сегменту.
|
|
53
|
+
*/
|
|
54
|
+
indexOf(path: DataPathDef, options?: PathOptions): number;
|
|
55
|
+
private _read;
|
|
56
|
+
private _readSegment;
|
|
57
|
+
private _readOrCreateChild;
|
|
58
|
+
private _writeSegment;
|
|
59
|
+
private _invalidateArray;
|
|
60
|
+
private _invalidateIndexKey;
|
|
61
|
+
private _findSelector;
|
|
62
|
+
private _createIndex;
|
|
63
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DataPathDef, PathEvent, PathWatchCallback } from '../path.types';
|
|
2
|
+
/**
|
|
3
|
+
* Общий dormant event/watch lifecycle для встроенного и adapter path-store.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathEventHub {
|
|
6
|
+
private readonly _batchErrorMessage;
|
|
7
|
+
private _router;
|
|
8
|
+
private _events;
|
|
9
|
+
private _batchDepth;
|
|
10
|
+
private _watcherCount;
|
|
11
|
+
private _publishing;
|
|
12
|
+
/**
|
|
13
|
+
* Создаёт общий batch и publication boundary для path store.
|
|
14
|
+
*/
|
|
15
|
+
constructor(_batchErrorMessage: string);
|
|
16
|
+
/**
|
|
17
|
+
* Показывает, есть ли watchers, ради которых нужно сохранять значения событий.
|
|
18
|
+
*/
|
|
19
|
+
get hasWatchers(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Возвращает накопленные события текущей batch.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
get events(): readonly PathEvent[] | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Возвращает внутренний path router для диагностики store.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
get router(): unknown;
|
|
30
|
+
/**
|
|
31
|
+
* Возвращает число активных watchers.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
get watcherCount(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Добавляет событие в текущую batch либо публикует его сразу.
|
|
37
|
+
*/
|
|
38
|
+
record(event: PathEvent): void;
|
|
39
|
+
/**
|
|
40
|
+
* Выполняет операцию в общей синхронной batch boundary.
|
|
41
|
+
*/
|
|
42
|
+
batch<T>(operation: () => T): T;
|
|
43
|
+
/**
|
|
44
|
+
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
45
|
+
*/
|
|
46
|
+
watch(maskOrMasks: DataPathDef | readonly DataPathDef[], callback: PathWatchCallback): () => void;
|
|
47
|
+
private _publish;
|
|
48
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DataPathDef, PathApi, PathOptions, PathWatchCallback } from '../path.types';
|
|
2
|
+
/**
|
|
3
|
+
* Владеет одним независимым path-root, mutation log и watch-router.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PathStore implements PathApi {
|
|
6
|
+
private _root;
|
|
7
|
+
private readonly _eventHub;
|
|
8
|
+
/**
|
|
9
|
+
* Возвращает внутренний router для диагностического контракта Kernel.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
private get _router();
|
|
13
|
+
private get _events();
|
|
14
|
+
private get _watcherCount();
|
|
15
|
+
/**
|
|
16
|
+
* Возвращает значение по пути без создания отсутствующих данных.
|
|
17
|
+
*/
|
|
18
|
+
get<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Читает значение по пути без регистрации реактивной зависимости.
|
|
21
|
+
*/
|
|
22
|
+
peek<T = unknown>(path: DataPathDef, options?: PathOptions): T | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Проверяет наличие значения по указанному пути.
|
|
25
|
+
*/
|
|
26
|
+
has(path: DataPathDef, options?: PathOptions): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Записывает значение и публикует соответствующее изменение.
|
|
29
|
+
*/
|
|
30
|
+
set<T>(path: DataPathDef, value: T, options?: PathOptions): void;
|
|
31
|
+
/**
|
|
32
|
+
* Объединяет значение по пути и публикует соответствующее изменение.
|
|
33
|
+
*/
|
|
34
|
+
merge(path: DataPathDef, value: unknown, options?: PathOptions): void;
|
|
35
|
+
/**
|
|
36
|
+
* Удаляет значение по пути и публикует изменение при наличии данных.
|
|
37
|
+
*/
|
|
38
|
+
delete(path: DataPathDef, options?: PathOptions): void;
|
|
39
|
+
/**
|
|
40
|
+
* Выполняет операцию в общей синхронной batch boundary.
|
|
41
|
+
*/
|
|
42
|
+
batch<T>(operation: () => T): T;
|
|
43
|
+
/**
|
|
44
|
+
* Подписывает callback на подходящие изменения и возвращает disposer.
|
|
45
|
+
*/
|
|
46
|
+
watch(maskOrMasks: DataPathDef | readonly DataPathDef[], callback: PathWatchCallback): () => void;
|
|
47
|
+
private _setRoot;
|
|
48
|
+
private _mergeRoot;
|
|
49
|
+
private _deleteRoot;
|
|
50
|
+
private _recordRootEvent;
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataPathDef, PathOptions } from '../path.types';
|
|
2
|
+
export type DataObject = Record<string, unknown> | unknown[];
|
|
3
|
+
export interface DataAdapter {
|
|
4
|
+
root: () => DataObject;
|
|
5
|
+
has?: (path: DataPathDef, options?: PathOptions) => boolean;
|
|
6
|
+
get: (path: DataPathDef, options?: PathOptions) => unknown;
|
|
7
|
+
set: (path: DataPathDef, value: unknown, options?: PathOptions) => void;
|
|
8
|
+
delete: (path: DataPathDef, options?: PathOptions) => void;
|
|
9
|
+
merge: (path: DataPathDef, value: unknown, options?: PathOptions) => void;
|
|
10
|
+
indexOf?: (path: DataPathDef, options?: PathOptions) => number;
|
|
11
|
+
}
|
|
12
|
+
export interface DefaultAdapterOptions {
|
|
13
|
+
readonly arrayDelete?: 'splice' | 'unset';
|
|
14
|
+
readonly autoCreate?: boolean;
|
|
15
|
+
readonly indexEnabled?: boolean;
|
|
16
|
+
readonly indexStrategy?: 'lazy-key' | 'eager-all-keys';
|
|
17
|
+
}
|
package/dist/path.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./debug/path/DataPath.cjs"),e=require("./debug/path/derived/derived-strategy.utils.cjs"),a=require("./debug/path/derived/RaphDerivedHandle.cjs"),r=require("./debug/path/meta/RaphMeta.cjs"),d=require("./debug/path/RaphKernel.cjs"),l=require("./debug/path/storage/DefaultDataAdapter.cjs"),u=require("./debug/path/storage/PathStore.cjs");exports.DataPath=t.DataPath;exports.collectionByKey=e.collectionByKey;exports.filterByKey=e.filterByKey;exports.full=e.full;exports.RaphDerivedHandle=a.RaphDerivedHandle;exports.RaphMeta=r.RaphMeta;exports.RaphKernel=d.RaphKernel;exports.DefaultDataAdapter=l.DefaultDataAdapter;exports.PathStore=u.PathStore;
|
package/dist/path.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataPath as o } from "./debug/path/DataPath.js";
|
|
2
|
+
import { collectionByKey as a, filterByKey as p, full as f } from "./debug/path/derived/derived-strategy.utils.js";
|
|
3
|
+
import { RaphDerivedHandle as m } from "./debug/path/derived/RaphDerivedHandle.js";
|
|
4
|
+
import { RaphMeta as h } from "./debug/path/meta/RaphMeta.js";
|
|
5
|
+
import { RaphKernel as D } from "./debug/path/RaphKernel.js";
|
|
6
|
+
import { DefaultDataAdapter as i } from "./debug/path/storage/DefaultDataAdapter.js";
|
|
7
|
+
import { PathStore as K } from "./debug/path/storage/PathStore.js";
|
|
8
|
+
export {
|
|
9
|
+
o as DataPath,
|
|
10
|
+
i as DefaultDataAdapter,
|
|
11
|
+
K as PathStore,
|
|
12
|
+
m as RaphDerivedHandle,
|
|
13
|
+
D as RaphKernel,
|
|
14
|
+
h as RaphMeta,
|
|
15
|
+
a as collectionByKey,
|
|
16
|
+
p as filterByKey,
|
|
17
|
+
f as full
|
|
18
|
+
};
|
package/dist/raph.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug/api/errors.cjs"),p=require("./debug/api/Raph.cjs"),i=require("./debug/api/RaphReactivityInstance.cjs"),r=require("./debug/runtime/errors.cjs"),o=require("./debug/runtime/ownership/parentGraph.cjs"),h=require("./debug/runtime/ownership/RaphEffectScope.cjs"),n=require("./debug/runtime/ownership/RaphNode.cjs"),s=require("./debug/runtime/ownership/RaphScope.cjs"),u=require("./debug/runtime/phases/orderPhaseTasks.cjs"),R=require("./debug/runtime/phases/phase.types.cjs"),d=require("./debug/runtime/RaphRuntime.cjs"),c=require("./debug/runtime/reactivity/PathHandle.cjs"),_=require("./debug/path/DataPath.cjs"),a=require("./debug/path/derived/derived-strategy.utils.cjs"),t=require("./debug/path/derived/RaphDerivedHandle.cjs"),l=require("./debug/path/meta/RaphMeta.cjs"),g=require("./debug/path/RaphKernel.cjs"),E=require("./debug/path/storage/DefaultDataAdapter.cjs");exports.RaphCapabilityError=e.RaphCapabilityError;exports.RaphConfigurationError=e.RaphConfigurationError;exports.RaphDefaultInstanceError=e.RaphDefaultInstanceError;exports.RaphError=e.RaphError;exports.RaphFacadeDisposedError=e.RaphFacadeDisposedError;exports.Raph=p.Raph;exports.RaphReactivityInstance=i.RaphReactivityInstance;exports.RaphActionError=r.RaphActionError;exports.RaphCrossRuntimeError=r.RaphCrossRuntimeError;exports.RaphDisposedError=r.RaphDisposedError;exports.RaphPhaseProcessError=r.RaphPhaseProcessError;exports.parentGraph=o.parentGraph;exports.RaphEffectScope=h.RaphEffectScope;exports.RaphNode=n.RaphNode;exports.RaphScope=s.RaphScope;exports.orderPhaseTasks=u.orderPhaseTasks;exports.RaphSchedulerType=R.RaphSchedulerType;exports.RaphRuntime=d.RaphRuntime;exports.PathHandle=c.PathHandle;exports.DataPath=_.DataPath;exports.collectionByKey=a.collectionByKey;exports.filterByKey=a.filterByKey;exports.full=a.full;exports.RaphDerivedHandle=t.RaphDerivedHandle;exports.RaphDerivedTargetWriteError=t.RaphDerivedTargetWriteError;exports.RaphMeta=l.RaphMeta;exports.RaphKernel=g.RaphKernel;exports.DefaultDataAdapter=E.DefaultDataAdapter;
|
package/dist/raph.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RaphCapabilityError as e, RaphConfigurationError as p, RaphDefaultInstanceError as a, RaphError as t, RaphFacadeDisposedError as h } from "./debug/api/errors.js";
|
|
2
|
+
import { Raph as R } from "./debug/api/Raph.js";
|
|
3
|
+
import { RaphReactivityInstance as x } from "./debug/api/RaphReactivityInstance.js";
|
|
4
|
+
import { RaphActionError as n, RaphCrossRuntimeError as s, RaphDisposedError as c, RaphPhaseProcessError as l } from "./debug/runtime/errors.js";
|
|
5
|
+
import { parentGraph as E } from "./debug/runtime/ownership/parentGraph.js";
|
|
6
|
+
import { RaphEffectScope as u } from "./debug/runtime/ownership/RaphEffectScope.js";
|
|
7
|
+
import { RaphNode as P } from "./debug/runtime/ownership/RaphNode.js";
|
|
8
|
+
import { RaphScope as C } from "./debug/runtime/ownership/RaphScope.js";
|
|
9
|
+
import { orderPhaseTasks as S } from "./debug/runtime/phases/orderPhaseTasks.js";
|
|
10
|
+
import { RaphSchedulerType as g } from "./debug/runtime/phases/phase.types.js";
|
|
11
|
+
import { RaphRuntime as B } from "./debug/runtime/RaphRuntime.js";
|
|
12
|
+
import { PathHandle as I } from "./debug/runtime/reactivity/PathHandle.js";
|
|
13
|
+
import { DataPath as k } from "./debug/path/DataPath.js";
|
|
14
|
+
import { collectionByKey as G, filterByKey as M, full as N } from "./debug/path/derived/derived-strategy.utils.js";
|
|
15
|
+
import { RaphDerivedHandle as j, RaphDerivedTargetWriteError as q } from "./debug/path/derived/RaphDerivedHandle.js";
|
|
16
|
+
import { RaphMeta as z } from "./debug/path/meta/RaphMeta.js";
|
|
17
|
+
import { RaphKernel as L } from "./debug/path/RaphKernel.js";
|
|
18
|
+
import { DefaultDataAdapter as Q } from "./debug/path/storage/DefaultDataAdapter.js";
|
|
19
|
+
export {
|
|
20
|
+
k as DataPath,
|
|
21
|
+
Q as DefaultDataAdapter,
|
|
22
|
+
I as PathHandle,
|
|
23
|
+
R as Raph,
|
|
24
|
+
n as RaphActionError,
|
|
25
|
+
e as RaphCapabilityError,
|
|
26
|
+
p as RaphConfigurationError,
|
|
27
|
+
s as RaphCrossRuntimeError,
|
|
28
|
+
a as RaphDefaultInstanceError,
|
|
29
|
+
j as RaphDerivedHandle,
|
|
30
|
+
q as RaphDerivedTargetWriteError,
|
|
31
|
+
c as RaphDisposedError,
|
|
32
|
+
u as RaphEffectScope,
|
|
33
|
+
t as RaphError,
|
|
34
|
+
h as RaphFacadeDisposedError,
|
|
35
|
+
L as RaphKernel,
|
|
36
|
+
z as RaphMeta,
|
|
37
|
+
P as RaphNode,
|
|
38
|
+
l as RaphPhaseProcessError,
|
|
39
|
+
x as RaphReactivityInstance,
|
|
40
|
+
B as RaphRuntime,
|
|
41
|
+
g as RaphSchedulerType,
|
|
42
|
+
C as RaphScope,
|
|
43
|
+
G as collectionByKey,
|
|
44
|
+
M as filterByKey,
|
|
45
|
+
N as full,
|
|
46
|
+
S as orderPhaseTasks,
|
|
47
|
+
E as parentGraph
|
|
48
|
+
};
|