@embedpdf/models 1.3.0 → 1.3.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.
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pdf.d.ts +41 -1
- package/package.json +1 -1
package/dist/pdf.d.ts
CHANGED
|
@@ -1735,7 +1735,10 @@ export type PdfAnnotationObject = PdfSupportedAnnoObject | PdfUnsupportedAnnoObj
|
|
|
1735
1735
|
export interface PdfAttachmentObject {
|
|
1736
1736
|
index: number;
|
|
1737
1737
|
name: string;
|
|
1738
|
-
|
|
1738
|
+
description: string;
|
|
1739
|
+
mimeType: string;
|
|
1740
|
+
size?: number;
|
|
1741
|
+
creationDate?: Date;
|
|
1739
1742
|
checksum: string;
|
|
1740
1743
|
}
|
|
1741
1744
|
/**
|
|
@@ -2245,6 +2248,27 @@ export interface PdfPrintOptions {
|
|
|
2245
2248
|
*/
|
|
2246
2249
|
pageRange?: string;
|
|
2247
2250
|
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Parameters for adding an attachment to a PDF document
|
|
2253
|
+
*/
|
|
2254
|
+
export interface PdfAddAttachmentParams {
|
|
2255
|
+
/**
|
|
2256
|
+
* Name of the attachment
|
|
2257
|
+
*/
|
|
2258
|
+
name: string;
|
|
2259
|
+
/**
|
|
2260
|
+
* Description of the attachment
|
|
2261
|
+
*/
|
|
2262
|
+
description: string;
|
|
2263
|
+
/**
|
|
2264
|
+
* MIME type of the attachment
|
|
2265
|
+
*/
|
|
2266
|
+
mimeType: string;
|
|
2267
|
+
/**
|
|
2268
|
+
* Data of the attachment
|
|
2269
|
+
*/
|
|
2270
|
+
data: ArrayBuffer | Uint8Array;
|
|
2271
|
+
}
|
|
2248
2272
|
/**
|
|
2249
2273
|
* Pdf engine
|
|
2250
2274
|
*
|
|
@@ -2427,6 +2451,22 @@ export interface PdfEngine<T = Blob> {
|
|
|
2427
2451
|
* @returns task that contains the attachments or error
|
|
2428
2452
|
*/
|
|
2429
2453
|
getAttachments: (doc: PdfDocumentObject) => PdfTask<PdfAttachmentObject[]>;
|
|
2454
|
+
/**
|
|
2455
|
+
* Add a attachment to the file
|
|
2456
|
+
/**
|
|
2457
|
+
* @param doc - pdf document
|
|
2458
|
+
* @param attachment - pdf attachment
|
|
2459
|
+
* @returns task that contains the attachment or error
|
|
2460
|
+
*/
|
|
2461
|
+
addAttachment: (doc: PdfDocumentObject, params: PdfAddAttachmentParams) => PdfTask<boolean>;
|
|
2462
|
+
/**
|
|
2463
|
+
* Remove a attachment from the file
|
|
2464
|
+
/**
|
|
2465
|
+
* @param doc - pdf document
|
|
2466
|
+
* @param attachment - pdf attachment
|
|
2467
|
+
* @returns task that contains the attachment or error
|
|
2468
|
+
*/
|
|
2469
|
+
removeAttachment: (doc: PdfDocumentObject, attachment: PdfAttachmentObject) => PdfTask<boolean>;
|
|
2430
2470
|
/**
|
|
2431
2471
|
* Read content of pdf attachment
|
|
2432
2472
|
* @param doc - pdf document
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/models",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared type definitions, data models, and utility helpers (geometry, tasks, logging, PDF primitives) that underpin every package in the EmbedPDF ecosystem.",
|
|
6
6
|
"type": "module",
|