@updog/data-editor 0.1.80 → 0.1.81
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/index.css +1 -1
- package/index.d.ts +28 -3
- package/index.js +12327 -11886
- package/package.json +1 -1
- package/{sheetWorkerSource.generated-BRh0-P0M.js → sheetWorkerSource.generated-LkZmDPiq.js} +1 -1
package/index.d.ts
CHANGED
|
@@ -3125,10 +3125,24 @@ type CustomImportFormat = {
|
|
|
3125
3125
|
* Returns rows, named tables, or a `File` in a format the SDK already reads.
|
|
3126
3126
|
* Throw to fail the import; the thrown message is shown to the user.
|
|
3127
3127
|
*/
|
|
3128
|
-
handle:
|
|
3129
|
-
signal: AbortSignal;
|
|
3130
|
-
}) => Promise<File | Record<string, unknown>[] | CustomImportTable[]>;
|
|
3128
|
+
handle: FileHandler;
|
|
3131
3129
|
};
|
|
3130
|
+
/**
|
|
3131
|
+
* What client code may hand back for a file the SDK will not read itself: rows,
|
|
3132
|
+
* named tables, or a `File` in a format the SDK already reads.
|
|
3133
|
+
*/
|
|
3134
|
+
type FileHandlerResult = File | Record<string, unknown>[] | CustomImportTable[];
|
|
3135
|
+
/** Claims a file by extension and turns it into tables the SDK can stage. */
|
|
3136
|
+
type FileHandler = (file: File, ctx: {
|
|
3137
|
+
signal: AbortSignal;
|
|
3138
|
+
}) => Promise<FileHandlerResult>;
|
|
3139
|
+
/**
|
|
3140
|
+
* Takes over a readable file that holds no single table. `null` declines the
|
|
3141
|
+
* file, leaving it to be staged the ordinary way.
|
|
3142
|
+
*/
|
|
3143
|
+
type UnstructuredFileHandler = (file: File, ctx: {
|
|
3144
|
+
signal: AbortSignal;
|
|
3145
|
+
}) => Promise<FileHandlerResult | null>;
|
|
3132
3146
|
/**
|
|
3133
3147
|
* Controls the initial view when the editor opens.
|
|
3134
3148
|
*
|
|
@@ -3249,6 +3263,17 @@ type DataEditorBaseProps<TRow extends DataEditorRow = DataEditorRow> = {
|
|
|
3249
3263
|
* the file and stages whatever `handle()` returns.
|
|
3250
3264
|
*/
|
|
3251
3265
|
customFormats?: CustomImportFormat[];
|
|
3266
|
+
/**
|
|
3267
|
+
* Called when a file the SDK can read turns out to hold no single table —
|
|
3268
|
+
* a report with a banner, several tables on one sheet, a sheet that is really
|
|
3269
|
+
* a document. You get the `File` and return tables, exactly as a
|
|
3270
|
+
* `customFormats` handler does.
|
|
3271
|
+
*
|
|
3272
|
+
* Return `null`, throw, or take longer than 30 seconds and the file is staged
|
|
3273
|
+
* the ordinary way, as if this prop were absent. Nothing about the file
|
|
3274
|
+
* reaches Updog.
|
|
3275
|
+
*/
|
|
3276
|
+
onUnstructuredFile?: UnstructuredFileHandler;
|
|
3252
3277
|
/**
|
|
3253
3278
|
* Which file formats the user can export to. `undefined` allows all
|
|
3254
3279
|
* formats, `false` disables export entirely.
|