@hops-ops/distributed 0.0.0
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 +454 -0
- package/dist/auth-headers.d.ts +8 -0
- package/dist/auth-headers.js +35 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.js +1 -0
- package/dist/document.d.ts +8 -0
- package/dist/document.js +6 -0
- package/dist/identity.d.ts +23 -0
- package/dist/identity.js +73 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6 -0
- package/dist/internal/cache-engine/create.d.ts +5 -0
- package/dist/internal/cache-engine/create.js +7 -0
- package/dist/internal/cache-engine/engine.d.ts +32 -0
- package/dist/internal/cache-engine/engine.js +1287 -0
- package/dist/internal/cache-engine/errors.d.ts +5 -0
- package/dist/internal/cache-engine/errors.js +10 -0
- package/dist/internal/cache-engine/helpers.d.ts +55 -0
- package/dist/internal/cache-engine/helpers.js +545 -0
- package/dist/internal/cache-engine/index.d.ts +3 -0
- package/dist/internal/cache-engine/index.js +2 -0
- package/dist/internal/cache-engine/types.d.ts +300 -0
- package/dist/internal/cache-engine/types.js +1 -0
- package/dist/internal/cache-engine.d.ts +3 -0
- package/dist/internal/cache-engine.js +2 -0
- package/dist/lib/assert-name.d.ts +2 -0
- package/dist/lib/assert-name.js +6 -0
- package/dist/lib/compare-code-units.d.ts +2 -0
- package/dist/lib/compare-code-units.js +4 -0
- package/dist/lib/deep-equal.d.ts +2 -0
- package/dist/lib/deep-equal.js +24 -0
- package/dist/lib/freeze-record.d.ts +2 -0
- package/dist/lib/freeze-record.js +13 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/is-plain-record.d.ts +2 -0
- package/dist/lib/is-plain-record.js +8 -0
- package/dist/lib/report.d.ts +7 -0
- package/dist/lib/report.js +26 -0
- package/dist/protocol.d.ts +179 -0
- package/dist/protocol.js +558 -0
- package/dist/react/context.d.ts +20 -0
- package/dist/react/context.js +24 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +3 -0
- package/dist/react/query.d.ts +20 -0
- package/dist/react/query.js +99 -0
- package/dist/replica/command-id.d.ts +2 -0
- package/dist/replica/command-id.js +19 -0
- package/dist/replica/command-runtime/constants.d.ts +5 -0
- package/dist/replica/command-runtime/constants.js +5 -0
- package/dist/replica/command-runtime/create.d.ts +2 -0
- package/dist/replica/command-runtime/create.js +644 -0
- package/dist/replica/command-runtime/errors.d.ts +16 -0
- package/dist/replica/command-runtime/errors.js +41 -0
- package/dist/replica/command-runtime/index.d.ts +5 -0
- package/dist/replica/command-runtime/index.js +4 -0
- package/dist/replica/command-runtime/lib/binding.d.ts +4 -0
- package/dist/replica/command-runtime/lib/binding.js +64 -0
- package/dist/replica/command-runtime/lib/effects.d.ts +11 -0
- package/dist/replica/command-runtime/lib/effects.js +89 -0
- package/dist/replica/command-runtime/lib/index.d.ts +9 -0
- package/dist/replica/command-runtime/lib/index.js +9 -0
- package/dist/replica/command-runtime/lib/inventory.d.ts +10 -0
- package/dist/replica/command-runtime/lib/inventory.js +141 -0
- package/dist/replica/command-runtime/lib/output.d.ts +13 -0
- package/dist/replica/command-runtime/lib/output.js +190 -0
- package/dist/replica/command-runtime/lib/projection.d.ts +20 -0
- package/dist/replica/command-runtime/lib/projection.js +255 -0
- package/dist/replica/command-runtime/lib/status.d.ts +7 -0
- package/dist/replica/command-runtime/lib/status.js +127 -0
- package/dist/replica/command-runtime/lib/transport.d.ts +16 -0
- package/dist/replica/command-runtime/lib/transport.js +112 -0
- package/dist/replica/command-runtime/lib/util.d.ts +16 -0
- package/dist/replica/command-runtime/lib/util.js +127 -0
- package/dist/replica/command-runtime/lifecycle.d.ts +11 -0
- package/dist/replica/command-runtime/lifecycle.js +13 -0
- package/dist/replica/command-runtime/symbols.d.ts +30 -0
- package/dist/replica/command-runtime/symbols.js +30 -0
- package/dist/replica/command-runtime/types.d.ts +222 -0
- package/dist/replica/command-runtime/types.js +1 -0
- package/dist/replica/command-runtime.d.ts +3 -0
- package/dist/replica/command-runtime.js +2 -0
- package/dist/replica/commands/clone.d.ts +12 -0
- package/dist/replica/commands/clone.js +187 -0
- package/dist/replica/commands/constants.d.ts +6 -0
- package/dist/replica/commands/constants.js +6 -0
- package/dist/replica/commands/errors.d.ts +7 -0
- package/dist/replica/commands/errors.js +22 -0
- package/dist/replica/commands/implementation.d.ts +8 -0
- package/dist/replica/commands/implementation.js +8 -0
- package/dist/replica/commands/index.d.ts +5 -0
- package/dist/replica/commands/index.js +4 -0
- package/dist/replica/commands/prepare.d.ts +27 -0
- package/dist/replica/commands/prepare.js +77 -0
- package/dist/replica/commands/presets.d.ts +12 -0
- package/dist/replica/commands/presets.js +84 -0
- package/dist/replica/commands/receipt.d.ts +3 -0
- package/dist/replica/commands/receipt.js +36 -0
- package/dist/replica/commands/resolve.d.ts +11 -0
- package/dist/replica/commands/resolve.js +165 -0
- package/dist/replica/commands/types.d.ts +278 -0
- package/dist/replica/commands/types.js +2 -0
- package/dist/replica/commands/util.d.ts +21 -0
- package/dist/replica/commands/util.js +96 -0
- package/dist/replica/commands/validate.d.ts +18 -0
- package/dist/replica/commands/validate.js +477 -0
- package/dist/replica/commands.d.ts +3 -0
- package/dist/replica/commands.js +2 -0
- package/dist/replica/diagnostics/event-log.d.ts +4 -0
- package/dist/replica/diagnostics/event-log.js +463 -0
- package/dist/replica/diagnostics/implementation.d.ts +4 -0
- package/dist/replica/diagnostics/implementation.js +4 -0
- package/dist/replica/diagnostics/index.d.ts +2 -0
- package/dist/replica/diagnostics/index.js +1 -0
- package/dist/replica/diagnostics/inspect.d.ts +6 -0
- package/dist/replica/diagnostics/inspect.js +170 -0
- package/dist/replica/diagnostics/types.d.ts +295 -0
- package/dist/replica/diagnostics/types.js +2 -0
- package/dist/replica/diagnostics.d.ts +3 -0
- package/dist/replica/diagnostics.js +2 -0
- package/dist/replica/distributed-replica/clocks.d.ts +23 -0
- package/dist/replica/distributed-replica/clocks.js +156 -0
- package/dist/replica/distributed-replica/constants.d.ts +12 -0
- package/dist/replica/distributed-replica/constants.js +10 -0
- package/dist/replica/distributed-replica/helpers.d.ts +48 -0
- package/dist/replica/distributed-replica/helpers.js +445 -0
- package/dist/replica/distributed-replica/hydration.d.ts +19 -0
- package/dist/replica/distributed-replica/hydration.js +380 -0
- package/dist/replica/distributed-replica/impl-diagnostics.d.ts +22 -0
- package/dist/replica/distributed-replica/impl-diagnostics.js +189 -0
- package/dist/replica/distributed-replica/impl-fetch-live.d.ts +39 -0
- package/dist/replica/distributed-replica/impl-fetch-live.js +395 -0
- package/dist/replica/distributed-replica/impl-hydration-orchestrate.d.ts +56 -0
- package/dist/replica/distributed-replica/impl-hydration-orchestrate.js +299 -0
- package/dist/replica/distributed-replica/impl-optimistic.d.ts +31 -0
- package/dist/replica/distributed-replica/impl-optimistic.js +172 -0
- package/dist/replica/distributed-replica/impl-protocol.d.ts +53 -0
- package/dist/replica/distributed-replica/impl-protocol.js +108 -0
- package/dist/replica/distributed-replica/impl.d.ts +44 -0
- package/dist/replica/distributed-replica/impl.js +1776 -0
- package/dist/replica/distributed-replica/index.d.ts +2 -0
- package/dist/replica/distributed-replica/index.js +4 -0
- package/dist/replica/distributed-replica/optimistic.d.ts +30 -0
- package/dist/replica/distributed-replica/optimistic.js +221 -0
- package/dist/replica/distributed-replica/types.d.ts +147 -0
- package/dist/replica/distributed-replica/types.js +1 -0
- package/dist/replica/distributed-replica/watch.d.ts +19 -0
- package/dist/replica/distributed-replica/watch.js +95 -0
- package/dist/replica/distributed-replica.d.ts +2 -0
- package/dist/replica/distributed-replica.js +2 -0
- package/dist/replica/graphql-transport.d.ts +24 -0
- package/dist/replica/graphql-transport.js +122 -0
- package/dist/replica/identity/clone.d.ts +6 -0
- package/dist/replica/identity/clone.js +54 -0
- package/dist/replica/identity/codec.d.ts +48 -0
- package/dist/replica/identity/codec.js +789 -0
- package/dist/replica/identity/constants.d.ts +3 -0
- package/dist/replica/identity/constants.js +18 -0
- package/dist/replica/identity/implementation.d.ts +5 -0
- package/dist/replica/identity/implementation.js +5 -0
- package/dist/replica/identity/index.d.ts +3 -0
- package/dist/replica/identity/index.js +3 -0
- package/dist/replica/identity/keys.d.ts +29 -0
- package/dist/replica/identity/keys.js +173 -0
- package/dist/replica/identity.d.ts +2 -0
- package/dist/replica/identity.js +2 -0
- package/dist/replica/index-maintenance/engine.d.ts +84 -0
- package/dist/replica/index-maintenance/engine.js +677 -0
- package/dist/replica/index-maintenance/implementation.d.ts +4 -0
- package/dist/replica/index-maintenance/implementation.js +4 -0
- package/dist/replica/index-maintenance/index.d.ts +2 -0
- package/dist/replica/index-maintenance/index.js +1 -0
- package/dist/replica/index-maintenance/registry.d.ts +2 -0
- package/dist/replica/index-maintenance/registry.js +49 -0
- package/dist/replica/index-maintenance/types.d.ts +58 -0
- package/dist/replica/index-maintenance/types.js +1 -0
- package/dist/replica/index-maintenance.d.ts +3 -0
- package/dist/replica/index-maintenance.js +2 -0
- package/dist/replica/index.d.ts +17 -0
- package/dist/replica/index.js +9 -0
- package/dist/replica/materialize.d.ts +10 -0
- package/dist/replica/materialize.js +163 -0
- package/dist/replica/normalize.d.ts +27 -0
- package/dist/replica/normalize.js +298 -0
- package/dist/replica/operation-binding.d.ts +14 -0
- package/dist/replica/operation-binding.js +76 -0
- package/dist/replica/persistence/idb.d.ts +20 -0
- package/dist/replica/persistence/idb.js +193 -0
- package/dist/replica/persistence/implementation.d.ts +4 -0
- package/dist/replica/persistence/implementation.js +4 -0
- package/dist/replica/persistence/index.d.ts +2 -0
- package/dist/replica/persistence/index.js +1 -0
- package/dist/replica/persistence/state.d.ts +104 -0
- package/dist/replica/persistence/state.js +734 -0
- package/dist/replica/persistence/types.d.ts +54 -0
- package/dist/replica/persistence/types.js +1 -0
- package/dist/replica/persistence.d.ts +3 -0
- package/dist/replica/persistence.js +2 -0
- package/dist/replica/query-plan/constants.d.ts +13 -0
- package/dist/replica/query-plan/constants.js +7 -0
- package/dist/replica/query-plan/filter.d.ts +39 -0
- package/dist/replica/query-plan/filter.js +544 -0
- package/dist/replica/query-plan/index.d.ts +4 -0
- package/dist/replica/query-plan/index.js +3 -0
- package/dist/replica/query-plan/order.d.ts +11 -0
- package/dist/replica/query-plan/order.js +158 -0
- package/dist/replica/query-plan/pagination.d.ts +6 -0
- package/dist/replica/query-plan/pagination.js +90 -0
- package/dist/replica/query-plan/resolve.d.ts +14 -0
- package/dist/replica/query-plan/resolve.js +163 -0
- package/dist/replica/query-plan/types.d.ts +89 -0
- package/dist/replica/query-plan/types.js +1 -0
- package/dist/replica/query-plan/util.d.ts +13 -0
- package/dist/replica/query-plan/util.js +62 -0
- package/dist/replica/query-plan.d.ts +3 -0
- package/dist/replica/query-plan.js +2 -0
- package/dist/replica/revalidation.d.ts +9 -0
- package/dist/replica/revalidation.js +86 -0
- package/dist/replica/selection.d.ts +20 -0
- package/dist/replica/selection.js +109 -0
- package/dist/replica/types.d.ts +657 -0
- package/dist/replica/types.js +1 -0
- package/dist/request.d.ts +17 -0
- package/dist/request.js +123 -0
- package/dist/sveltekit/auth.d.ts +18 -0
- package/dist/sveltekit/auth.js +9 -0
- package/dist/sveltekit/context.d.ts +28 -0
- package/dist/sveltekit/context.js +58 -0
- package/dist/sveltekit/index.d.ts +4 -0
- package/dist/sveltekit/index.js +4 -0
- package/dist/sveltekit/replica.d.ts +145 -0
- package/dist/sveltekit/replica.js +491 -0
- package/dist/sveltekit/server-replica.d.ts +52 -0
- package/dist/sveltekit/server-replica.js +176 -0
- package/dist/sveltekit/vite.d.ts +103 -0
- package/dist/sveltekit/vite.js +878 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.js +1 -0
- package/dist/websocket.d.ts +41 -0
- package/dist/websocket.js +187 -0
- package/package.json +95 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
export type Revision = number | string | bigint;
|
|
2
|
+
export type RecordKey = string;
|
|
3
|
+
export type IndexKey = string;
|
|
4
|
+
export type CacheValue = null | boolean | number | string | readonly CacheValue[] | {
|
|
5
|
+
readonly [key: string]: CacheValue;
|
|
6
|
+
};
|
|
7
|
+
export type RecordLink = RecordKey | readonly RecordKey[] | null;
|
|
8
|
+
export type RecordWrite = {
|
|
9
|
+
key: RecordKey;
|
|
10
|
+
revision: Revision;
|
|
11
|
+
/** Stable incarnation fence. Defaults to the first live revision. */
|
|
12
|
+
incarnation?: Revision;
|
|
13
|
+
/** Omitted fields stay absent. A present `null` remains present. */
|
|
14
|
+
fields?: Readonly<Record<string, CacheValue>>;
|
|
15
|
+
/** Relationship identities are stored separately from scalar/JSON fields. */
|
|
16
|
+
links?: Readonly<Record<string, RecordLink>>;
|
|
17
|
+
};
|
|
18
|
+
export type OptimisticRecordWrite = Omit<RecordWrite, 'revision' | 'incarnation'>;
|
|
19
|
+
export type CacheIndexCoverage = {
|
|
20
|
+
readonly kind: 'complete';
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'unknown';
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'offset';
|
|
25
|
+
readonly offset: number;
|
|
26
|
+
readonly limit?: number;
|
|
27
|
+
readonly returned?: number;
|
|
28
|
+
readonly hasNext?: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'cursor';
|
|
31
|
+
readonly after?: CacheValue;
|
|
32
|
+
readonly before?: CacheValue;
|
|
33
|
+
readonly first?: number;
|
|
34
|
+
readonly last?: number;
|
|
35
|
+
readonly start?: CacheValue;
|
|
36
|
+
readonly end?: CacheValue;
|
|
37
|
+
readonly hasNext?: boolean;
|
|
38
|
+
readonly hasPrevious?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type CacheIndexMetadata = {
|
|
41
|
+
readonly parent?: RecordKey;
|
|
42
|
+
/** Parent row clock claimed by the response that produced this relationship. */
|
|
43
|
+
readonly parentRevision?: string;
|
|
44
|
+
/** Parent lifecycle fence stamped by the engine. */
|
|
45
|
+
readonly parentIncarnation?: string;
|
|
46
|
+
readonly field: string;
|
|
47
|
+
readonly arguments: Readonly<Record<string, CacheValue>>;
|
|
48
|
+
readonly coverage: CacheIndexCoverage;
|
|
49
|
+
readonly dependencies: readonly string[];
|
|
50
|
+
readonly staleReason?: string;
|
|
51
|
+
/** Distinguishes a present GraphQL `null` from an empty collection. */
|
|
52
|
+
readonly nullValue?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type IndexWrite = {
|
|
55
|
+
key: IndexKey;
|
|
56
|
+
revision: Revision;
|
|
57
|
+
records: readonly RecordKey[];
|
|
58
|
+
complete?: boolean;
|
|
59
|
+
metadata?: CacheIndexMetadata;
|
|
60
|
+
};
|
|
61
|
+
export type OptimisticIndexWrite = Omit<IndexWrite, 'revision'>;
|
|
62
|
+
export type SparseRecord = {
|
|
63
|
+
readonly key: RecordKey;
|
|
64
|
+
readonly revision: string;
|
|
65
|
+
readonly incarnation: string;
|
|
66
|
+
readonly fields: Readonly<Record<string, CacheValue>>;
|
|
67
|
+
readonly links: Readonly<Record<string, RecordLink>>;
|
|
68
|
+
};
|
|
69
|
+
export type CacheIndex = {
|
|
70
|
+
readonly key: IndexKey;
|
|
71
|
+
readonly revision: string;
|
|
72
|
+
readonly staleRevision?: string;
|
|
73
|
+
readonly records: readonly RecordKey[];
|
|
74
|
+
readonly complete: boolean;
|
|
75
|
+
readonly metadata?: CacheIndexMetadata;
|
|
76
|
+
};
|
|
77
|
+
export type CachePresence<T> = {
|
|
78
|
+
readonly present: false;
|
|
79
|
+
} | {
|
|
80
|
+
readonly present: true;
|
|
81
|
+
readonly value: T;
|
|
82
|
+
};
|
|
83
|
+
export type SparseRecordMeta = {
|
|
84
|
+
readonly key: RecordKey;
|
|
85
|
+
readonly incarnation: string;
|
|
86
|
+
};
|
|
87
|
+
export type BaseRecordClock = {
|
|
88
|
+
readonly revision: string;
|
|
89
|
+
readonly incarnation: string;
|
|
90
|
+
readonly tombstoned: boolean;
|
|
91
|
+
};
|
|
92
|
+
/** Raised when one source revision claims two different values. */
|
|
93
|
+
export interface CacheReader {
|
|
94
|
+
recordMeta(key: RecordKey): SparseRecordMeta | undefined;
|
|
95
|
+
field(key: RecordKey, name: string): CachePresence<CacheValue>;
|
|
96
|
+
link(key: RecordKey, name: string): CachePresence<RecordLink>;
|
|
97
|
+
record(key: RecordKey): SparseRecord | undefined;
|
|
98
|
+
index(key: IndexKey): CacheIndex | undefined;
|
|
99
|
+
}
|
|
100
|
+
export interface BaseCacheWriter {
|
|
101
|
+
recordClock(key: RecordKey): BaseRecordClock | undefined;
|
|
102
|
+
writeRecord(write: RecordWrite): boolean;
|
|
103
|
+
tombstoneRecord(key: RecordKey, revision: Revision, incarnation?: Revision): boolean;
|
|
104
|
+
/** Drop uncertified fields while preserving higher protocol clocks externally. */
|
|
105
|
+
discardRecord(key: RecordKey): boolean;
|
|
106
|
+
writeIndex(write: IndexWrite): boolean;
|
|
107
|
+
markIndexStale(key: IndexKey, reason: string, revision?: Revision): boolean;
|
|
108
|
+
deleteIndex(key: IndexKey, revision: Revision): boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface OptimisticCacheWriter {
|
|
111
|
+
writeRecord(write: OptimisticRecordWrite): void;
|
|
112
|
+
tombstoneRecord(key: RecordKey): void;
|
|
113
|
+
writeIndex(write: OptimisticIndexWrite): void;
|
|
114
|
+
deleteIndex(key: IndexKey): void;
|
|
115
|
+
}
|
|
116
|
+
export type CacheSelector<T> = (reader: CacheReader) => T;
|
|
117
|
+
export type CacheListener<T> = (value: T, previous: T | undefined) => void;
|
|
118
|
+
export type WatchOptions = {
|
|
119
|
+
immediate?: boolean;
|
|
120
|
+
};
|
|
121
|
+
export type CacheEngineOptions = {
|
|
122
|
+
/** Observer failures are reported after every eligible watcher was delivered. */
|
|
123
|
+
onWatcherError?: (error: AggregateError) => void;
|
|
124
|
+
};
|
|
125
|
+
export type OptimisticLayerState = 'optimistic' | 'accepted';
|
|
126
|
+
export type CacheEngineSnapshot = {
|
|
127
|
+
readonly version: 1;
|
|
128
|
+
readonly records: readonly {
|
|
129
|
+
readonly key: RecordKey;
|
|
130
|
+
readonly revision: string;
|
|
131
|
+
readonly incarnation?: string;
|
|
132
|
+
readonly tombstoneRevision?: string;
|
|
133
|
+
readonly fields: Readonly<Record<string, {
|
|
134
|
+
readonly revision: string;
|
|
135
|
+
readonly value: CacheValue;
|
|
136
|
+
}>>;
|
|
137
|
+
readonly links: Readonly<Record<string, {
|
|
138
|
+
readonly revision: string;
|
|
139
|
+
readonly value: RecordLink;
|
|
140
|
+
}>>;
|
|
141
|
+
}[];
|
|
142
|
+
readonly indexes: readonly {
|
|
143
|
+
readonly key: IndexKey;
|
|
144
|
+
readonly revision: string;
|
|
145
|
+
readonly staleRevision?: string;
|
|
146
|
+
readonly records: readonly RecordKey[];
|
|
147
|
+
readonly complete: boolean;
|
|
148
|
+
readonly deleted: boolean;
|
|
149
|
+
readonly metadata?: CacheIndexMetadata;
|
|
150
|
+
}[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Opaque, detached JSON context owned by the replica and carried with one
|
|
154
|
+
* optimistic layer. The cache engine never interprets it.
|
|
155
|
+
*/
|
|
156
|
+
export type OptimisticLayerContext = CacheValue;
|
|
157
|
+
export type OptimisticLayerView = {
|
|
158
|
+
readonly id: string;
|
|
159
|
+
readonly sequence: number;
|
|
160
|
+
readonly state: OptimisticLayerState;
|
|
161
|
+
readonly context?: OptimisticLayerContext;
|
|
162
|
+
};
|
|
163
|
+
export type DerivedIndexMutation = {
|
|
164
|
+
readonly kind: 'write';
|
|
165
|
+
readonly write: OptimisticIndexWrite;
|
|
166
|
+
} | {
|
|
167
|
+
readonly kind: 'stale';
|
|
168
|
+
readonly key: IndexKey;
|
|
169
|
+
readonly reason: string;
|
|
170
|
+
} | {
|
|
171
|
+
readonly kind: 'delete';
|
|
172
|
+
readonly key: IndexKey;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Rebuild the complete derived-index overlay from confirmed state and the
|
|
176
|
+
* ordered semantic contexts of every surviving optimistic layer.
|
|
177
|
+
*/
|
|
178
|
+
export type DerivedIndexReconciler = (confirmed: CacheEngineSnapshot, layers: readonly OptimisticLayerView[]) => readonly DerivedIndexMutation[];
|
|
179
|
+
export interface CacheEngine {
|
|
180
|
+
read<T>(selector: CacheSelector<T>): T;
|
|
181
|
+
/**
|
|
182
|
+
* Read only the authoritative base graph, excluding optimistic records and
|
|
183
|
+
* their derived-index overlay.
|
|
184
|
+
*/
|
|
185
|
+
readConfirmed<T>(selector: CacheSelector<T>): T;
|
|
186
|
+
/**
|
|
187
|
+
* Return the authoritative write fence for requested base indexes.
|
|
188
|
+
* Deleted sentinels remain visible here even though CacheReader hides them.
|
|
189
|
+
*/
|
|
190
|
+
confirmedIndexFences(keys: readonly IndexKey[]): ReadonlyMap<IndexKey, string>;
|
|
191
|
+
watch<T>(selector: CacheSelector<T>, listener: CacheListener<T>, options?: WatchOptions): () => void;
|
|
192
|
+
batch<T>(update: (writer: BaseCacheWriter) => T): T;
|
|
193
|
+
createOptimisticLayer(id: string, update: (writer: OptimisticCacheWriter) => void, context?: OptimisticLayerContext): void;
|
|
194
|
+
setDerivedIndexReconciler(reconciler: DerivedIndexReconciler | undefined): void;
|
|
195
|
+
markOptimisticLayerAccepted(id: string): boolean;
|
|
196
|
+
confirmOptimisticLayer<T>(id: string, update: (writer: BaseCacheWriter) => T): T;
|
|
197
|
+
confirmOptimisticLayers<T>(ids: readonly string[], update: (writer: BaseCacheWriter) => T): T;
|
|
198
|
+
rejectOptimisticLayer(id: string): boolean;
|
|
199
|
+
optimisticLayerState(id: string): OptimisticLayerState | undefined;
|
|
200
|
+
extract(): CacheEngineSnapshot;
|
|
201
|
+
restore(snapshot: CacheEngineSnapshot): void;
|
|
202
|
+
/**
|
|
203
|
+
* Replace only confirmed base state while preserving local optimistic layers,
|
|
204
|
+
* their acceptance state, and causal sequencing floors.
|
|
205
|
+
*/
|
|
206
|
+
restoreConfirmed(snapshot: CacheEngineSnapshot): void;
|
|
207
|
+
/**
|
|
208
|
+
* Drop incomparable/reset base indexes without assigning them a fabricated
|
|
209
|
+
* revision. Pending optimistic overlays remain layered above the new gap.
|
|
210
|
+
*/
|
|
211
|
+
discardIndexes(keys: readonly IndexKey[]): void;
|
|
212
|
+
retain(key: RecordKey): void;
|
|
213
|
+
release(key: RecordKey): void;
|
|
214
|
+
gc(): readonly RecordKey[];
|
|
215
|
+
}
|
|
216
|
+
export type StoredField<T> = {
|
|
217
|
+
revision: bigint;
|
|
218
|
+
value: T;
|
|
219
|
+
};
|
|
220
|
+
export type StoredRecord = {
|
|
221
|
+
revision: bigint;
|
|
222
|
+
incarnation: bigint;
|
|
223
|
+
tombstoneRevision?: bigint;
|
|
224
|
+
fields: Map<string, StoredField<CacheValue>>;
|
|
225
|
+
links: Map<string, StoredField<RecordLink>>;
|
|
226
|
+
};
|
|
227
|
+
export type StoredIndex = {
|
|
228
|
+
revision: bigint;
|
|
229
|
+
staleRevision?: bigint;
|
|
230
|
+
records: RecordKey[];
|
|
231
|
+
complete: boolean;
|
|
232
|
+
deleted: boolean;
|
|
233
|
+
metadata?: CacheIndexMetadata;
|
|
234
|
+
};
|
|
235
|
+
export type OverlayOperation = {
|
|
236
|
+
kind: 'write-record';
|
|
237
|
+
write: OptimisticRecordWrite;
|
|
238
|
+
} | {
|
|
239
|
+
kind: 'tombstone-record';
|
|
240
|
+
key: RecordKey;
|
|
241
|
+
} | {
|
|
242
|
+
kind: 'write-index';
|
|
243
|
+
write: OptimisticIndexWrite;
|
|
244
|
+
} | {
|
|
245
|
+
kind: 'delete-index';
|
|
246
|
+
key: IndexKey;
|
|
247
|
+
};
|
|
248
|
+
export type OptimisticLayer = {
|
|
249
|
+
id: string;
|
|
250
|
+
sequence: number;
|
|
251
|
+
state: OptimisticLayerState;
|
|
252
|
+
operations: OverlayOperation[];
|
|
253
|
+
context?: OptimisticLayerContext;
|
|
254
|
+
};
|
|
255
|
+
export type DerivedIndexOperation = {
|
|
256
|
+
kind: 'write-index';
|
|
257
|
+
write: OptimisticIndexWrite;
|
|
258
|
+
} | {
|
|
259
|
+
kind: 'mark-index-stale';
|
|
260
|
+
key: IndexKey;
|
|
261
|
+
reason: string;
|
|
262
|
+
} | {
|
|
263
|
+
kind: 'delete-index';
|
|
264
|
+
key: IndexKey;
|
|
265
|
+
};
|
|
266
|
+
export type VisibleRecord = {
|
|
267
|
+
revision: bigint;
|
|
268
|
+
incarnation: bigint;
|
|
269
|
+
tombstoned: boolean;
|
|
270
|
+
fields: Map<string, CacheValue>;
|
|
271
|
+
links: Map<string, RecordLink>;
|
|
272
|
+
};
|
|
273
|
+
export type VisibleIndex = {
|
|
274
|
+
revision: bigint;
|
|
275
|
+
staleRevision?: bigint;
|
|
276
|
+
records: RecordKey[];
|
|
277
|
+
complete: boolean;
|
|
278
|
+
deleted: boolean;
|
|
279
|
+
metadata?: CacheIndexMetadata;
|
|
280
|
+
};
|
|
281
|
+
export type MaterializedCacheGraph = {
|
|
282
|
+
records: Map<RecordKey, VisibleRecord>;
|
|
283
|
+
indexes: Map<IndexKey, VisibleIndex>;
|
|
284
|
+
};
|
|
285
|
+
export type Watcher<T = unknown> = {
|
|
286
|
+
selector: CacheSelector<T>;
|
|
287
|
+
listener: CacheListener<T>;
|
|
288
|
+
value: T;
|
|
289
|
+
dependencies: Set<string>;
|
|
290
|
+
};
|
|
291
|
+
export type EngineBackup = {
|
|
292
|
+
records: Map<RecordKey, StoredRecord>;
|
|
293
|
+
indexes: Map<IndexKey, StoredIndex>;
|
|
294
|
+
layers: OptimisticLayer[];
|
|
295
|
+
derivedIndexOperations: DerivedIndexOperation[];
|
|
296
|
+
confirmedFloors: Map<string, number>;
|
|
297
|
+
retained: Map<RecordKey, number>;
|
|
298
|
+
nextLayerSequence: number;
|
|
299
|
+
changedDependencies: Set<string>;
|
|
300
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Private cache engine; implementation lives in ./cache-engine/. */
|
|
2
|
+
export { CacheRevisionConflictError, cacheIndexKey, createCacheEngine } from './cache-engine/index.js';
|
|
3
|
+
export type { BaseCacheWriter, BaseRecordClock, CacheEngine, CacheEngineOptions, CacheEngineSnapshot, CacheIndex, CacheIndexCoverage, CacheIndexMetadata, CacheListener, CachePresence, CacheReader, CacheSelector, CacheValue, DerivedIndexMutation, DerivedIndexReconciler, IndexKey, IndexWrite, OptimisticCacheWriter, OptimisticIndexWrite, OptimisticLayerContext, OptimisticLayerState, OptimisticLayerView, OptimisticRecordWrite, RecordKey, RecordLink, RecordWrite, Revision, SparseRecord, SparseRecordMeta, WatchOptions } from './cache-engine/index.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Structural equality for JSON-like values (objects, arrays, primitives). */
|
|
2
|
+
export function deepEqual(left, right) {
|
|
3
|
+
if (Object.is(left, right))
|
|
4
|
+
return true;
|
|
5
|
+
if (typeof left !== typeof right || left === null || right === null)
|
|
6
|
+
return false;
|
|
7
|
+
if (typeof left !== 'object' || typeof right !== 'object')
|
|
8
|
+
return false;
|
|
9
|
+
if (Array.isArray(left) || Array.isArray(right)) {
|
|
10
|
+
if (!Array.isArray(left) ||
|
|
11
|
+
!Array.isArray(right) ||
|
|
12
|
+
left.length !== right.length) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return left.every((entry, index) => deepEqual(entry, right[index]));
|
|
16
|
+
}
|
|
17
|
+
const leftRecord = left;
|
|
18
|
+
const rightRecord = right;
|
|
19
|
+
const leftKeys = Object.keys(leftRecord);
|
|
20
|
+
const rightKeys = Object.keys(rightRecord);
|
|
21
|
+
return (leftKeys.length === rightKeys.length &&
|
|
22
|
+
leftKeys.every((key) => Object.prototype.hasOwnProperty.call(rightRecord, key) &&
|
|
23
|
+
deepEqual(leftRecord[key], rightRecord[key])));
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Build an immutable plain object from key/value pairs. */
|
|
2
|
+
export function freezeRecord(entries) {
|
|
3
|
+
const result = {};
|
|
4
|
+
for (const [key, value] of entries) {
|
|
5
|
+
Object.defineProperty(result, key, {
|
|
6
|
+
value,
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: false,
|
|
9
|
+
writable: false
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return Object.freeze(result);
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { assertName } from './assert-name.js';
|
|
2
|
+
export { compareCodeUnits } from './compare-code-units.js';
|
|
3
|
+
export { deepEqual } from './deep-equal.js';
|
|
4
|
+
export { freezeRecord } from './freeze-record.js';
|
|
5
|
+
export { isPlainRecord } from './is-plain-record.js';
|
|
6
|
+
export { reportSafely, reportUnhandledError } from './report.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { assertName } from './assert-name.js';
|
|
2
|
+
export { compareCodeUnits } from './compare-code-units.js';
|
|
3
|
+
export { deepEqual } from './deep-equal.js';
|
|
4
|
+
export { freezeRecord } from './freeze-record.js';
|
|
5
|
+
export { isPlainRecord } from './is-plain-record.js';
|
|
6
|
+
export { reportSafely, reportUnhandledError } from './report.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** True for non-null objects that are not arrays (own enumerable bag). */
|
|
2
|
+
export function isPlainRecord(value) {
|
|
3
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const proto = Object.getPrototypeOf(value);
|
|
7
|
+
return proto === Object.prototype || proto === null;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deliver an AggregateError to a user reporter without letting the reporter
|
|
3
|
+
* change success semantics of the surrounding operation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function reportSafely(reporter: (error: AggregateError) => void, error: AggregateError, failureMessage?: string): void;
|
|
6
|
+
/** Best-effort delivery of an unhandled AggregateError to the host. */
|
|
7
|
+
export declare function reportUnhandledError(error: AggregateError): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deliver an AggregateError to a user reporter without letting the reporter
|
|
3
|
+
* change success semantics of the surrounding operation.
|
|
4
|
+
*/
|
|
5
|
+
export function reportSafely(reporter, error, failureMessage = 'error reporter failed') {
|
|
6
|
+
try {
|
|
7
|
+
reporter(error);
|
|
8
|
+
}
|
|
9
|
+
catch (reporterError) {
|
|
10
|
+
queueMicrotask(() => {
|
|
11
|
+
throw new AggregateError([error, reporterError], failureMessage);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Best-effort delivery of an unhandled AggregateError to the host. */
|
|
16
|
+
export function reportUnhandledError(error) {
|
|
17
|
+
const reportError = globalThis
|
|
18
|
+
.reportError;
|
|
19
|
+
if (typeof reportError === 'function') {
|
|
20
|
+
reportError(error);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
queueMicrotask(() => {
|
|
24
|
+
throw error;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Versioned framework metadata carried in GraphQL's top-level
|
|
3
|
+
* `extensions.distributed` response envelope.
|
|
4
|
+
*
|
|
5
|
+
* Domain result objects never contain these values. Hidden identities and
|
|
6
|
+
* positions remain opaque strings: the JavaScript client compares or returns
|
|
7
|
+
* them, but never parses them as numbers or reconstructs server scopes.
|
|
8
|
+
*/
|
|
9
|
+
/** The only Distributed GraphQL protocol version understood by this package. */
|
|
10
|
+
export declare const DISTRIBUTED_PROTOCOL_VERSION: 1;
|
|
11
|
+
declare const opaqueDistributedString: unique symbol;
|
|
12
|
+
declare const distributedDecimalString: unique symbol;
|
|
13
|
+
/** Server-owned identity/token whose contents must not be interpreted by clients. */
|
|
14
|
+
export type DistributedOpaqueString = string & {
|
|
15
|
+
readonly [opaqueDistributedString]: true;
|
|
16
|
+
};
|
|
17
|
+
/** Canonical unsigned u64 decimal carried without JavaScript numeric coercion. */
|
|
18
|
+
export type DistributedDecimalString = string & {
|
|
19
|
+
readonly [distributedDecimalString]: true;
|
|
20
|
+
};
|
|
21
|
+
export type DistributedCommandState = 'in_progress' | 'accepted' | 'accepted_pending_projection' | 'projected' | 'rejected' | 'projection_failed' | 'expired' | 'unknown';
|
|
22
|
+
export type DistributedCommandConsistency = 'accepted' | 'fact' | 'projected';
|
|
23
|
+
/** Closed wire codecs for server-derived, client-visible trusted presets. */
|
|
24
|
+
export type DistributedTrustedPresetCodec = 'string' | 'string_unvalidated_timestamp' | 'base64' | 'boolean' | 'int32' | 'float64' | 'json_number_precision_limited' | 'json';
|
|
25
|
+
/** JSON value accepted by the Distributed protocol parser. */
|
|
26
|
+
export type DistributedProtocolValue = null | boolean | number | string | readonly DistributedProtocolValue[] | {
|
|
27
|
+
readonly [key: string]: DistributedProtocolValue;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* One server-derived value valid only under its containing envelope's exact
|
|
31
|
+
* authoritative cache scope.
|
|
32
|
+
*/
|
|
33
|
+
export type DistributedTrustedPreset = Readonly<{
|
|
34
|
+
name: string;
|
|
35
|
+
codec: DistributedTrustedPresetCodec;
|
|
36
|
+
value: DistributedProtocolValue;
|
|
37
|
+
}>;
|
|
38
|
+
/** One finite, server-resolved projection obligation for a command. */
|
|
39
|
+
export type DistributedProjectionExpectation = Readonly<Record<string, unknown> & {
|
|
40
|
+
projection: string;
|
|
41
|
+
model: string;
|
|
42
|
+
scopeToken: DistributedOpaqueString;
|
|
43
|
+
}>;
|
|
44
|
+
/** Comparable record evidence within one exact opaque record scope. */
|
|
45
|
+
export type DistributedRecordRevision = Readonly<Record<string, unknown> & {
|
|
46
|
+
path?: readonly string[];
|
|
47
|
+
model: string;
|
|
48
|
+
scopeToken: DistributedOpaqueString;
|
|
49
|
+
incarnation: DistributedDecimalString;
|
|
50
|
+
revision: DistributedDecimalString;
|
|
51
|
+
tombstone: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
/** Exact observation of one command causation in one projection obligation. */
|
|
54
|
+
export type DistributedProjectionObservation = Readonly<Record<string, unknown> & {
|
|
55
|
+
causationId: DistributedOpaqueString;
|
|
56
|
+
projection: string;
|
|
57
|
+
model: string;
|
|
58
|
+
scopeToken: DistributedOpaqueString;
|
|
59
|
+
}>;
|
|
60
|
+
/** Opaque resumable position for one named projection scope. */
|
|
61
|
+
export type DistributedLiveCursor = Readonly<Record<string, unknown> & {
|
|
62
|
+
projection: string;
|
|
63
|
+
position: DistributedDecimalString;
|
|
64
|
+
token: DistributedOpaqueString;
|
|
65
|
+
}>;
|
|
66
|
+
/** Comparable checkpoint for one exact query-index projection member. */
|
|
67
|
+
export type DistributedIndexRevision = Readonly<Record<string, unknown> & {
|
|
68
|
+
projection: string;
|
|
69
|
+
scopeToken: DistributedOpaqueString;
|
|
70
|
+
position: DistributedDecimalString;
|
|
71
|
+
resume?: DistributedLiveCursor;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Record and causal-index evidence for one exact operation instance.
|
|
75
|
+
*
|
|
76
|
+
* The GraphQL payload itself is the authoritative query snapshot. These flags
|
|
77
|
+
* describe whether the server could additionally prove every normalized record
|
|
78
|
+
* clock and expose a safely comparable projection vector. Row-filtered
|
|
79
|
+
* authorization commonly makes `indexesComparable` false without making the
|
|
80
|
+
* authorized payload partial.
|
|
81
|
+
*/
|
|
82
|
+
export type DistributedQuerySnapshot = Readonly<Record<string, unknown> & {
|
|
83
|
+
scopeToken: DistributedOpaqueString;
|
|
84
|
+
recordsComplete: boolean;
|
|
85
|
+
indexesComparable: boolean;
|
|
86
|
+
records: readonly DistributedRecordRevision[];
|
|
87
|
+
indexes: readonly DistributedIndexRevision[];
|
|
88
|
+
observations: readonly DistributedProjectionObservation[];
|
|
89
|
+
}>;
|
|
90
|
+
/** Per-frame decision about live support, reset, and resumable cursors. */
|
|
91
|
+
export type DistributedLiveMetadata = Readonly<Record<string, unknown> & {
|
|
92
|
+
supported: boolean;
|
|
93
|
+
reset: boolean;
|
|
94
|
+
cursors: readonly DistributedLiveCursor[];
|
|
95
|
+
}>;
|
|
96
|
+
/** Private GraphQL request extension consumed by generated live operations. */
|
|
97
|
+
export type DistributedLiveResumeExtensions = Readonly<{
|
|
98
|
+
distributed: Readonly<{
|
|
99
|
+
resume: Readonly<{
|
|
100
|
+
cursors: readonly DistributedLiveCursor[];
|
|
101
|
+
}>;
|
|
102
|
+
}>;
|
|
103
|
+
}>;
|
|
104
|
+
/** Durable receipt/status metadata for one idempotent command identity. */
|
|
105
|
+
export type DistributedCommandMetadata = Readonly<Record<string, unknown> & {
|
|
106
|
+
commandId: DistributedOpaqueString;
|
|
107
|
+
causationId: DistributedOpaqueString;
|
|
108
|
+
state: DistributedCommandState;
|
|
109
|
+
consistency: DistributedCommandConsistency;
|
|
110
|
+
expects: readonly DistributedProjectionExpectation[];
|
|
111
|
+
/** Defaults to an empty array when omitted by the compact wire format. */
|
|
112
|
+
observations: readonly DistributedProjectionObservation[];
|
|
113
|
+
/** Defaults to an empty array when omitted by the compact wire format. */
|
|
114
|
+
records: readonly DistributedRecordRevision[];
|
|
115
|
+
}>;
|
|
116
|
+
/** Canonical contents of top-level `extensions.distributed`. */
|
|
117
|
+
export type DistributedProtocolEnvelope = Readonly<Record<string, unknown> & {
|
|
118
|
+
protocolVersion: typeof DISTRIBUTED_PROTOCOL_VERSION;
|
|
119
|
+
schemaHash: string;
|
|
120
|
+
cacheScope: DistributedOpaqueString;
|
|
121
|
+
operation?: string;
|
|
122
|
+
command?: DistributedCommandMetadata;
|
|
123
|
+
snapshot?: DistributedQuerySnapshot;
|
|
124
|
+
live?: DistributedLiveMetadata;
|
|
125
|
+
/** Defaults to an empty array when omitted by the compact wire format. */
|
|
126
|
+
trustedPresets: readonly DistributedTrustedPreset[];
|
|
127
|
+
}>;
|
|
128
|
+
/** GraphQL top-level extensions with a validated Distributed envelope. */
|
|
129
|
+
export type GraphqlResponseExtensions = Readonly<Record<string, unknown> & {
|
|
130
|
+
distributed?: DistributedProtocolEnvelope;
|
|
131
|
+
}>;
|
|
132
|
+
export type DistributedProtocolErrorCode = 'DISTRIBUTED_PROTOCOL_INVALID' | 'DISTRIBUTED_PROTOCOL_VERSION_UNSUPPORTED';
|
|
133
|
+
/** Safe parse failure that reports structure, never hidden server values. */
|
|
134
|
+
export declare class DistributedProtocolError extends Error {
|
|
135
|
+
readonly code: DistributedProtocolErrorCode;
|
|
136
|
+
readonly path: string;
|
|
137
|
+
constructor(code: DistributedProtocolErrorCode, path: string);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Parse GraphQL's optional top-level `extensions` object.
|
|
141
|
+
*
|
|
142
|
+
* Non-Distributed extension keys are preserved. When `distributed` is present,
|
|
143
|
+
* its required version/scope/schema fields and known receipt/evidence fields are
|
|
144
|
+
* validated. A malformed or incompatible envelope throws
|
|
145
|
+
* {@link DistributedProtocolError}; transports convert that into a fail-closed
|
|
146
|
+
* GraphQL result/error rather than exposing the accompanying data as trusted.
|
|
147
|
+
*/
|
|
148
|
+
export declare function parseGraphqlResponseExtensions(value: unknown): GraphqlResponseExtensions | undefined;
|
|
149
|
+
/** Parse one `extensions.distributed` value independently of a transport. */
|
|
150
|
+
export declare function parseDistributedProtocolEnvelope(value: unknown): DistributedProtocolEnvelope;
|
|
151
|
+
/**
|
|
152
|
+
* Parse and deeply freeze one scope-wide trusted-preset value inventory.
|
|
153
|
+
*
|
|
154
|
+
* This is exported for the framework-neutral replica's internal command seam.
|
|
155
|
+
* Applications receive the same values through
|
|
156
|
+
* {@link parseDistributedProtocolEnvelope}; they must never supply this
|
|
157
|
+
* inventory as command authority.
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function parseDistributedTrustedPresetInventory(value: unknown, path?: string): readonly DistributedTrustedPreset[];
|
|
162
|
+
/**
|
|
163
|
+
* Build the private request extension for a generated live resume.
|
|
164
|
+
*
|
|
165
|
+
* The server remains authoritative and verifies every token. This client-side
|
|
166
|
+
* check only prevents malformed, duplicate, or unbounded state from leaving
|
|
167
|
+
* the replica.
|
|
168
|
+
*
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
export declare function distributedLiveResumeExtensions(value: readonly DistributedLiveCursor[]): DistributedLiveResumeExtensions;
|
|
172
|
+
/** @internal */
|
|
173
|
+
export declare function isDistributedTrustedPresetCodec(value: unknown): value is DistributedTrustedPresetCodec;
|
|
174
|
+
/**
|
|
175
|
+
* Compare two already-validated protocol decimals without converting either
|
|
176
|
+
* through JavaScript's numeric types.
|
|
177
|
+
*/
|
|
178
|
+
export declare function compareDistributedDecimal(left: DistributedDecimalString, right: DistributedDecimalString): -1 | 0 | 1;
|
|
179
|
+
export {};
|