@marimo-team/marimo-export 0.0.0 → 0.0.1

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.
@@ -0,0 +1,280 @@
1
+ import { _ as portableJsonValue, d as isJsonNumber, f as isJsonString, g as portableJsonObject, m as isRecordValue } from "./loader-CDfnJ5Yb.mjs";
2
+ import { a as parseStrictJson, t as canonicalJson } from "./schema-SJ_aIgcO.mjs";
3
+ //#region src/marimo-snapshot.ts
4
+ const decoder = new TextDecoder("utf-8", {
5
+ fatal: true,
6
+ ignoreBOM: true
7
+ });
8
+ const encoder = new TextEncoder();
9
+ const SHA256 = /^[0-9a-f]{64}$/u;
10
+ const MAX_SNAPSHOT_VALUES = 2e6;
11
+ const CELL_CHANNELS = /* @__PURE__ */ new Set([
12
+ "stdout",
13
+ "stderr",
14
+ "stdin",
15
+ "pdb",
16
+ "output",
17
+ "marimo-error",
18
+ "media"
19
+ ]);
20
+ function parseMarimoOutputSnapshot(bytes) {
21
+ const root = snapshotRoot(bytes, "marimo.output.v1", [
22
+ "output",
23
+ "ownerCellId",
24
+ "projectionSha256",
25
+ "resources",
26
+ "schema"
27
+ ]);
28
+ const ownerCellId = nonEmptyString(root.ownerCellId, "ownerCellId");
29
+ const projectionSha256 = digest(root.projectionSha256, "projectionSha256");
30
+ return Object.freeze({
31
+ schema: "marimo.output.v1",
32
+ projectionSha256,
33
+ ownerCellId,
34
+ output: parseCellOutput(root.output, "output"),
35
+ resources: parseResources(root.resources, ownerCellId, projectionSha256)
36
+ });
37
+ }
38
+ function parseMarimoCellSnapshot(bytes) {
39
+ const root = snapshotRoot(bytes, "marimo.cell.v1", [
40
+ "cell",
41
+ "console",
42
+ "outcome",
43
+ "output",
44
+ "projectionSha256",
45
+ "resources",
46
+ "schema"
47
+ ]);
48
+ if (root.outcome !== "completed") throw new TypeError("Marimo cell snapshot outcome must be \"completed\".");
49
+ if (!Array.isArray(root.console)) throw new TypeError("Marimo cell snapshot console must be an array.");
50
+ const cell = parseCellIdentity(root.cell);
51
+ const projectionSha256 = digest(root.projectionSha256, "projectionSha256");
52
+ return Object.freeze({
53
+ schema: "marimo.cell.v1",
54
+ projectionSha256,
55
+ cell,
56
+ outcome: "completed",
57
+ output: parseCellOutput(root.output, "output"),
58
+ console: Object.freeze(root.console.map((output, index) => {
59
+ const parsed = parseCellOutput(output, `console[${index}]`);
60
+ if (parsed === null) throw new TypeError(`console[${index}] must contain an output.`);
61
+ return parsed;
62
+ })),
63
+ resources: parseResources(root.resources, cell.id, projectionSha256)
64
+ });
65
+ }
66
+ function snapshotRoot(bytes, schema, fields) {
67
+ const text = decoder.decode(bytes);
68
+ const parsed = parseStrictJson(text, MAX_SNAPSHOT_VALUES);
69
+ const root = strictRecord(parsed, `${schema} snapshot`, fields);
70
+ if (root.schema !== schema) throw new TypeError(`Snapshot schema must be ${JSON.stringify(schema)}.`);
71
+ if (!equalBytes(bytes, encoder.encode(canonicalJson(parsed)))) throw new TypeError(`${schema} snapshot must be canonical JSON.`);
72
+ return root;
73
+ }
74
+ function parseCellIdentity(value) {
75
+ const cell = strictRecord(value, "cell", [
76
+ "codeSha256",
77
+ "config",
78
+ "id",
79
+ "name"
80
+ ]);
81
+ const id = nonEmptyString(cell.id, "cell.id");
82
+ const name = cell.name === null ? null : nonEmptyString(cell.name, "cell.name");
83
+ if (!isJsonString(cell.codeSha256) || !SHA256.test(cell.codeSha256)) throw new TypeError("cell.codeSha256 must be a lowercase SHA-256 digest.");
84
+ return Object.freeze({
85
+ id,
86
+ name,
87
+ codeSha256: cell.codeSha256,
88
+ config: portableJsonObject(cell.config, "cell.config")
89
+ });
90
+ }
91
+ function parseCellOutput(value, path) {
92
+ if (value === null) return null;
93
+ const output = strictRecord(value, path, [
94
+ "channel",
95
+ "data",
96
+ "mimetype"
97
+ ]);
98
+ return Object.freeze({
99
+ channel: cellChannel(output.channel, `${path}.channel`),
100
+ mimetype: nonEmptyString(output.mimetype, `${path}.mimetype`),
101
+ data: portableJsonValue(output.data, `${path}.data`)
102
+ });
103
+ }
104
+ function parseResources(value, ownerCellId, projectionSha256) {
105
+ const resources = strictRecord(value, "resources", [
106
+ "files",
107
+ "functions",
108
+ "modelNotifications",
109
+ "uiValues"
110
+ ]);
111
+ const files = record(resources.files, "resources.files");
112
+ const parsedFiles = Object.freeze(Object.fromEntries(Object.entries(files).map(([path, dataUrl]) => [nonEmptyString(path, "resources.files key"), dataUrlString(dataUrl, `resources.files[${JSON.stringify(path)}]`)])));
113
+ if (!Array.isArray(resources.modelNotifications)) throw new TypeError("resources.modelNotifications must be an array.");
114
+ const modelNotifications = Object.freeze(resources.modelNotifications.map((notification, index) => parseModelLifecycle(notification, index, parsedFiles, projectionSha256)));
115
+ const functions = record(resources.functions, "resources.functions");
116
+ const parsedFunctions = Object.freeze(Object.fromEntries(Object.entries(functions).map(([namespace, names]) => {
117
+ if (!Array.isArray(names) || names.some((name) => !isJsonString(name) || !name)) throw new TypeError(`resources.functions[${JSON.stringify(namespace)}] must be an array of names.`);
118
+ if (names.length > 0) throw new TypeError(`resources.functions[${JSON.stringify(namespace)}] must be empty for static replay.`);
119
+ return [projectionUiObjectId(namespace, "resources.functions key", ownerCellId, projectionSha256), Object.freeze([...names])];
120
+ })));
121
+ const uiValues = record(resources.uiValues, "resources.uiValues");
122
+ const parsedUiValues = Object.freeze(Object.fromEntries(Object.entries(uiValues).map(([objectId, item]) => [projectionUiObjectId(objectId, "resources.uiValues key", ownerCellId, projectionSha256), portableJsonValue(item, `resources.uiValues[${JSON.stringify(objectId)}]`)])));
123
+ for (const objectId of Object.keys(parsedUiValues)) if (!Object.hasOwn(parsedFunctions, objectId)) throw new TypeError(`resources.uiValues key ${JSON.stringify(objectId)} has no function namespace.`);
124
+ for (const objectId of Object.keys(parsedFunctions)) if (!Object.hasOwn(parsedUiValues, objectId)) throw new TypeError(`resources.functions key ${JSON.stringify(objectId)} has no replay UI value.`);
125
+ return Object.freeze({
126
+ files: parsedFiles,
127
+ modelNotifications,
128
+ functions: parsedFunctions,
129
+ uiValues: parsedUiValues
130
+ });
131
+ }
132
+ function projectionUiObjectId(value, path, ownerCellId, projectionSha256) {
133
+ const objectId = nonEmptyString(value, path);
134
+ const ownerPrefix = `${ownerCellId}-projection-${projectionSha256}-ui-`;
135
+ if (!objectId.startsWith(ownerPrefix) || objectId.length === ownerPrefix.length) throw new TypeError(`${path} must be a projection-scoped UI object owned by ${JSON.stringify(ownerCellId)}.`);
136
+ return objectId;
137
+ }
138
+ function parseModelLifecycle(value, index, files, projectionSha256) {
139
+ const path = `resources.modelNotifications[${index}]`;
140
+ const notification = strictRecord(value, path, [
141
+ "message",
142
+ "model_id",
143
+ "op"
144
+ ]);
145
+ if (notification.op !== "model-lifecycle") throw new TypeError(`${path}.op must be "model-lifecycle".`);
146
+ const modelId = nonEmptyString(notification.model_id, `${path}.model_id`);
147
+ const modelPrefix = `projection-${projectionSha256}-model-`;
148
+ const modelIndex = modelId.slice(modelPrefix.length);
149
+ if (!modelId.startsWith(modelPrefix) || !/^(?:0|[1-9][0-9]*)$/u.test(modelIndex)) throw new TypeError(`${path}.model_id must belong to the snapshot projection.`);
150
+ const message = record(notification.message, `${path}.message`);
151
+ const method = message.method;
152
+ if (method === "open" || method === "update") {
153
+ exactFields(message, [
154
+ "buffer_paths",
155
+ "buffers",
156
+ "esm_spec",
157
+ "method",
158
+ "state"
159
+ ], `${path}.message`);
160
+ const state = portableJsonObject(message.state, `${path}.message.state`);
161
+ const paths = bufferPaths(message.buffer_paths, `${path}.message.buffer_paths`);
162
+ const buffers = stringArray(message.buffers, `${path}.message.buffers`);
163
+ if (paths.length !== buffers.length) throw new TypeError(`${path}.message buffer paths and buffers must have equal length.`);
164
+ const esmSpec = parseEsmSpec(message.esm_spec, `${path}.message.esm_spec`, files);
165
+ return Object.freeze({
166
+ op: "model-lifecycle",
167
+ model_id: modelId,
168
+ message: Object.freeze({
169
+ method,
170
+ state,
171
+ buffer_paths: paths,
172
+ buffers,
173
+ esm_spec: esmSpec
174
+ })
175
+ });
176
+ } else if (method === "custom") {
177
+ exactFields(message, [
178
+ "buffers",
179
+ "content",
180
+ "method"
181
+ ], `${path}.message`);
182
+ return Object.freeze({
183
+ op: "model-lifecycle",
184
+ model_id: modelId,
185
+ message: Object.freeze({
186
+ method: "custom",
187
+ content: portableJsonValue(message.content, `${path}.message.content`),
188
+ buffers: stringArray(message.buffers, `${path}.message.buffers`)
189
+ })
190
+ });
191
+ } else if (method === "close") {
192
+ exactFields(message, ["method"], `${path}.message`);
193
+ return Object.freeze({
194
+ op: "model-lifecycle",
195
+ model_id: modelId,
196
+ message: Object.freeze({ method: "close" })
197
+ });
198
+ } else throw new TypeError(`${path}.message.method is invalid.`);
199
+ }
200
+ function bufferPaths(value, path) {
201
+ if (!Array.isArray(value)) throw new TypeError(`${path} must be an array.`);
202
+ return Object.freeze(value.map((item, index) => {
203
+ if (!Array.isArray(item) || item.length === 0) throw new TypeError(`${path}[${index}] must be a non-empty array.`);
204
+ const parsed = item.map((token) => {
205
+ if (isJsonString(token)) return token;
206
+ if (isJsonNumber(token) && Number.isSafeInteger(token) && token >= 0) return token;
207
+ throw new TypeError(`${path}[${index}] contains an invalid token.`);
208
+ });
209
+ return Object.freeze(parsed);
210
+ }));
211
+ }
212
+ function parseEsmSpec(value, path, files) {
213
+ if (value === null) return null;
214
+ const spec = strictRecord(value, path, ["hash", "url"]);
215
+ const hash = nonEmptyString(spec.hash, `${path}.hash`);
216
+ const url = nonEmptyString(spec.url, `${path}.url`);
217
+ const embeddedKey = url.startsWith("./@file/") ? url.slice(1) : url;
218
+ if (Object.hasOwn(files, embeddedKey) || url.startsWith("data:")) return Object.freeze({
219
+ hash,
220
+ url
221
+ });
222
+ let parsed;
223
+ try {
224
+ parsed = new URL(url);
225
+ } catch (error) {
226
+ throw new TypeError(`${path}.url references an unavailable resource.`, { cause: error });
227
+ }
228
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new TypeError(`${path}.url uses an incompatible protocol.`);
229
+ return Object.freeze({
230
+ hash,
231
+ url
232
+ });
233
+ }
234
+ function stringArray(value, path) {
235
+ if (!Array.isArray(value) || value.some((item) => !isJsonString(item))) throw new TypeError(`${path} must be an array of strings.`);
236
+ return Object.freeze([...value]);
237
+ }
238
+ function strictRecord(value, path, fields) {
239
+ const parsed = record(value, path);
240
+ exactFields(parsed, fields, path);
241
+ return parsed;
242
+ }
243
+ function exactFields(value, fields, path) {
244
+ const expected = new Set(fields);
245
+ const missing = fields.filter((field) => !Object.hasOwn(value, field));
246
+ const extra = Object.keys(value).filter((field) => !expected.has(field));
247
+ if (missing.length > 0) throw new TypeError(`${path} is missing fields: ${missing.join(", ")}.`);
248
+ if (extra.length > 0) throw new TypeError(`${path} has unknown fields: ${extra.join(", ")}.`);
249
+ }
250
+ function record(value, path) {
251
+ if (!isJsonObject(value)) throw new TypeError(`${path} must be an object.`);
252
+ return value;
253
+ }
254
+ function isJsonObject(value) {
255
+ return isRecordValue(value);
256
+ }
257
+ function nonEmptyString(value, path) {
258
+ if (!isJsonString(value) || value.length === 0) throw new TypeError(`${path} must be a non-empty string.`);
259
+ return value;
260
+ }
261
+ function digest(value, path) {
262
+ const parsed = nonEmptyString(value, path);
263
+ if (!SHA256.test(parsed)) throw new TypeError(`${path} must be a lowercase SHA-256 digest.`);
264
+ return parsed;
265
+ }
266
+ function dataUrlString(value, path) {
267
+ const dataUrl = nonEmptyString(value, path);
268
+ if (!dataUrl.startsWith("data:")) throw new TypeError(`${path} must contain a data URL.`);
269
+ return dataUrl;
270
+ }
271
+ function cellChannel(value, path) {
272
+ const channel = nonEmptyString(value, path);
273
+ if (!CELL_CHANNELS.has(channel)) throw new TypeError(`${path} is not a Marimo cell channel.`);
274
+ return channel;
275
+ }
276
+ function equalBytes(left, right) {
277
+ return left.byteLength === right.byteLength && left.every((byte, index) => byte === right[index]);
278
+ }
279
+ //#endregion
280
+ export { parseMarimoOutputSnapshot as n, parseMarimoCellSnapshot as t };
@@ -0,0 +1,74 @@
1
+ import { B as JsonObject, H as JsonValue } from "./types-D52GHn1Q.mjs";
2
+ //#region src/marimo-snapshot.d.ts
3
+ type MarimoCellChannel = "stdout" | "stderr" | "stdin" | "pdb" | "output" | "marimo-error" | "media";
4
+ type MarimoBufferPathToken = string | number;
5
+ type MarimoBufferPath = readonly [MarimoBufferPathToken, ...MarimoBufferPathToken[]];
6
+ interface MarimoEsmSpec {
7
+ readonly hash: string;
8
+ readonly url: string;
9
+ }
10
+ interface MarimoModelOpenMessage {
11
+ readonly method: "open";
12
+ readonly state: JsonObject;
13
+ readonly buffer_paths: readonly MarimoBufferPath[];
14
+ readonly buffers: readonly string[];
15
+ readonly esm_spec: MarimoEsmSpec | null;
16
+ }
17
+ interface MarimoModelUpdateMessage {
18
+ readonly method: "update";
19
+ readonly state: JsonObject;
20
+ readonly buffer_paths: readonly MarimoBufferPath[];
21
+ readonly buffers: readonly string[];
22
+ readonly esm_spec: MarimoEsmSpec | null;
23
+ }
24
+ interface MarimoModelCustomMessage {
25
+ readonly method: "custom";
26
+ readonly content: JsonValue;
27
+ readonly buffers: readonly string[];
28
+ }
29
+ interface MarimoModelCloseMessage {
30
+ readonly method: "close";
31
+ }
32
+ type MarimoModelLifecycleMessage = MarimoModelOpenMessage | MarimoModelUpdateMessage | MarimoModelCustomMessage | MarimoModelCloseMessage;
33
+ interface MarimoModelLifecycleNotification {
34
+ readonly op: "model-lifecycle";
35
+ readonly model_id: string;
36
+ readonly message: MarimoModelLifecycleMessage;
37
+ }
38
+ interface MarimoCellOutput {
39
+ readonly channel: MarimoCellChannel;
40
+ readonly mimetype: string;
41
+ readonly data: JsonValue;
42
+ }
43
+ interface MarimoReplayResources {
44
+ readonly files: Readonly<Record<string, string>>;
45
+ readonly modelNotifications: readonly MarimoModelLifecycleNotification[];
46
+ readonly functions: Readonly<Record<string, readonly string[]>>;
47
+ readonly uiValues: Readonly<Record<string, JsonValue>>;
48
+ }
49
+ interface MarimoOutputSnapshot {
50
+ readonly schema: "marimo.output.v1";
51
+ readonly projectionSha256: string;
52
+ readonly ownerCellId: string;
53
+ readonly output: MarimoCellOutput | null;
54
+ readonly resources: MarimoReplayResources;
55
+ }
56
+ interface MarimoCellIdentity {
57
+ readonly id: string;
58
+ readonly name: string | null;
59
+ readonly codeSha256: string;
60
+ readonly config: JsonObject;
61
+ }
62
+ interface MarimoCellSnapshot {
63
+ readonly schema: "marimo.cell.v1";
64
+ readonly projectionSha256: string;
65
+ readonly cell: MarimoCellIdentity;
66
+ readonly outcome: "completed";
67
+ readonly output: MarimoCellOutput | null;
68
+ readonly console: readonly MarimoCellOutput[];
69
+ readonly resources: MarimoReplayResources;
70
+ }
71
+ declare function parseMarimoOutputSnapshot(bytes: Uint8Array): MarimoOutputSnapshot;
72
+ declare function parseMarimoCellSnapshot(bytes: Uint8Array): MarimoCellSnapshot;
73
+ //#endregion
74
+ export { parseMarimoOutputSnapshot as _, MarimoCellOutput as a, MarimoModelCloseMessage as c, MarimoModelLifecycleNotification as d, MarimoModelOpenMessage as f, parseMarimoCellSnapshot as g, MarimoReplayResources as h, MarimoCellIdentity as i, MarimoModelCustomMessage as l, MarimoOutputSnapshot as m, MarimoBufferPathToken as n, MarimoCellSnapshot as o, MarimoModelUpdateMessage as p, MarimoCellChannel as r, MarimoEsmSpec as s, MarimoBufferPath as t, MarimoModelLifecycleMessage as u };
@@ -0,0 +1,116 @@
1
+ import { B as JsonObject, C as NotebookExport, H as JsonValue, O as OpenExportOptions, c as ControlBinding, h as ExportState } from "../types-D52GHn1Q.mjs";
2
+ //#region src/prepared/manifest.d.ts
3
+ interface PreparedExportManifest {
4
+ readonly schema: "marimo-export.prepared.v1";
5
+ readonly instance: string;
6
+ readonly exportUrl: string;
7
+ readonly inputs: JsonObject;
8
+ readonly stateFingerprint: string;
9
+ readonly refreshIntervalMs?: number;
10
+ }
11
+ interface PreparedPublication {
12
+ readonly manifest: PreparedExportManifest;
13
+ readonly notebookExport: NotebookExport;
14
+ readonly state: ExportState;
15
+ }
16
+ interface OpenPreparedPublicationOptions extends OpenExportOptions {
17
+ readonly openExport?: (base: string | URL, options?: OpenExportOptions) => Promise<NotebookExport>;
18
+ }
19
+ declare const parsePreparedExportManifest: <Input>(input: Input) => PreparedExportManifest;
20
+ declare const resolvePreparedPublication: (manifest: PreparedExportManifest, manifestUrl: URL, notebookExport: NotebookExport) => PreparedPublication;
21
+ declare const openPreparedPublication: (manifest: PreparedExportManifest, manifestUrl: URL, options?: OpenPreparedPublicationOptions) => Promise<PreparedPublication>;
22
+ //#endregion
23
+ //#region src/prepared/manifest-fetch.d.ts
24
+ interface PreparedManifestFetchOptions {
25
+ readonly fetch?: typeof globalThis.fetch;
26
+ readonly signal?: AbortSignal;
27
+ }
28
+ declare const fetchPreparedExportManifest: (url: URL, options?: PreparedManifestFetchOptions) => Promise<PreparedExportManifest>;
29
+ //#endregion
30
+ //#region src/prepared/state-port.d.ts
31
+ type PreparedStateChangeReason = "start" | "state" | "publication";
32
+ interface PreparedStateChange {
33
+ readonly previous: PreparedPublication | undefined;
34
+ readonly next: PreparedPublication;
35
+ readonly reason: PreparedStateChangeReason;
36
+ }
37
+ interface PreparedStatePort {
38
+ /** Load every required output, then publish the complete state atomically. */
39
+ apply(change: PreparedStateChange, signal: AbortSignal): Promise<void>;
40
+ /** Restore the last committed state after a rejected application request. */
41
+ restore?(publication: PreparedPublication): void | Promise<void>;
42
+ dispose?(): void | Promise<void>;
43
+ }
44
+ interface PreparedStateSnapshot {
45
+ readonly current: PreparedPublication | undefined;
46
+ readonly pendingInputs: JsonObject | undefined;
47
+ readonly transition: {
48
+ readonly generation: number;
49
+ readonly target: PreparedPublication | undefined;
50
+ readonly active: boolean;
51
+ };
52
+ readonly disposed: boolean;
53
+ }
54
+ //#endregion
55
+ //#region src/prepared/controller.d.ts
56
+ declare class PreparedStateController {
57
+ #private;
58
+ constructor(port: PreparedStatePort, signal?: AbortSignal);
59
+ snapshot(): PreparedStateSnapshot;
60
+ start(publication: PreparedPublication, signal?: AbortSignal): Promise<void>;
61
+ updateInputs(patch: JsonObject, signal?: AbortSignal): Promise<void>;
62
+ updateControl(objectId: string, value: JsonValue, signal?: AbortSignal): Promise<boolean>;
63
+ updateQuery(query: string, signal?: AbortSignal): Promise<boolean>;
64
+ replacePublication(publication: PreparedPublication, signal?: AbortSignal): Promise<void>;
65
+ cancel<Reason>(reason?: Reason): void;
66
+ settle(): Promise<readonly PromiseSettledResult<void>[]>;
67
+ dispose(): Promise<void>;
68
+ }
69
+ //#endregion
70
+ //#region src/prepared/refresh.d.ts
71
+ interface PreparedPublicationRefreshDependencies {
72
+ fetchManifest(url: URL, options?: PreparedManifestFetchOptions): Promise<PreparedExportManifest>;
73
+ openPublication(manifest: PreparedExportManifest, manifestUrl: URL, options?: OpenPreparedPublicationOptions): Promise<PreparedPublication>;
74
+ }
75
+ interface PreparedPublicationRefreshOptions {
76
+ readonly dependencies?: Partial<PreparedPublicationRefreshDependencies>;
77
+ readonly fetch?: typeof globalThis.fetch;
78
+ readonly openExport?: OpenPreparedPublicationOptions["openExport"];
79
+ readonly signal?: AbortSignal;
80
+ readonly onError?: (cause: unknown) => void;
81
+ }
82
+ declare class PreparedPublicationRefresh {
83
+ #private;
84
+ constructor(manifestUrl: URL, state: PreparedStateController, options?: PreparedPublicationRefreshOptions);
85
+ start(signal?: AbortSignal): Promise<void>;
86
+ refresh(signal?: AbortSignal): Promise<void>;
87
+ settle(): Promise<readonly PromiseSettledResult<void>[]>;
88
+ syncPolling(): void;
89
+ dispose(): Promise<void>;
90
+ }
91
+ //#endregion
92
+ //#region src/prepared/control.d.ts
93
+ declare const samePreparedInputs: (left: JsonObject, right: JsonObject) => boolean;
94
+ declare const preparedControlInputPatch: (inputs: JsonObject, binding: ControlBinding, value: JsonValue) => JsonObject | undefined;
95
+ //#endregion
96
+ //#region src/prepared/query.d.ts
97
+ declare const resolvePreparedQuerySelection: (notebookExport: NotebookExport, current: ExportState, query: string) => ExportState | undefined;
98
+ declare const resolvePreparedQueryState: (notebookExport: NotebookExport, current: ExportState, query: string) => ExportState;
99
+ //#endregion
100
+ //#region src/prepared/cancellation.d.ts
101
+ declare const isPreparedAbort: <Value>(value: Value) => boolean;
102
+ //#endregion
103
+ //#region src/prepared/errors.d.ts
104
+ declare const PREPARED_EXPORT_ERROR_CODES: readonly ["manifest_invalid", "manifest_read_failed", "query_ambiguous", "query_miss"];
105
+ type PreparedExportErrorCode = (typeof PREPARED_EXPORT_ERROR_CODES)[number];
106
+ interface PreparedExportErrorOptions {
107
+ readonly cause?: unknown;
108
+ }
109
+ declare class PreparedExportError extends Error {
110
+ readonly code: PreparedExportErrorCode;
111
+ readonly cause: unknown;
112
+ constructor(code: PreparedExportErrorCode, message: string, options?: PreparedExportErrorOptions);
113
+ }
114
+ declare const isPreparedExportError: <Value>(value: Value) => value is Value & PreparedExportError;
115
+ //#endregion
116
+ export { type OpenPreparedPublicationOptions, PreparedExportError, type PreparedExportErrorCode, type PreparedExportManifest, type PreparedManifestFetchOptions, type PreparedPublication, PreparedPublicationRefresh, type PreparedPublicationRefreshDependencies, type PreparedPublicationRefreshOptions, type PreparedStateChange, type PreparedStateChangeReason, PreparedStateController, type PreparedStatePort, type PreparedStateSnapshot, fetchPreparedExportManifest, isPreparedAbort, isPreparedExportError, openPreparedPublication, parsePreparedExportManifest, preparedControlInputPatch, resolvePreparedPublication, resolvePreparedQuerySelection, resolvePreparedQueryState, samePreparedInputs };