@expresscsv/react 1.5.0 → 1.6.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 +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ function App() {
|
|
|
43
43
|
|
|
44
44
|
const handleImport = () => {
|
|
45
45
|
open({
|
|
46
|
-
chunkSize: { unit: "
|
|
46
|
+
chunkSize: { unit: "rows", value: 1000 },
|
|
47
47
|
onData: async (chunk, next) => {
|
|
48
48
|
console.log(
|
|
49
49
|
`Chunk ${chunk.chunkIndex + 1}/${chunk.totalChunks}`
|
|
@@ -281,7 +281,7 @@ ExpressCSV delivers imported data through `onData`. Your app receives validated
|
|
|
281
281
|
|
|
282
282
|
```tsx
|
|
283
283
|
open({
|
|
284
|
-
chunkSize: { unit: "
|
|
284
|
+
chunkSize: { unit: "rows", value: 1000 },
|
|
285
285
|
onData: async (chunk, next) => {
|
|
286
286
|
const response = await fetch("/your-api/import-users/chunks", {
|
|
287
287
|
method: "POST",
|
|
@@ -450,7 +450,7 @@ Options passed to `open()`.
|
|
|
450
450
|
| Option | Type | Required | Description |
|
|
451
451
|
|---|---|---|---|
|
|
452
452
|
| `onData` | `(chunk: RecordsChunk<T>, next: () => void) => void` | Yes | Callback for each delivered chunk. Call `next()` after your backend accepts the current chunk. |
|
|
453
|
-
| `chunkSize` | `ChunkSize` | No | Delivery packet size. Defaults to `{ unit: "
|
|
453
|
+
| `chunkSize` | `ChunkSize` | No | Delivery packet size. Defaults to `{ unit: "rows", value: 1000 }`. `kb` uses decimal kilobytes (`1 KB = 1000 bytes`). Use `{ unit: "kb", value: 500 }` for KB or `{ unit: "rows", value: 1000 }` for row counts. Zero or negative values send all records in one chunk. |
|
|
454
454
|
| `onComplete` | `(context: { sessionId: string }) => void` | No | Called when all chunks have been processed |
|
|
455
455
|
| `onCancel` | `(context: { sessionId: string }) => void` | No | Called when the user cancels the import |
|
|
456
456
|
| `onError` | `(error: Error, context: { sessionId: string }) => void` | No | Called when an error occurs |
|
package/dist/index.d.cts
CHANGED
|
@@ -3586,7 +3586,7 @@ declare interface MultiselectOptions {
|
|
|
3586
3586
|
export declare type OpenOptions<T> = {
|
|
3587
3587
|
/** Callback for processing delivered chunks */
|
|
3588
3588
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3589
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3589
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3590
3590
|
chunkSize?: ChunkSize;
|
|
3591
3591
|
/** Called when all chunks have been processed */
|
|
3592
3592
|
onComplete?: (context: ImportDeliveryContext) => void;
|
package/dist/index.d.mts
CHANGED
|
@@ -3586,7 +3586,7 @@ declare interface MultiselectOptions {
|
|
|
3586
3586
|
export declare type OpenOptions<T> = {
|
|
3587
3587
|
/** Callback for processing delivered chunks */
|
|
3588
3588
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3589
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3589
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3590
3590
|
chunkSize?: ChunkSize;
|
|
3591
3591
|
/** Called when all chunks have been processed */
|
|
3592
3592
|
onComplete?: (context: ImportDeliveryContext) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -3586,7 +3586,7 @@ declare interface MultiselectOptions {
|
|
|
3586
3586
|
export declare type OpenOptions<T> = {
|
|
3587
3587
|
/** Callback for processing delivered chunks */
|
|
3588
3588
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3589
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3589
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3590
3590
|
chunkSize?: ChunkSize;
|
|
3591
3591
|
/** Called when all chunks have been processed */
|
|
3592
3592
|
onComplete?: (context: ImportDeliveryContext) => void;
|