@vue-pdf-viewer/annotation 1.3.0 → 1.4.0-beta.1

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.
@@ -0,0 +1,37 @@
1
+ /**
2
+ * File size validation and conversion utility
3
+ * Converts human-readable file size strings to bytes
4
+ */
5
+ export interface FileSizeValidationResult {
6
+ isValid: boolean;
7
+ bytes: number;
8
+ error?: string;
9
+ }
10
+ /**
11
+ * Validates and converts a file size string to bytes
12
+ *
13
+ * @param sizeInput - Size string (e.g., "10MB", "1.5G", "512", "500KB")
14
+ * @returns Validation result with bytes value or error
15
+ *
16
+ * @example
17
+ * validateFileSize("10MB") // { isValid: true, bytes: 10485760 }
18
+ * validateFileSize("1.5G") // { isValid: true, bytes: 1610612736 }
19
+ * validateFileSize("invalid") // { isValid: false, bytes: 0, error: "Invalid format" }
20
+ */
21
+ export declare function validateFileSize(sizeInput: string): FileSizeValidationResult;
22
+ /**
23
+ * Converts bytes to human-readable format
24
+ *
25
+ * @param bytes - Number of bytes
26
+ * @param decimals - Number of decimal places (default: 1)
27
+ * @returns Formatted string (e.g., "10.5 MB", "1.2 GB")
28
+ */
29
+ export declare function formatBytes(bytes: number, decimals?: number): string;
30
+ /**
31
+ * Convenience function that throws an error if validation fails
32
+ *
33
+ * @param sizeInput - Size string to validate
34
+ * @returns Number of bytes
35
+ * @throws Error if validation fails
36
+ */
37
+ export declare function parseFileSize(sizeInput: string): number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/annotation",
3
3
  "private": false,
4
- "version": "1.3.0",
4
+ "version": "1.4.0-beta.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@pdf-viewer/pdf": "1.1.0",
34
- "@vue-pdf-viewer/shared": "1.3.1",
34
+ "@vue-pdf-viewer/shared": "1.4.0-beta.7",
35
35
  "vite-plugin-css-injected-by-js": "^3.5.2",
36
36
  "vue": "^3.2.37"
37
37
  },