Added Type for the real useages of pdf Operations
This commit is contained in:
@@ -11,7 +11,7 @@ import { splitOn } from './functions/splitOn';
|
||||
import { splitPDF } from './functions/splitPDF';
|
||||
import { updateMetadata } from "./functions/updateMetadata";
|
||||
|
||||
export default {
|
||||
const toExport = {
|
||||
sortPagesWithPreset, rearrangePages, selectPages, removePages, removeBlankPages,
|
||||
impose,
|
||||
mergePDFs,
|
||||
@@ -21,4 +21,12 @@ export default {
|
||||
splitOn,
|
||||
splitPDF,
|
||||
updateMetadata,
|
||||
}
|
||||
}
|
||||
export default toExport;
|
||||
|
||||
// Overide fields in the type of toExport, with the given fields and types. This seems to magically work!
|
||||
// https://dev.to/vborodulin/ts-how-to-override-properties-with-type-intersection-554l
|
||||
type Override<T1, T2> = Omit<T1, keyof T2> & T2;
|
||||
export type OperationsUseages = Override<typeof toExport, {
|
||||
impose: (snapshot: any, nup: number, format: string) => any;
|
||||
}>;
|
||||
Reference in New Issue
Block a user