implements page-numbers-plan
This commit is contained in:
1 parent
39da8dac4d
commit
b5279434b2
19 files changed
+1823
-339
No files matched your search
+7
-3
@@ -12,8 +12,11 @@ export type BatchItem = {
|
||||
export type BatchProcessResult = { bytes: Uint8Array; name: string };
|
||||
|
||||
export type BatchRunOptions = {
|
||||
/** Error message written to a row when `process` throws for it. */
|
||||
errorMessage?: string;
|
||||
/**
|
||||
* Error message written to a row when `process` throws for it. A function
|
||||
* receives the thrown error so tools can surface a specific German message.
|
||||
*/
|
||||
errorMessage?: string | ((error: unknown, file: File) => string);
|
||||
/**
|
||||
* Optional predicate consulted before each item; when it returns `false`
|
||||
* (for example because the row was removed mid-run), the item is skipped.
|
||||
@@ -58,7 +61,8 @@ export const runBatch = async (
|
||||
status: 'error',
|
||||
resultBytes: undefined,
|
||||
resultName: undefined,
|
||||
errorMessage
|
||||
errorMessage:
|
||||
typeof errorMessage === 'function' ? errorMessage(error, item.file) : errorMessage
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user