pivotkit-react 0.3.0 → 0.5.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +339 -1
  2. package/README.md +2 -2
  3. package/dist/chunks/{chunk-IOPAM4JD.js → chunk-2AT72SLA.js} +635 -980
  4. package/dist/chunks/chunk-3E4NB5RZ.js +215 -0
  5. package/dist/chunks/{chunk-32Z33U6S.js → chunk-3WUGQPWV.js} +106 -9
  6. package/dist/chunks/{chunk-7CC4JHDY.js → chunk-4RS72AAA.js} +27 -8
  7. package/dist/chunks/{chunk-EM23V5GH.js → chunk-E6M57YLL.js} +19 -8
  8. package/dist/chunks/{chunk-RWYHJRQO.js → chunk-JMRTIOX4.js} +17 -7
  9. package/dist/chunks/chunk-RIOSIYGC.js +665 -0
  10. package/dist/chunks/{chunk-APB4NW4O.js → chunk-U5Q5I2D5.js} +36 -10
  11. package/dist/chunks/report-run-BZBFOMPF.js +12 -0
  12. package/dist/chunks/{unused-texts-K3VFH65P.js → unused-texts-Y4R67XSN.js} +1 -1
  13. package/dist/chunks/{unused-texts-de-OW4TGIVX.js → unused-texts-de-6YVPTNVS.js} +1 -1
  14. package/dist/echarts.js +38 -156
  15. package/dist/import-ui.js +765 -0
  16. package/dist/import-worker.js +20 -0
  17. package/dist/index.js +683 -244
  18. package/dist/labels.js +14 -10
  19. package/dist/menu-texts-de.js +1 -1
  20. package/dist/menus.js +768 -299
  21. package/dist/styles.css +322 -100
  22. package/package.json +9 -4
  23. package/types/chart-decorate.d.ts +28 -4
  24. package/types/chart-types.d.ts +2 -4
  25. package/types/data-history.d.ts +85 -0
  26. package/types/data-keep.d.ts +51 -0
  27. package/types/data-menu.d.ts +11 -0
  28. package/types/dom.d.ts +40 -7
  29. package/types/echarts.d.ts +1 -1
  30. package/types/export-run.d.ts +37 -3
  31. package/types/field-info.d.ts +32 -0
  32. package/types/filter.d.ts +1 -1
  33. package/types/icons.d.ts +1 -0
  34. package/types/import-host.d.ts +53 -0
  35. package/types/import-labels.d.ts +401 -0
  36. package/types/import-limits.d.ts +6 -0
  37. package/types/import-module.d.ts +2 -0
  38. package/types/import-run.d.ts +73 -0
  39. package/types/import-source.d.ts +32 -0
  40. package/types/import-steps.d.ts +121 -0
  41. package/types/import-ui.d.ts +108 -0
  42. package/types/import-worker.d.ts +1 -0
  43. package/types/index.d.ts +81 -11
  44. package/types/labels.d.ts +224 -4
  45. package/types/lazy-import.d.ts +4 -0
  46. package/types/lazy-menus.d.ts +2 -2
  47. package/types/levels.d.ts +3 -2
  48. package/types/light-tokens.d.ts +16 -0
  49. package/types/menu-labels.d.ts +37 -17
  50. package/types/menu-ops.d.ts +161 -40
  51. package/types/menu-topics.d.ts +9 -8
  52. package/types/menus.d.ts +1 -0
  53. package/types/names.d.ts +47 -19
  54. package/types/overflow.d.ts +29 -17
  55. package/types/place.d.ts +24 -0
  56. package/types/popover.d.ts +47 -5
  57. package/types/print-frame.d.ts +24 -0
  58. package/types/report-run.d.ts +14 -0
  59. package/types/section.d.ts +2 -2
  60. package/types/share-actions.d.ts +3 -3
  61. package/types/share.d.ts +13 -17
  62. package/types/theme.d.ts +2 -16
  63. package/types/tips.d.ts +5 -0
  64. package/types/toasts.d.ts +1 -1
  65. package/types/toolbar-panels.d.ts +11 -9
  66. package/types/unused-keep.d.ts +20 -0
  67. package/types/unused-texts.d.ts +13 -3
  68. package/types/unused.d.ts +1 -0
  69. package/types/use-export.d.ts +2 -2
  70. package/types/use-view-history.d.ts +12 -4
  71. package/types/view-ops.d.ts +65 -6
  72. package/types/virtual.d.ts +15 -0
  73. package/types/chart-layout.d.ts +0 -111
@@ -0,0 +1,401 @@
1
+ export declare const en: {
2
+ dataSource: string;
3
+ hostData: string;
4
+ rows: {
5
+ one: string;
6
+ other: string;
7
+ };
8
+ columns: {
9
+ one: string;
10
+ other: string;
11
+ };
12
+ fromFile: string;
13
+ load: string;
14
+ loadFile: string;
15
+ backToOriginal: string;
16
+ backHint: string;
17
+ dropHint: string;
18
+ formats: string;
19
+ formatNames: {
20
+ csv: string;
21
+ json: string;
22
+ xlsx: string;
23
+ };
24
+ dropTitle: string;
25
+ dropOne: string;
26
+ reading: string;
27
+ phases: {
28
+ read: string;
29
+ unpack: string;
30
+ parse: string;
31
+ type: string;
32
+ };
33
+ cancel: string;
34
+ previewTitle: string;
35
+ sheet: string;
36
+ hiddenSheet: string;
37
+ firstRows: string;
38
+ someColumns: string;
39
+ typeOf: string;
40
+ types: {
41
+ string: string;
42
+ number: string;
43
+ date: string;
44
+ boolean: string;
45
+ };
46
+ yes: string;
47
+ no: string;
48
+ noRows: string;
49
+ notesTitle: {
50
+ one: string;
51
+ other: string;
52
+ };
53
+ apply: string;
54
+ loaded: string;
55
+ stepLoaded: string;
56
+ originalShown: string;
57
+ failed: string;
58
+ refused: string;
59
+ overLimit: string;
60
+ limitWhat: {
61
+ rows: string;
62
+ columns: string;
63
+ fileBytes: string;
64
+ importCells: string;
65
+ archiveEntries: string;
66
+ unpackedBytes: string;
67
+ };
68
+ sourceLine: string;
69
+ sourceSheet: string;
70
+ notes: {
71
+ ENCODING: string;
72
+ SEPARATOR: string;
73
+ LINES_SKIPPED: {
74
+ one: string;
75
+ other: string;
76
+ };
77
+ COLUMN_RENAMED: string;
78
+ COLUMN_UNNAMED: string;
79
+ COLUMNS_RENAMED_MORE: {
80
+ one: string;
81
+ other: string;
82
+ };
83
+ COLUMN_DROPPED: string;
84
+ COLUMNS_ADDED: {
85
+ one: string;
86
+ other: string;
87
+ };
88
+ ROWS_EMPTY: {
89
+ one: string;
90
+ other: string;
91
+ };
92
+ TEXT_CUT: {
93
+ one: string;
94
+ other: string;
95
+ };
96
+ CHARACTERS_REMOVED: {
97
+ one: string;
98
+ other: string;
99
+ };
100
+ DATE_ORDER: string;
101
+ VALUES_NOT_CONVERTED: {
102
+ one: string;
103
+ other: string;
104
+ };
105
+ JSON_PROPERTY: string;
106
+ JSON_FLATTENED: string;
107
+ SHEET: string;
108
+ SHEETS: string;
109
+ USED_RANGE: string;
110
+ ERROR_CELLS: {
111
+ one: string;
112
+ other: string;
113
+ };
114
+ };
115
+ dateOrders: {
116
+ dmy: string;
117
+ mdy: string;
118
+ };
119
+ };
120
+ export type ImportTexts = typeof en;
121
+ /** @typedef {typeof en} ImportTexts */
122
+ /** @type {ImportTexts} */
123
+ export declare const de: ImportTexts;
124
+ /** The import texts of each language. */
125
+ export declare const IMPORT_TEXTS: Readonly<{
126
+ en: {
127
+ dataSource: string;
128
+ hostData: string;
129
+ rows: {
130
+ one: string;
131
+ other: string;
132
+ };
133
+ columns: {
134
+ one: string;
135
+ other: string;
136
+ };
137
+ fromFile: string;
138
+ load: string;
139
+ loadFile: string;
140
+ backToOriginal: string;
141
+ backHint: string;
142
+ dropHint: string;
143
+ formats: string;
144
+ formatNames: {
145
+ csv: string;
146
+ json: string;
147
+ xlsx: string;
148
+ };
149
+ dropTitle: string;
150
+ dropOne: string;
151
+ reading: string;
152
+ phases: {
153
+ read: string;
154
+ unpack: string;
155
+ parse: string;
156
+ type: string;
157
+ };
158
+ cancel: string;
159
+ previewTitle: string;
160
+ sheet: string;
161
+ hiddenSheet: string;
162
+ firstRows: string;
163
+ someColumns: string;
164
+ typeOf: string;
165
+ types: {
166
+ string: string;
167
+ number: string;
168
+ date: string;
169
+ boolean: string;
170
+ };
171
+ yes: string;
172
+ no: string;
173
+ noRows: string;
174
+ notesTitle: {
175
+ one: string;
176
+ other: string;
177
+ };
178
+ apply: string;
179
+ loaded: string;
180
+ stepLoaded: string;
181
+ originalShown: string;
182
+ failed: string;
183
+ refused: string;
184
+ overLimit: string;
185
+ limitWhat: {
186
+ rows: string;
187
+ columns: string;
188
+ fileBytes: string;
189
+ importCells: string;
190
+ archiveEntries: string;
191
+ unpackedBytes: string;
192
+ };
193
+ sourceLine: string;
194
+ sourceSheet: string;
195
+ notes: {
196
+ ENCODING: string;
197
+ SEPARATOR: string;
198
+ LINES_SKIPPED: {
199
+ one: string;
200
+ other: string;
201
+ };
202
+ COLUMN_RENAMED: string;
203
+ COLUMN_UNNAMED: string;
204
+ COLUMNS_RENAMED_MORE: {
205
+ one: string;
206
+ other: string;
207
+ };
208
+ COLUMN_DROPPED: string;
209
+ COLUMNS_ADDED: {
210
+ one: string;
211
+ other: string;
212
+ };
213
+ ROWS_EMPTY: {
214
+ one: string;
215
+ other: string;
216
+ };
217
+ TEXT_CUT: {
218
+ one: string;
219
+ other: string;
220
+ };
221
+ CHARACTERS_REMOVED: {
222
+ one: string;
223
+ other: string;
224
+ };
225
+ DATE_ORDER: string;
226
+ VALUES_NOT_CONVERTED: {
227
+ one: string;
228
+ other: string;
229
+ };
230
+ JSON_PROPERTY: string;
231
+ JSON_FLATTENED: string;
232
+ SHEET: string;
233
+ SHEETS: string;
234
+ USED_RANGE: string;
235
+ ERROR_CELLS: {
236
+ one: string;
237
+ other: string;
238
+ };
239
+ };
240
+ dateOrders: {
241
+ dmy: string;
242
+ mdy: string;
243
+ };
244
+ };
245
+ de: {
246
+ dataSource: string;
247
+ hostData: string;
248
+ rows: {
249
+ one: string;
250
+ other: string;
251
+ };
252
+ columns: {
253
+ one: string;
254
+ other: string;
255
+ };
256
+ fromFile: string;
257
+ load: string;
258
+ loadFile: string;
259
+ backToOriginal: string;
260
+ backHint: string;
261
+ dropHint: string;
262
+ formats: string;
263
+ formatNames: {
264
+ csv: string;
265
+ json: string;
266
+ xlsx: string;
267
+ };
268
+ dropTitle: string;
269
+ dropOne: string;
270
+ reading: string;
271
+ phases: {
272
+ read: string;
273
+ unpack: string;
274
+ parse: string;
275
+ type: string;
276
+ };
277
+ cancel: string;
278
+ previewTitle: string;
279
+ sheet: string;
280
+ hiddenSheet: string;
281
+ firstRows: string;
282
+ someColumns: string;
283
+ typeOf: string;
284
+ types: {
285
+ string: string;
286
+ number: string;
287
+ date: string;
288
+ boolean: string;
289
+ };
290
+ yes: string;
291
+ no: string;
292
+ noRows: string;
293
+ notesTitle: {
294
+ one: string;
295
+ other: string;
296
+ };
297
+ apply: string;
298
+ loaded: string;
299
+ stepLoaded: string;
300
+ originalShown: string;
301
+ failed: string;
302
+ refused: string;
303
+ overLimit: string;
304
+ limitWhat: {
305
+ rows: string;
306
+ columns: string;
307
+ fileBytes: string;
308
+ importCells: string;
309
+ archiveEntries: string;
310
+ unpackedBytes: string;
311
+ };
312
+ sourceLine: string;
313
+ sourceSheet: string;
314
+ notes: {
315
+ ENCODING: string;
316
+ SEPARATOR: string;
317
+ LINES_SKIPPED: {
318
+ one: string;
319
+ other: string;
320
+ };
321
+ COLUMN_RENAMED: string;
322
+ COLUMN_UNNAMED: string;
323
+ COLUMNS_RENAMED_MORE: {
324
+ one: string;
325
+ other: string;
326
+ };
327
+ COLUMN_DROPPED: string;
328
+ COLUMNS_ADDED: {
329
+ one: string;
330
+ other: string;
331
+ };
332
+ ROWS_EMPTY: {
333
+ one: string;
334
+ other: string;
335
+ };
336
+ TEXT_CUT: {
337
+ one: string;
338
+ other: string;
339
+ };
340
+ CHARACTERS_REMOVED: {
341
+ one: string;
342
+ other: string;
343
+ };
344
+ DATE_ORDER: string;
345
+ VALUES_NOT_CONVERTED: {
346
+ one: string;
347
+ other: string;
348
+ };
349
+ JSON_PROPERTY: string;
350
+ JSON_FLATTENED: string;
351
+ SHEET: string;
352
+ SHEETS: string;
353
+ USED_RANGE: string;
354
+ ERROR_CELLS: {
355
+ one: string;
356
+ other: string;
357
+ };
358
+ };
359
+ dateOrders: {
360
+ dmy: string;
361
+ mdy: string;
362
+ };
363
+ };
364
+ }>;
365
+ /**
366
+ * The import texts of the report's language (English for a language of a host's own), a host's own
367
+ * texts (`labels.dataImport`, kept aside by resolveLabels) merged over them.
368
+ * @param {import("./labels.js").UiLabels} labels
369
+ * @returns {ImportTexts}
370
+ */
371
+ export declare function importLabels(labels: import("./labels.js").UiLabels): ImportTexts;
372
+ /**
373
+ * A reader's note in the report's language: the text of its code with its params (numbers in the
374
+ * locale's digits, a count in its plural form), else the reader's own English message (a plugin's
375
+ * code this version has no text for). Params come from the file: text, never markup.
376
+ * @param {{ code: string, params?: Record<string, unknown>, message?: string }} note
377
+ * @param {ImportTexts} texts
378
+ * @param {{ lang: string, locale: string }} where
379
+ */
380
+ export declare function noteText(note: {
381
+ code: string;
382
+ params?: Record<string, unknown>;
383
+ message?: string;
384
+ }, texts: ImportTexts, where: {
385
+ lang: string;
386
+ locale: string;
387
+ }): string;
388
+ /**
389
+ * Why a file could not be read, after "{name} could not be loaded:", which names the file: a limit of
390
+ * pivotkit-core (`LIMIT_EXCEEDED` with a limit this version has words for) in the report's language
391
+ * with its key (`limits.rows`, whose words fit `importLimits` too), else the reader's own English
392
+ * message without the file's name in front (`"name": ` of `fileError`, `"name" ` of `limitError`).
393
+ * @param {unknown} error
394
+ * @param {string} name the file's name
395
+ * @param {ImportTexts} texts
396
+ * @param {{ lang: string, locale: string }} where
397
+ */
398
+ export declare function errorText(error: unknown, name: string, texts: ImportTexts, where: {
399
+ lang: string;
400
+ locale: string;
401
+ }): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param {unknown} limits the host's `limits`
3
+ * @param {unknown} importLimits the host's `importLimits`
4
+ * @returns {Partial<import("pivotkit-core").Limits> | undefined} to pass as `options.limits`
5
+ */
6
+ export declare function importLimitsOf(limits: unknown, importLimits: unknown): Partial<import("pivotkit-core").Limits> | undefined;
@@ -0,0 +1,2 @@
1
+ export { DataMenuPanel, ImportLayer, SourceLine, pickFile, startFiles } from "./import-host.jsx";
2
+ export { moveData, restoreData } from "./import-steps.js";
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The accept attribute of the file input: every extension and media type the readers take, the
3
+ * host's plugins first. Plugins that fail validatePlugin are left out (the read says why).
4
+ * @param {readonly any[]} plugins
5
+ */
6
+ export declare function acceptOf(plugins: readonly any[]): string;
7
+ /**
8
+ * The names of the formats the report reads, for "CSV or text, JSON, Excel workbook": a reader's name
9
+ * in the report's language where `names` has it (the built-in readers and pivotkit-xlsx), else the
10
+ * plugin's own label.
11
+ * @param {readonly any[]} plugins
12
+ * @param {Record<string, string>} [names] by the reader's `name`
13
+ */
14
+ export declare const formatsOf: (plugins: readonly any[], names?: Record<string, string>) => any[];
15
+ /** How long a worker may take to say it is ready before the page reads the file itself (ms). */
16
+ export declare const WORKER_READY_MS = 10000;
17
+ /**
18
+ * A reader's table as the import UI uses it: what checkTable of pivotkit-core does not ask for, but
19
+ * retype and the preview need, filled in from what is there (a plugin may return the minimal shape),
20
+ * and notes that are no `{ code, params }` left out.
21
+ * @param {any} table
22
+ * @returns {import("pivotkit-core/import").ImportTable}
23
+ */
24
+ export declare function completeTable(table: any): import("pivotkit-core/import").ImportTable;
25
+ export type ImportRead = {
26
+ /**
27
+ * the host's reader plugins
28
+ */
29
+ plugins?: any[];
30
+ /**
31
+ * starts the host's import worker
32
+ */
33
+ worker?: (() => Worker) | undefined;
34
+ sheet?: string | number;
35
+ locale?: string;
36
+ limits?: object;
37
+ signal?: AbortSignal;
38
+ onProgress?: (p: import("pivotkit-core/import").ImportProgress) => void;
39
+ /**
40
+ * how long the worker may take to start (WORKER_READY_MS; tests)
41
+ */
42
+ readyMs?: number;
43
+ };
44
+ /**
45
+ * @typedef {object} ImportRead
46
+ * @property {any[]} [plugins] the host's reader plugins
47
+ * @property {(() => Worker) | undefined} [worker] starts the host's import worker
48
+ * @property {string | number} [sheet]
49
+ * @property {string} [locale]
50
+ * @property {object} [limits]
51
+ * @property {AbortSignal} [signal]
52
+ * @property {(p: import("pivotkit-core/import").ImportProgress) => void} [onProgress]
53
+ * @property {number} [readyMs] how long the worker may take to start (WORKER_READY_MS; tests)
54
+ */
55
+ /**
56
+ * Reads a file into pivotkit-core/import's table: in the host's worker when the reader is a built-in
57
+ * one and the worker starts, else on the page.
58
+ * @param {File} file
59
+ * @param {ImportRead} options
60
+ * @returns {Promise<import("pivotkit-core/import").ImportTable>}
61
+ */
62
+ export declare function readImport(file: File, { plugins, worker, sheet, locale, limits, signal, onProgress, readyMs }?: ImportRead): Promise<import("pivotkit-core/import").ImportTable>;
63
+ /**
64
+ * The sheets of a file whose reader has several (a workbook), or [] for one table.
65
+ * @param {File} file
66
+ * @param {{ plugins?: any[], limits?: object, signal?: AbortSignal }} options
67
+ * @returns {Promise<import("pivotkit-core/import").SheetInfo[]>}
68
+ */
69
+ export declare function sheetsOf(file: File, { plugins, limits, signal }?: {
70
+ plugins?: any[];
71
+ limits?: object;
72
+ signal?: AbortSignal;
73
+ }): Promise<import("pivotkit-core/import").SheetInfo[]>;
@@ -0,0 +1,32 @@
1
+ /** Characters of a file name in the source id and the report's source line. */
2
+ export declare const SHOWN_MAX = 120;
3
+ /**
4
+ * The name as the report shows it: at most SHOWN_MAX characters, cut with "...".
5
+ * @param {string} name
6
+ */
7
+ export declare function shownName(name: string): string;
8
+ /**
9
+ * SHA-256 of bytes, in JavaScript (where crypto.subtle is missing).
10
+ * @param {Uint8Array} bytes
11
+ * @returns {Uint8Array}
12
+ */
13
+ export declare function sha256Bytes(bytes: Uint8Array): Uint8Array;
14
+ /**
15
+ * SHA-256 of a text (UTF-8) as lower-case hex: the browser's crypto.subtle where there is one.
16
+ * @param {string} text
17
+ * @param {{ subtle?: SubtleCrypto | null }} [options] `subtle: null` uses the own implementation (tests)
18
+ * @returns {Promise<string>}
19
+ */
20
+ export declare function sha256Hex(text: string, options?: {
21
+ subtle?: SubtleCrypto | null;
22
+ }): Promise<string>;
23
+ /**
24
+ * The source id of a loaded file: its shown name, "#" and 16 hex digits of the SHA-256 of its whole
25
+ * name and its column names in their order, joined with U+0000.
26
+ * @param {string} name
27
+ * @param {readonly string[]} columns
28
+ * @param {{ subtle?: SubtleCrypto | null }} [options]
29
+ */
30
+ export declare function sourceIdOf(name: string, columns: readonly string[], options?: {
31
+ subtle?: SubtleCrypto | null;
32
+ }): Promise<string>;
@@ -0,0 +1,121 @@
1
+ export type ShownData = {
2
+ /**
3
+ * names the data set for the view history (use-view-history.js: dataKey)
4
+ */
5
+ key: number;
6
+ encoded: import("pivotkit-core").Encoded;
7
+ source: {
8
+ id: string;
9
+ name: string;
10
+ };
11
+ sheet: string | null;
12
+ file: {
13
+ name: string;
14
+ size: number;
15
+ type: string;
16
+ };
17
+ };
18
+ export type ImportContext = {
19
+ /**
20
+ * the file's data shown, null for the host's
21
+ */
22
+ imported: ShownData | null;
23
+ steps: import("./data-history.js").DataSteps;
24
+ setSteps: (steps: import("./data-history.js").DataSteps) => void;
25
+ setImported: (data: ShownData | null) => void;
26
+ history: {
27
+ snapshot: () => any;
28
+ replace: (state: any) => void;
29
+ };
30
+ /**
31
+ * the host's data
32
+ */
33
+ hostEncoded: import("pivotkit-core").Encoded;
34
+ /**
35
+ * the host's `source`
36
+ */
37
+ hostSource: {
38
+ id: string;
39
+ name?: string;
40
+ } | undefined;
41
+ onDataLoad: ((detail: DataLoad) => unknown) | undefined;
42
+ labels: any;
43
+ locale: string;
44
+ announce: (text: string, extra?: {
45
+ action?: {
46
+ label: string;
47
+ run: () => void;
48
+ };
49
+ tone?: "error";
50
+ }) => void;
51
+ /**
52
+ * the report's Undo, for the status note's action
53
+ */
54
+ undo: () => void;
55
+ };
56
+ export type DataLoad = {
57
+ /**
58
+ * a file loaded (refuse it with false), the host's data shown again, Undo or Redo of one of those, or a file's data shown again by a report mounted again (data-keep.js)
59
+ */
60
+ cause: "load" | "original" | "undo" | "redo" | "restore";
61
+ /**
62
+ * the data shown now: the file's (its id names its saved views), or the host's `source`
63
+ */
64
+ source: {
65
+ id?: string;
66
+ name?: string;
67
+ } | null;
68
+ /**
69
+ * the file, for "load" and when a step shows a file's data
70
+ */
71
+ file: {
72
+ name: string;
73
+ size: number;
74
+ type: string;
75
+ } | null;
76
+ /**
77
+ * the sheet of a workbook
78
+ */
79
+ sheet: string | null;
80
+ rows: number;
81
+ columns: Array<{
82
+ name: string;
83
+ type: string;
84
+ }>;
85
+ /**
86
+ * the readers' notes ("load" only)
87
+ */
88
+ notes: Array<{
89
+ code: string;
90
+ params: Record<string, unknown>;
91
+ message: string;
92
+ }>;
93
+ };
94
+ /**
95
+ * "Load data" in the preview: the host may refuse it (onDataLoad returns false); else the file's data
96
+ * is shown, a step Undo takes back. Returns whether it was loaded.
97
+ * @param {ImportContext} ctx
98
+ * @param {import("./import-ui.jsx").LoadedData} loaded
99
+ */
100
+ export declare function loadData(ctx: ImportContext, loaded: import("./import-ui.jsx").LoadedData): boolean;
101
+ /**
102
+ * "Back to original data": the host's data with the view it had when it was left (its own steps
103
+ * stay behind: Undo brings the file back first), a step Undo takes back.
104
+ * @param {ImportContext} ctx
105
+ */
106
+ export declare function backToOriginal(ctx: ImportContext): void;
107
+ /**
108
+ * Undo (`back`) or Redo of a data step: the data and view history it kept. The note of the step, or
109
+ * null when there is none.
110
+ * @param {ImportContext} ctx
111
+ * @param {boolean} back
112
+ * @returns {string | null}
113
+ */
114
+ export declare function moveData(ctx: ImportContext, back: boolean): string | null;
115
+ /**
116
+ * A report mounted again shows the file's data it kept (data-keep.js): the host is told, as for the
117
+ * other steps, so a host that follows the data shown (and controls the view) knows the view that
118
+ * comes next is the file's.
119
+ * @param {ImportContext} ctx
120
+ */
121
+ export declare function restoreData(ctx: ImportContext): void;