@elaraai/e3-ui-components 1.0.79 → 1.0.80
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 +1 -1
- package/dist/components/DatasetPreview.d.ts.map +1 -1
- package/dist/components/PagedDatasetPreview.d.ts.map +1 -1
- package/dist/components/TaskPreview.d.ts.map +1 -1
- package/dist/components/UITaskPreview.d.ts +7 -3
- package/dist/components/UITaskPreview.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useDatasetValue.d.ts +13 -2
- package/dist/hooks/useDatasetValue.d.ts.map +1 -1
- package/dist/hooks/useTaskDetails.d.ts +1 -5
- package/dist/hooks/useTaskDetails.d.ts.map +1 -1
- package/dist/hooks/workspaces.d.ts +16 -3
- package/dist/hooks/workspaces.d.ts.map +1 -1
- package/dist/index.cjs +740 -319
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +745 -324
- package/dist/index.js.map +1 -1
- package/dist/platform/bind-runtime.d.ts +14 -5
- package/dist/platform/bind-runtime.d.ts.map +1 -1
- package/dist/platform/dataset-hooks.d.ts +12 -4
- package/dist/platform/dataset-hooks.d.ts.map +1 -1
- package/dist/platform/dataset-store.d.ts +47 -11
- package/dist/platform/dataset-store.d.ts.map +1 -1
- package/dist/platform/func-runtime.d.ts +14 -4
- package/dist/platform/func-runtime.d.ts.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/paged-runtime.d.ts +183 -49
- package/dist/platform/paged-runtime.d.ts.map +1 -1
- package/dist/platform/record-runtime.d.ts +14 -4
- package/dist/platform/record-runtime.d.ts.map +1 -1
- package/dist/platform/staged-store.d.ts +19 -2
- package/dist/platform/staged-store.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -69,8 +69,13 @@ export declare class BindRuntime {
|
|
|
69
69
|
* leftover queued writes that captured the old cache. Same-cache
|
|
70
70
|
* re-init (Strict Mode double-invoke; HMR) preserves the queue. */
|
|
71
71
|
initializeCache(cache: ReactiveDatasetCacheInterface): void;
|
|
72
|
-
/**
|
|
73
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Clear the active cache and drop any queued writes.
|
|
74
|
+
*
|
|
75
|
+
* @param cache - Clear only while this is the active cache, so a provider
|
|
76
|
+
* tearing down after another installed its own leaves that one in place
|
|
77
|
+
*/
|
|
78
|
+
clearCache(cache?: ReactiveDatasetCacheInterface): void;
|
|
74
79
|
/** Subscribe to write-queue errors. Returns an unsubscribe fn. */
|
|
75
80
|
onWriteError(cb: (error: unknown) => void): () => void;
|
|
76
81
|
/** Fan a write/persistence error out to every registered listener. */
|
|
@@ -136,9 +141,13 @@ export declare const defaultBindRuntime: BindRuntime;
|
|
|
136
141
|
export declare function getReactiveDatasetCache(): ReactiveDatasetCacheInterface;
|
|
137
142
|
/** Set the active cache singleton — called by the React provider on mount. */
|
|
138
143
|
export declare function initializeReactiveDatasetCache(cache: ReactiveDatasetCacheInterface): void;
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Clear the active cache singleton — called on unmount or test teardown. Also
|
|
146
|
+
* drops any queued writes that captured the old cache.
|
|
147
|
+
*
|
|
148
|
+
* @param cache - Clear only while this is the active cache
|
|
149
|
+
*/
|
|
150
|
+
export declare function clearReactiveDatasetCache(cache?: ReactiveDatasetCacheInterface): void;
|
|
142
151
|
export declare function enableBindingTracking(): Set<string>;
|
|
143
152
|
export declare function disableBindingTracking(): string[];
|
|
144
153
|
export declare function isBindingTracking(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind-runtime.d.ts","sourceRoot":"","sources":["../../src/platform/bind-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAOH,KAAK,aAAa,EAclB,KAAK,WAAW,EAChB,UAAU,EACb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YAAY,GAAG,SAAS,CAEjG;AACD,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAE7D;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAErE;AACD,8DAA8D;AAC9D,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAElD;AACD,kDAAkD;AAClD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;6EAC6E;AAC7E,eAAO,MAAM,YAAY,EAAE,gBAAgB,EAG1C,CAAC;AAEF;;;;;wDAKwD;AACxD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAMnF;AAED,wBAAsB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAErG;AACD,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD"}
|
|
@@ -14,9 +14,17 @@ export interface ReactiveDatasetProviderProps {
|
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
16
|
* Reads server identity from the surrounding `<E3Provider>` to build a
|
|
17
|
-
* default {@link DatasetApi} adapter
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* default {@link DatasetApi} adapter and a workspace-scoped cache, and installs
|
|
18
|
+
* them — with the `Func.bind`, `Data.bindPaged` and `Record.bind` adapters — in
|
|
19
|
+
* the process-global runtimes the East-side bindings resolve through. The
|
|
20
|
+
* cache's scheduler uses `queueMicrotask`, so cache notifications never fire
|
|
21
|
+
* during a React render pass.
|
|
22
|
+
*
|
|
23
|
+
* The children render once the provider's cache is installed, so a
|
|
24
|
+
* `Data.bind`'s first read finds it; they render again from nothing when the
|
|
25
|
+
* server identity changes. A provider tears down only what it installed, so
|
|
26
|
+
* one replacing another — re-keyed to a new workspace — or StrictMode's
|
|
27
|
+
* mount → unmount → mount never leaves the runtimes empty.
|
|
20
28
|
*
|
|
21
29
|
* Must be mounted inside an `<E3Provider>` (which also owns the
|
|
22
30
|
* `<QueryClientProvider>` wrap that this package's TanStack hooks
|
|
@@ -31,7 +39,7 @@ export interface ReactiveDatasetProviderProps {
|
|
|
31
39
|
* </E3Provider>
|
|
32
40
|
* ```
|
|
33
41
|
*/
|
|
34
|
-
export declare function ReactiveDatasetProvider({ children, }: ReactiveDatasetProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function ReactiveDatasetProvider({ children, }: ReactiveDatasetProviderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
43
|
/**
|
|
36
44
|
* Hook to access the ReactiveDatasetCache from context.
|
|
37
45
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-hooks.d.ts","sourceRoot":"","sources":["../../src/platform/dataset-hooks.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EASH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAEH,KAAK,6BAA6B,EAGrC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"dataset-hooks.d.ts","sourceRoot":"","sources":["../../src/platform/dataset-hooks.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EASH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAEH,KAAK,6BAA6B,EAGrC,MAAM,oBAAoB,CAAC;AA8B5B;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IACzC,QAAQ,EAAE,SAAS,CAAC;CACvB;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,uBA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;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,IAAI,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,UAAU,KAChB,OAAO,CAAC,IAAI,CAAC,CAOjB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAchF"}
|
|
@@ -99,22 +99,48 @@ export interface ReactiveDatasetCacheInterface {
|
|
|
99
99
|
preload(workspace: string, path: TreePath): Promise<void>;
|
|
100
100
|
/** List fields at a path */
|
|
101
101
|
list(workspace: string, path: TreePath): Promise<string[]>;
|
|
102
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Poll a dataset, for one watcher. Each call is paired with one
|
|
104
|
+
* {@link clearRefetchInterval}: a path two views watch stays polled until
|
|
105
|
+
* both have cleared it.
|
|
106
|
+
*/
|
|
103
107
|
setRefetchInterval(workspace: string, path: TreePath, intervalMs: number): void;
|
|
104
108
|
/**
|
|
105
|
-
* Stop polling a dataset
|
|
106
|
-
* {@link setRefetchInterval}. The
|
|
107
|
-
*
|
|
108
|
-
* session accumulates watched paths (and
|
|
109
|
+
* Stop polling a dataset for one watcher registered with
|
|
110
|
+
* {@link setRefetchInterval}. The path stops being polled once its last
|
|
111
|
+
* watcher clears it, and the workspace's shared poller once its last path
|
|
112
|
+
* goes — without this, a long-lived session accumulates watched paths (and
|
|
113
|
+
* network traffic) forever.
|
|
109
114
|
*/
|
|
110
115
|
clearRefetchInterval(workspace: string, path: TreePath): void;
|
|
116
|
+
/**
|
|
117
|
+
* Follow a dataset's content hash without fetching its content — what a
|
|
118
|
+
* paged source follows its dataset by.
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
* The path joins its workspace's status poll, started at `intervalMs` when
|
|
122
|
+
* nothing else polls the workspace. `onHash` is called with the hash a
|
|
123
|
+
* poll reports whenever it differs from the last this watch was told
|
|
124
|
+
* (`null` while the dataset has no value), the first poll after the watch
|
|
125
|
+
* starts included. The dataset's content is never fetched.
|
|
126
|
+
*
|
|
127
|
+
* @param workspace - The workspace
|
|
128
|
+
* @param path - The dataset's path
|
|
129
|
+
* @param onHash - Called with each new hash
|
|
130
|
+
* @param intervalMs - The poll's interval, when this watch starts it
|
|
131
|
+
* @returns A function that stops the watch; the poller stops once nothing
|
|
132
|
+
* watches the workspace
|
|
133
|
+
*/
|
|
134
|
+
watchHash(workspace: string, path: TreePath, onHash: (hash: string | null) => void, intervalMs?: number): () => void;
|
|
111
135
|
/**
|
|
112
136
|
* Force one immediate workspace-status poll, reconciling every watched
|
|
113
137
|
* path's content against the server (hash-gated; only changed datasets
|
|
114
138
|
* refetch). Use after an out-of-band server mutation (e.g. a record
|
|
115
139
|
* mutation commit) so a watched dataset picks up the new bytes without
|
|
116
|
-
* waiting for the standing poll interval.
|
|
117
|
-
*
|
|
140
|
+
* waiting for the standing poll interval. A poll already in flight may
|
|
141
|
+
* have read the status before the mutation, so the refresh polls again
|
|
142
|
+
* once it settles. No-op if the workspace has no active poller.
|
|
143
|
+
* Fire-and-forget; resolves when the refresh's poll settles.
|
|
118
144
|
*/
|
|
119
145
|
refresh(workspace: string): Promise<void>;
|
|
120
146
|
/** Subscribe to changes on a specific key */
|
|
@@ -178,6 +204,7 @@ export declare class ReactiveDatasetCache implements ReactiveDatasetCacheInterfa
|
|
|
178
204
|
private workspacePollers;
|
|
179
205
|
private readonly clock;
|
|
180
206
|
private inFlightPolls;
|
|
207
|
+
private hashWatches;
|
|
181
208
|
private batchDepth;
|
|
182
209
|
private changedKeys;
|
|
183
210
|
private scheduler;
|
|
@@ -247,15 +274,24 @@ export declare class ReactiveDatasetCache implements ReactiveDatasetCacheInterfa
|
|
|
247
274
|
* 3. Only fetches full content when hash changes
|
|
248
275
|
*
|
|
249
276
|
* Multiple subscriptions to the same workspace share a single poller.
|
|
250
|
-
* Pair with {@link clearRefetchInterval} on unmount so the
|
|
251
|
-
* stop when nothing is watching.
|
|
277
|
+
* Pair each call with one {@link clearRefetchInterval} on unmount so the
|
|
278
|
+
* poller can stop when nothing is watching.
|
|
252
279
|
*/
|
|
253
280
|
setRefetchInterval(workspace: string, path: TreePath, intervalMs: number): void;
|
|
254
281
|
/**
|
|
255
|
-
* Stop polling a dataset
|
|
256
|
-
*
|
|
282
|
+
* Stop polling a dataset for one watcher; the path goes when its last
|
|
283
|
+
* watcher clears it, and the workspace poller is torn down when its last
|
|
284
|
+
* path goes.
|
|
257
285
|
*/
|
|
258
286
|
clearRefetchInterval(workspace: string, path: TreePath): void;
|
|
287
|
+
/**
|
|
288
|
+
* Follow a dataset's content hash without fetching its content; see the
|
|
289
|
+
* interface doc.
|
|
290
|
+
*/
|
|
291
|
+
watchHash(workspace: string, path: TreePath, onHash: (hash: string | null) => void, intervalMs?: number): () => void;
|
|
292
|
+
/** Stops a workspace's poller once it has no path to reconcile and no hash
|
|
293
|
+
* to follow — without this, a long-lived session polls forever. */
|
|
294
|
+
private stopIdlePoller;
|
|
259
295
|
refresh(workspace: string): Promise<void>;
|
|
260
296
|
/**
|
|
261
297
|
* Poll workspace status and reconcile the cache with the server.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-store.d.ts","sourceRoot":"","sources":["../../src/platform/dataset-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,OAAO,EAQH,KAAK,iBAAiB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1F;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB;sDACkD;IAClD,WAAW,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG;QAAE,KAAK,IAAI,IAAI,CAAA;KAAE,CAAC;CAC9D;AAED,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,KAKvB,CA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AAI,GAAG,MAAM,IAAI;IAC3C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IA4BxD;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI;IAIzE;;OAEG;IACH,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAYxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACH,OAAO,CAAC,KAAK;IAeb,OAAO,CAAC,OAAO;IAsBf;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAqBlB;AAiBD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,0BAA0B,EAClC,GAAG,EAAE,UAAU,EACf,KAAK,CAAC,EAAE,KAAK,GACd,oBAAoB,CAEtB"}
|
|
@@ -66,8 +66,14 @@ export declare class FuncRuntime extends TrackedChannelStore<FuncEntry> {
|
|
|
66
66
|
/** Install the API adapter + workspace — called by the React provider
|
|
67
67
|
* (or a test/showcase harness) before any handle is used. */
|
|
68
68
|
initialize(api: FunctionApi, workspace: string): void;
|
|
69
|
-
/**
|
|
70
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Tear down the adapter and all call state.
|
|
71
|
+
*
|
|
72
|
+
* @param api - Clear only while this is the installed adapter, so a
|
|
73
|
+
* provider tearing down after another installed its own leaves that one
|
|
74
|
+
* in place
|
|
75
|
+
*/
|
|
76
|
+
clear(api?: FunctionApi): void;
|
|
71
77
|
/** The deployed signature list for a workspace (fetched once). */
|
|
72
78
|
private signatures;
|
|
73
79
|
/** Validate a declared signature against the deployed list. Returns a
|
|
@@ -100,8 +106,12 @@ export declare const defaultFuncRuntime: FuncRuntime;
|
|
|
100
106
|
/** Install the function API adapter + workspace — called by the React
|
|
101
107
|
* provider on mount (or by a test/showcase harness). */
|
|
102
108
|
export declare function initializeFunctionApi(api: FunctionApi, workspace: string): void;
|
|
103
|
-
/**
|
|
104
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Tear down the function API adapter and all call state.
|
|
111
|
+
*
|
|
112
|
+
* @param api - Clear only while this is the installed adapter
|
|
113
|
+
*/
|
|
114
|
+
export declare function clearFunctionApi(api?: FunctionApi): void;
|
|
105
115
|
/** Global, manifest-unscoped `Func.bind` impl + its backing primitives.
|
|
106
116
|
* Registered on module load (powers the extension registry decode path). */
|
|
107
117
|
export declare const FuncPlatform: PlatformFunction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"func-runtime.d.ts","sourceRoot":"","sources":["../../src/platform/func-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAQH,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAMnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAA0D,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAChH,OAAO,EAGH,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACzB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAO3D;;2CAE2C;AAC3C,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,UAAU,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,qEAAqE;IACrE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACtD,2EAA2E;IAC3E,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,EA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;AAChE,eAAO,MAAM,kBAAkB,aAAoB,CAAC;AAEpD;yDACyD;AACzD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAE/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAExD;AAED;6EAC6E;AAC7E,eAAO,MAAM,YAAY,EAAE,gBAAgB,EAG1C,CAAC;AAEF;;;;;4DAK4D;AAC5D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAKzF;AAQD,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAChC,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,UAAU,EAAE,CAAC,QAAQ,GAAG,aAAa,CAAC,EAAE,CAAC;IACzC,mBAAmB;IACnB,UAAU,EAAE,QAAQ,GAAG,aAAa,CAAC;IACrC;sCACkC;IAClC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,mBAAmB,EAAE,GAAG,WAAW,CA8BvF"}
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { ReactiveDatasetCache, createReactiveDatasetCache, createDefaultDatasetA
|
|
|
12
12
|
export { StagedStore, IndexedDBStagedAdapter, MemoryStagedAdapter, type StagedStoreInterface, type StagedPersistenceAdapter, type StagedEntry, type PersistedStagedEntry, getStagedStore, initializeStagedStore, clearStagedStoreSingleton, } from './staged-store.js';
|
|
13
13
|
export { BindRuntime, defaultBindRuntime, BindPlatform, createScopedBindPlatform, getReactiveDatasetCache, initializeReactiveDatasetCache, clearReactiveDatasetCache, enableBindingTracking, disableBindingTracking, isBindingTracking, trackDatasetPath, getBindingTypes, clearBindingRegistry, type BindingTypes, type BindHandle, preloadReactiveDatasetList, clearReactiveDatasetListCache, onWriteError, awaitPendingWrites, clearPendingWrites, } from './bind-runtime.js';
|
|
14
14
|
export { FuncRuntime, defaultFuncRuntime, FuncPlatform, createScopedFuncPlatform, createDefaultFunctionApi, initializeFunctionApi, clearFunctionApi, funcChannelKey, signatureOfFuncHandleType, createInMemoryFunctionApi, type InMemoryFunctionDef, type FunctionApi, type FunctionCallArgs, } from './func-runtime.js';
|
|
15
|
-
export { PagedRuntime, defaultPagedRuntime, PagedPlatform, createScopedPagedPlatform, createDefaultPagedApi, initializePagedApi, clearPagedApi, pagedWindowKey, pagedTotalKey, type PagedApi, type PagedWindow, } from './paged-runtime.js';
|
|
15
|
+
export { PagedRuntime, defaultPagedRuntime, PagedPlatform, createScopedPagedPlatform, createDefaultPagedApi, initializePagedApi, clearPagedApi, pagedRevisionKey, pagedWindowKey, pagedTotalKey, type PagedApi, type PagedWindow, } from './paged-runtime.js';
|
|
16
16
|
export { RecordRuntime, defaultRecordRuntime, RecordPlatform, createScopedRecordPlatform, createDefaultRecordApi, initializeRecordApi, clearRecordApi, recordChannelKey, createInMemoryRecordApi, type InMemoryRecordDef, type RecordApi, type RecordMutateArgs, } from './record-runtime.js';
|
|
17
17
|
export { E3Provider, useE3Config, useE3ConfigOptional, type E3Config, type E3ProviderProps, } from './e3-config.js';
|
|
18
18
|
export { ReactiveDatasetProvider, type ReactiveDatasetProviderProps, useReactiveDatasetCache, useReactiveDatasetCacheSubscription, useReactiveDatasetKey, usePreloadReactiveDatasets, type ReactiveDatasetToPreload, type PreloadReactiveDatasetsResult, useReactiveDatasetWrite, useReactiveDatasetHas, ReactiveDatasetLoader, type ReactiveDatasetLoaderProps, } from './dataset-hooks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAGH,OAAO,EACH,oBAAoB,EACpB,0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AAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,GACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACH,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACvB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACH,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,uBAAuB,EACvB,mCAAmC,EACnC,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,0BAA0B,GAClC,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAGH,OAAO,EACH,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,SAAS,EACT,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,UAAU,EACf,KAAK,KAAK,EACV,eAAe,EACf,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EACH,WAAW,EACX,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,cAAc,EACd,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,0BAA0B,EAC1B,6BAA6B,EAC7B,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,GACnB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,GACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACH,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,GACvB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACH,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,uBAAuB,EACvB,mCAAmC,EACnC,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,0BAA0B,GAClC,MAAM,oBAAoB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { EastTypeValue } from '@elaraai/east';
|
|
|
2
2
|
import { PlatformFunction } from '@elaraai/east/internal';
|
|
3
3
|
import { DatasetPage, DatasetFindQuery, DatasetFindResult } from '@elaraai/e3-api-client';
|
|
4
4
|
import { TreePath } from '@elaraai/e3-types';
|
|
5
|
+
import { ReactiveDatasetCacheInterface } from './dataset-store.js';
|
|
5
6
|
import { TrackedChannelStore } from './tracked-channel.js';
|
|
6
7
|
/** One element window of a paged source. */
|
|
7
8
|
export interface PagedWindow {
|
|
@@ -9,33 +10,77 @@ export interface PagedWindow {
|
|
|
9
10
|
offset: number;
|
|
10
11
|
/** Maximum elements to return (the server may clamp it). */
|
|
11
12
|
limit: number;
|
|
13
|
+
/** Read through one of a record's secondary indexes instead of the record
|
|
14
|
+
* itself — the window is then the INDEX's row space, in its own order. */
|
|
15
|
+
index?: string;
|
|
16
|
+
/** With {@link index}: read each entry's row from the record too. */
|
|
17
|
+
join?: boolean;
|
|
18
|
+
/** The content hash the window is pinned to. The server answers from that
|
|
19
|
+
* content or refuses, naming the content the dataset holds now; it never
|
|
20
|
+
* answers from other content. */
|
|
21
|
+
hash?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Which rows a bind serves: the dataset's own, or one of a record's indexes.
|
|
24
|
+
* Every channel key, every fetch and the handle cache carry it, because two
|
|
25
|
+
* binds that differ here serve different row spaces from one path. */
|
|
26
|
+
export interface PagedSelector {
|
|
27
|
+
/** The index's name, or `null` for the dataset itself. */
|
|
28
|
+
index: string | null;
|
|
29
|
+
/** Whether an index read joins each entry to its row. */
|
|
30
|
+
join: boolean;
|
|
12
31
|
}
|
|
13
32
|
/**
|
|
14
|
-
* Adapter for the dataset paging
|
|
15
|
-
* `@elaraai/e3-api-client`'s `datasetGetPage
|
|
33
|
+
* Adapter for the dataset paging endpoints. The default wraps
|
|
34
|
+
* `@elaraai/e3-api-client`'s `datasetGetPage`, `datasetFindKey` and
|
|
35
|
+
* `datasetGetStatus`, and follows datasets through the dataset store.
|
|
16
36
|
*/
|
|
17
37
|
export interface PagedApi {
|
|
18
|
-
/** Fetch one element window of a collection dataset
|
|
38
|
+
/** Fetch one element window of a collection dataset — or of one of a
|
|
39
|
+
* record's indexes, when the window names one. */
|
|
19
40
|
getPage(workspace: string, path: TreePath, window: PagedWindow): Promise<DatasetPage>;
|
|
20
41
|
/** Locate a key query in a Set/Dict dataset's canonical key order. The
|
|
21
42
|
* `row` it answers with indexes the SAME row space {@link getPage}'s
|
|
22
43
|
* element windows serve, which is what makes a hit addressable. */
|
|
23
44
|
findKey(workspace: string, path: TreePath, query: DatasetFindQuery): Promise<DatasetFindResult>;
|
|
45
|
+
/**
|
|
46
|
+
* The dataset's current content hash, or `null` while it has no value. For
|
|
47
|
+
* a record it is the record's state hash, which reads through its indexes
|
|
48
|
+
* are pinned to as well.
|
|
49
|
+
*/
|
|
50
|
+
getRevision(workspace: string, path: TreePath): Promise<string | null>;
|
|
51
|
+
/**
|
|
52
|
+
* Follow a dataset's content hash.
|
|
53
|
+
*
|
|
54
|
+
* @param workspace - The workspace
|
|
55
|
+
* @param path - The dataset's path
|
|
56
|
+
* @param onChange - Hears each hash the dataset moves to, the first report
|
|
57
|
+
* included; `null` while it has no value
|
|
58
|
+
* @returns A function that stops following
|
|
59
|
+
*/
|
|
60
|
+
watchRevision(workspace: string, path: TreePath, onChange: (hash: string | null) => void): () => void;
|
|
24
61
|
}
|
|
25
62
|
/**
|
|
26
63
|
* Build the default {@link PagedApi} that talks to a real e3 server via
|
|
27
64
|
* `@elaraai/e3-api-client`.
|
|
28
65
|
*
|
|
29
66
|
* @remarks
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
67
|
+
* A dataset is followed through the dataset store's workspace-status poll,
|
|
68
|
+
* which reports every dataset's hash: a followed dataset joins that poll, adds
|
|
69
|
+
* no request of its own, and never has its content fetched.
|
|
70
|
+
*
|
|
71
|
+
* @param apiUrl - Base URL of the e3 API server
|
|
72
|
+
* @param repo - Repository name
|
|
73
|
+
* @param getToken - Reads the current token, so a rotated one is used at once
|
|
74
|
+
* @param datasets - The dataset store whose status poll reports the hashes
|
|
75
|
+
* @returns The adapter
|
|
34
76
|
*/
|
|
35
|
-
export declare function createDefaultPagedApi(apiUrl: string, repo: string, getToken: () => string | null): PagedApi;
|
|
36
|
-
/** One tracked channel per window
|
|
77
|
+
export declare function createDefaultPagedApi(apiUrl: string, repo: string, getToken: () => string | null, datasets: Pick<ReactiveDatasetCacheInterface, "watchHash">): PagedApi;
|
|
78
|
+
/** One tracked channel per window, per total and per search. */
|
|
37
79
|
interface PageEntry {
|
|
38
80
|
status: "idle" | "running" | "loaded" | "failed";
|
|
81
|
+
/** The fetch the channel waits on; a settling fetch that is no longer it
|
|
82
|
+
* is discarded. Unique across the runtime, so a channel dropped by a move
|
|
83
|
+
* and made again never mistakes an old fetch for its own. */
|
|
39
84
|
launchSeq: number;
|
|
40
85
|
/** The decoded window — a value of the dataset's own type. */
|
|
41
86
|
window?: unknown;
|
|
@@ -43,29 +88,35 @@ interface PageEntry {
|
|
|
43
88
|
total?: number;
|
|
44
89
|
/** Where a key query landed — the answer on a seek channel. */
|
|
45
90
|
range?: DatasetFindResult;
|
|
91
|
+
/** Why the last attempt failed — what a read of the channel throws. */
|
|
92
|
+
error?: string;
|
|
46
93
|
/** When the last attempt failed, so a retry can be rate-limited. */
|
|
47
94
|
failedAtMs?: number;
|
|
48
|
-
/**
|
|
95
|
+
/** No retry can help while the source holds the same content. */
|
|
49
96
|
permanent?: boolean;
|
|
50
97
|
}
|
|
51
98
|
/** The Dict key / Set element type of a keyed collection, else null — the
|
|
52
99
|
* `seek` capability is decided from the dataset's own type at bind time. */
|
|
53
100
|
export declare function keyTypeOf(sourceType: EastTypeValue): EastTypeValue | null;
|
|
54
|
-
/** Tracked-channel key for
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export declare function
|
|
101
|
+
/** Tracked-channel key for a dataset's revision. Every read of the dataset
|
|
102
|
+
* tracks it, so every read re-fires when the source moves. */
|
|
103
|
+
export declare function pagedRevisionKey(workspace: string, path: TreePath): string;
|
|
104
|
+
/** Tracked-channel key for one window of one revision. */
|
|
105
|
+
export declare function pagedWindowKey(workspace: string, path: TreePath, revision: string, offset: number, limit: number, selector?: PagedSelector): string;
|
|
106
|
+
/** Tracked-channel key for one revision's element total. */
|
|
107
|
+
export declare function pagedTotalKey(workspace: string, path: TreePath, revision: string, selector?: PagedSelector): string;
|
|
108
|
+
/** Tracked-channel key for ONE key query against one revision. Every distinct
|
|
109
|
+
* query gets its own channel: a search result is as fixed as a window. */
|
|
110
|
+
export declare function pagedSeekKey(workspace: string, path: TreePath, revision: string, query: DatasetFindQuery, selector?: PagedSelector): string;
|
|
61
111
|
/**
|
|
62
112
|
* The decoded East {@link SeekQueryType} value as e3's wire query.
|
|
63
113
|
*
|
|
64
|
-
* The two are deliberately the same
|
|
65
|
-
*
|
|
66
|
-
*
|
|
114
|
+
* The two are deliberately the same shapes, so this is a re-tagging rather
|
|
115
|
+
* than a translation: `.east` literals stay text, and the East option on the
|
|
116
|
+
* `fields` arm, like an open end of a `range`, becomes an absent property
|
|
117
|
+
* (`exactOptionalPropertyTypes`).
|
|
67
118
|
*/
|
|
68
|
-
export declare function toFindQuery(query: unknown): DatasetFindQuery;
|
|
119
|
+
export declare function toFindQuery(query: unknown, selector?: PagedSelector): DatasetFindQuery;
|
|
69
120
|
/**
|
|
70
121
|
* Encapsulates all `Data.bindPaged` runtime state. The module-level
|
|
71
122
|
* {@link defaultPagedRuntime} instance backs the registered platform; tests
|
|
@@ -78,32 +129,95 @@ export declare class PagedRuntime extends TrackedChannelStore<PageEntry> {
|
|
|
78
129
|
/** Loaded window keys in least-recently-READ order (a Map preserves
|
|
79
130
|
* insertion order; a read re-inserts). Bounds the decoded-window cache. */
|
|
80
131
|
private readonly loadedWindows;
|
|
132
|
+
/** Each dataset's snapshot, by workspace and path. */
|
|
133
|
+
private readonly snapshots;
|
|
134
|
+
/** Fetches launched so far — the source of every channel's `launchSeq`. */
|
|
135
|
+
private launches;
|
|
81
136
|
/** Monotonic clock seam so tests can drive the retry gate. */
|
|
82
137
|
protected now(): number;
|
|
83
138
|
protected createEntry(): PageEntry;
|
|
84
139
|
/** Install the API adapter + workspace — called by the React provider
|
|
85
|
-
* (or a test/showcase harness) before any handle is used.
|
|
140
|
+
* (or a test/showcase harness) before any handle is used. Another adapter
|
|
141
|
+
* or workspace starts from nothing: no snapshot of the old one's carries
|
|
142
|
+
* over. */
|
|
86
143
|
initialize(api: PagedApi, workspace: string): void;
|
|
87
|
-
/**
|
|
88
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Tear down the adapter and all window state.
|
|
146
|
+
*
|
|
147
|
+
* @param api - Clear only while this is the installed adapter, so a
|
|
148
|
+
* provider tearing down after another installed its own leaves that one
|
|
149
|
+
* in place
|
|
150
|
+
*/
|
|
151
|
+
clear(api?: PagedApi): void;
|
|
152
|
+
/** Stop following every dataset, and drop what every snapshot delivered. */
|
|
153
|
+
private reset;
|
|
89
154
|
private resolveWorkspace;
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
155
|
+
/** A dataset's snapshot, followed from its first read until the runtime
|
|
156
|
+
* is cleared. */
|
|
157
|
+
private snapshotOf;
|
|
158
|
+
/** Whether a snapshot is still the runtime's, rather than one a clear or a
|
|
159
|
+
* re-initialization dropped. */
|
|
160
|
+
private isLive;
|
|
161
|
+
/** Whether a live snapshot is still pinned to `revision`. */
|
|
162
|
+
private pinnedTo;
|
|
94
163
|
/**
|
|
95
|
-
*
|
|
164
|
+
* The revision a read of `path` is pinned to — a hash, `null` while the
|
|
165
|
+
* dataset has no value, or `undefined` while it is being found — tracked so
|
|
166
|
+
* the read re-fires when the source moves.
|
|
96
167
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* Only the settle notifies.
|
|
168
|
+
* @throws The failed lookup's reason, until a read after the retry gap
|
|
169
|
+
* looks again
|
|
100
170
|
*/
|
|
101
|
-
private
|
|
171
|
+
private revisionFor;
|
|
102
172
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* launch-does-not-notify rule (the read runs inside a render pass).
|
|
173
|
+
* Ask the server which content the dataset holds, and move there — unless
|
|
174
|
+
* a move lands first, which came from something no older than the answer.
|
|
106
175
|
*/
|
|
176
|
+
private find;
|
|
177
|
+
/**
|
|
178
|
+
* Move a dataset's source to `revision`: drop what the old snapshot
|
|
179
|
+
* delivered and re-fire every read of the dataset, so the windows and
|
|
180
|
+
* searches still in use are fetched again, pinned to the new one. A move to
|
|
181
|
+
* the revision the source already has changes nothing.
|
|
182
|
+
*/
|
|
183
|
+
private moveTo;
|
|
184
|
+
/**
|
|
185
|
+
* Handle what a pinned fetch threw when it is not the read's failure: a
|
|
186
|
+
* refusal naming other content moves the source there, and "no value"
|
|
187
|
+
* moves it to no snapshot. Returns whether the error was one of those, or
|
|
188
|
+
* arrived after the source had already moved on.
|
|
189
|
+
*/
|
|
190
|
+
private followed;
|
|
191
|
+
/** A channel of the snapshot's current revision, dropped when it moves. */
|
|
192
|
+
private channel;
|
|
193
|
+
/** Whether a channel is due a fetch: never fetched, evicted, or failed
|
|
194
|
+
* for a reason a retry can fix, longer ago than the retry gap. */
|
|
195
|
+
private due;
|
|
196
|
+
/**
|
|
197
|
+
* Mark a channel's fetch as started, returning the fetch's sequence number.
|
|
198
|
+
*
|
|
199
|
+
* Deliberately does NOT notify — the read that triggers it runs inside a
|
|
200
|
+
* render pass, and notifying there would re-enter the renderer. Only the
|
|
201
|
+
* settle notifies.
|
|
202
|
+
*/
|
|
203
|
+
private launch;
|
|
204
|
+
/** Apply a fetch's outcome if the channel still waits on it, re-firing the
|
|
205
|
+
* channel's reads. Returns whether it applied. */
|
|
206
|
+
private settle;
|
|
207
|
+
/** Settle a fetch as failed, with the reason a read will throw. */
|
|
208
|
+
private fail;
|
|
209
|
+
/** What a read of a channel answers: its value once loaded, `none` while
|
|
210
|
+
* in flight, or its failure, thrown. */
|
|
211
|
+
private answer;
|
|
212
|
+
/** Note a window as most-recently-read, and drop the coldest decoded
|
|
213
|
+
* windows once the cache exceeds its cap. An evicted window returns to
|
|
214
|
+
* `idle`, so the next read refetches it rather than reading a hole. */
|
|
215
|
+
private touchWindow;
|
|
216
|
+
/** Start the pinned fetch for a window if it is due one, returning its
|
|
217
|
+
* channel. */
|
|
218
|
+
private ensureWindow;
|
|
219
|
+
/** Start the pinned fence search for one key query if it is due one,
|
|
220
|
+
* returning its channel — the seek sibling of {@link ensureWindow}. */
|
|
107
221
|
private ensureSeek;
|
|
108
222
|
/**
|
|
109
223
|
* The low-level primitives backing handle methods, bound to THIS runtime.
|
|
@@ -113,29 +227,49 @@ export declare class PagedRuntime extends TrackedChannelStore<PageEntry> {
|
|
|
113
227
|
*/
|
|
114
228
|
buildPrimitives(): PlatformFunction[];
|
|
115
229
|
/**
|
|
116
|
-
* Build the handle value for one
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* type-arg) — so the handle is ordinary serializable East data (issue
|
|
230
|
+
* Build the handle value for one paged bind. Every method is a thin
|
|
231
|
+
* IR-bearing `East.function` over {@link buildPrimitives}, capturing only
|
|
232
|
+
* the plain-data source path and selector (the value type rides as a
|
|
233
|
+
* type-arg) — so the handle is ordinary serializable East data (issue
|
|
234
|
+
* #106).
|
|
235
|
+
*
|
|
236
|
+
* @param sourceType - The dataset's type, or an index's window type
|
|
237
|
+
* @param path - The dataset's path
|
|
238
|
+
* @param selector - The rows the bind serves
|
|
239
|
+
* @param shape - `released`: the handle `data_bind_paged` returns, without
|
|
240
|
+
* `revision` or `refresh`; `pinned`: the handle `data_bind_paged_pinned`
|
|
241
|
+
* returns. Both read through the same snapshot.
|
|
242
|
+
* @returns The handle
|
|
120
243
|
*/
|
|
121
|
-
buildHandle(sourceType: EastTypeValue, path: TreePath): Record<string, unknown>;
|
|
122
|
-
/** Build
|
|
123
|
-
*
|
|
124
|
-
*
|
|
244
|
+
buildHandle(sourceType: EastTypeValue, path: TreePath, selector: PagedSelector, shape: "released" | "pinned"): Record<string, unknown>;
|
|
245
|
+
/** Build the PlatformFunction behind `data_bind_paged` — the bind a UI
|
|
246
|
+
* exported before pinned reads calls — bound to this runtime. Its handle
|
|
247
|
+
* has no `revision` or `refresh`, but its reads are pinned, follow the
|
|
248
|
+
* dataset and fail visibly all the same. Pass `allowed=null` for an
|
|
249
|
+
* unscoped impl, or a Set of path strings for manifest scoping. */
|
|
125
250
|
buildPlatform(allowed: ReadonlySet<string> | null): PlatformFunction;
|
|
251
|
+
/** Build the PlatformFunction behind `data_bind_paged_pinned` — what
|
|
252
|
+
* `Data.bindPaged` emits, for a dataset's own rows or a record's index —
|
|
253
|
+
* bound to this runtime and scoped by `allowed` exactly as
|
|
254
|
+
* {@link buildPlatform} is: an index read is a read of the record's path. */
|
|
255
|
+
buildPinnedPlatform(allowed: ReadonlySet<string> | null): PlatformFunction;
|
|
126
256
|
}
|
|
127
257
|
/** Process-global runtime backing the `PagedPlatform` export. */
|
|
128
258
|
export declare const defaultPagedRuntime: PagedRuntime;
|
|
129
259
|
/** Install the paging API adapter + workspace — called by the React provider
|
|
130
260
|
* on mount (or by a test/showcase harness). */
|
|
131
261
|
export declare function initializePagedApi(api: PagedApi, workspace: string): void;
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Tear down the paging API adapter and all window state.
|
|
264
|
+
*
|
|
265
|
+
* @param api - Clear only while this is the installed adapter
|
|
266
|
+
*/
|
|
267
|
+
export declare function clearPagedApi(api?: PagedApi): void;
|
|
268
|
+
/** Global, manifest-unscoped paged binds + their backing primitives.
|
|
135
269
|
* Registered on module load (powers the extension registry decode path). */
|
|
136
270
|
export declare const PagedPlatform: PlatformFunction[];
|
|
137
|
-
/** Build
|
|
138
|
-
*
|
|
271
|
+
/** Build manifest-scoped paged binds + their backing primitives, from the
|
|
272
|
+
* manifest's `pages` list.
|
|
139
273
|
*
|
|
140
274
|
* The `data_page*` primitives MUST ship with the scoped platform: e3 `ui()`
|
|
141
275
|
* tasks render through `createScoped*()` arrays (UITaskPreview), NOT the
|