@appcorp/fusion-storybook 0.4.15 → 0.4.16
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/base-modules/admission/context/use-admission-module.d.ts +1 -1
- package/base-modules/admission/context/use-admission-module.js +20 -8
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/package.json +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/compress-pdf.d.ts +6 -0
- package/utils/compress-pdf.js +19 -0
- package/utils/wake-storage.d.ts +1 -0
- package/utils/wake-storage.js +8 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MAX_DOCUMENT_SIZE_BYTES: number;
|
|
2
|
+
export declare class DocumentTooLargeError extends Error {
|
|
3
|
+
constructor(fileName: string, sizeBytes: number);
|
|
4
|
+
}
|
|
5
|
+
export declare const isPdfFile: (file: File) => boolean;
|
|
6
|
+
export declare function compressPdf(file: File): Promise<File>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { compressMax } from "@quicktoolsone/pdf-compress";
|
|
2
|
+
export const MAX_DOCUMENT_SIZE_BYTES = 1024 * 1024; // 1MB
|
|
3
|
+
export class DocumentTooLargeError extends Error {
|
|
4
|
+
constructor(fileName, sizeBytes) {
|
|
5
|
+
super(`Document exceeds 1MB limit: ${fileName} (${sizeBytes} bytes)`);
|
|
6
|
+
this.name = "DocumentTooLargeError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export const isPdfFile = (file) => file.type === "application/pdf";
|
|
10
|
+
export async function compressPdf(file) {
|
|
11
|
+
try {
|
|
12
|
+
const buffer = await file.arrayBuffer();
|
|
13
|
+
const result = await compressMax(buffer);
|
|
14
|
+
return new File([result.pdf], file.name, { type: "application/pdf" });
|
|
15
|
+
}
|
|
16
|
+
catch (_a) {
|
|
17
|
+
return file;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const wakeStorageServer: () => void;
|