@canva/design 2.7.4-beta.0 → 2.7.4-beta.2
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/beta.d.ts
CHANGED
|
@@ -2758,14 +2758,18 @@ export declare namespace DesignEditing {
|
|
|
2758
2758
|
/**
|
|
2759
2759
|
* @beta
|
|
2760
2760
|
* A reference to a page.
|
|
2761
|
+
*
|
|
2762
|
+
* @preventInline
|
|
2761
2763
|
*/
|
|
2762
2764
|
export type PageRef = AbsolutePageRef | Unsupported;
|
|
2763
2765
|
|
|
2764
2766
|
/**
|
|
2765
2767
|
* @beta
|
|
2766
2768
|
* A list containing the references to pages in the design.
|
|
2769
|
+
*
|
|
2770
|
+
* @preventInline
|
|
2767
2771
|
*/
|
|
2768
|
-
export
|
|
2772
|
+
export interface PageRefList extends ReadableList<PageRef> {}
|
|
2769
2773
|
{
|
|
2770
2774
|
}
|
|
2771
2775
|
}
|
|
@@ -3323,6 +3327,44 @@ export declare type ExportBlob = {
|
|
|
3323
3327
|
url: string;
|
|
3324
3328
|
};
|
|
3325
3329
|
|
|
3330
|
+
/**
|
|
3331
|
+
* @beta
|
|
3332
|
+
* The exported file.
|
|
3333
|
+
*/
|
|
3334
|
+
export declare type ExportBlobWithZippedOptionOutput = {
|
|
3335
|
+
/**
|
|
3336
|
+
* The URL of the exported design.
|
|
3337
|
+
*
|
|
3338
|
+
* @remarks
|
|
3339
|
+
* If a user's design contains multiple pages but is exported in a format that doesn't support multiple pages,
|
|
3340
|
+
* by defaultthis URL will point to a ZIP file that contains each page as a separate file.
|
|
3341
|
+
*
|
|
3342
|
+
* If the user has configured the export to not zip the exported files (using the `zipped` property), this URL will point to a single file.
|
|
3343
|
+
*
|
|
3344
|
+
* For example:
|
|
3345
|
+
*
|
|
3346
|
+
* - If a single-page design is exported as a JPG, the URL will point to a JPG file.
|
|
3347
|
+
* - If a multi-page design is exported as a JPG, the URL will point to a ZIP file that contains a JPG file for each page.
|
|
3348
|
+
* - If a multi-page design is exported as a JPG and the user has set `zipped` to `never` for JPGs, the URL will point to a JPG file and will be one of multiple urls in the exportBlobs array.
|
|
3349
|
+
* - If a multi-page design is exported as a PDF file, the URL will point to a PDF file.
|
|
3350
|
+
* - If a multi-page design is exported as a VIDEO file and the user has set `zipped` to `always` for VIDEOs, the URL will point to a ZIP that contains a VIDEO file.
|
|
3351
|
+
*
|
|
3352
|
+
* The following file types support multiple pages:
|
|
3353
|
+
*
|
|
3354
|
+
* - `"GIF"`
|
|
3355
|
+
* - `"PDF_STANDARD"`
|
|
3356
|
+
* - `"PPTX"`
|
|
3357
|
+
* - `"VIDEO"`
|
|
3358
|
+
*
|
|
3359
|
+
* The following file types do not support multiple pages:
|
|
3360
|
+
*
|
|
3361
|
+
* - `"JPG"`
|
|
3362
|
+
* - `"PNG"`
|
|
3363
|
+
* - `"SVG"`
|
|
3364
|
+
*/
|
|
3365
|
+
url: string;
|
|
3366
|
+
};
|
|
3367
|
+
|
|
3326
3368
|
/**
|
|
3327
3369
|
* @public
|
|
3328
3370
|
* The result when a user successfully completes an export flow.
|
|
@@ -3346,6 +3388,28 @@ export declare type ExportCompleted = {
|
|
|
3346
3388
|
exportBlobs: ExportBlob[];
|
|
3347
3389
|
};
|
|
3348
3390
|
|
|
3391
|
+
/**
|
|
3392
|
+
* @beta
|
|
3393
|
+
* The result when a user successfully completes an export flow.
|
|
3394
|
+
*/
|
|
3395
|
+
export declare type ExportCompletedWithZippedOptionOutput = {
|
|
3396
|
+
/**
|
|
3397
|
+
* The status of the export flow.
|
|
3398
|
+
*/
|
|
3399
|
+
status: "completed";
|
|
3400
|
+
/**
|
|
3401
|
+
* The title of the design, if set by the user.
|
|
3402
|
+
*/
|
|
3403
|
+
title?: string;
|
|
3404
|
+
/**
|
|
3405
|
+
* The exported files.
|
|
3406
|
+
*
|
|
3407
|
+
* @remarks
|
|
3408
|
+
* This array can contain a single link either to a file or a ZIP, or multiple links to individual files.
|
|
3409
|
+
*/
|
|
3410
|
+
exportBlobs: ExportBlobWithZippedOptionOutput[];
|
|
3411
|
+
};
|
|
3412
|
+
|
|
3349
3413
|
/**
|
|
3350
3414
|
* @public
|
|
3351
3415
|
* The types of files that Canva supports for exported designs.
|
|
@@ -3359,6 +3423,19 @@ export declare type ExportFileType =
|
|
|
3359
3423
|
| "pptx"
|
|
3360
3424
|
| "svg";
|
|
3361
3425
|
|
|
3426
|
+
/**
|
|
3427
|
+
* @beta
|
|
3428
|
+
* Object representation of the supported file types with properties where applicable.
|
|
3429
|
+
*/
|
|
3430
|
+
export declare type ExportFileTypeWithProperties =
|
|
3431
|
+
| {
|
|
3432
|
+
type: "pdf_standard" | "pptx";
|
|
3433
|
+
}
|
|
3434
|
+
| {
|
|
3435
|
+
type: "png" | "jpg" | "video" | "gif" | "svg";
|
|
3436
|
+
zipped?: ZipBehavior;
|
|
3437
|
+
};
|
|
3438
|
+
|
|
3362
3439
|
/**
|
|
3363
3440
|
* @public
|
|
3364
3441
|
* Options for configuring the export of a design.
|
|
@@ -3373,12 +3450,34 @@ export declare type ExportRequest = {
|
|
|
3373
3450
|
acceptedFileTypes: ExportFileType[];
|
|
3374
3451
|
};
|
|
3375
3452
|
|
|
3453
|
+
/**
|
|
3454
|
+
* @beta
|
|
3455
|
+
* Options for configuring the export of a design.
|
|
3456
|
+
*/
|
|
3457
|
+
export declare type ExportRequestWithFileTypeProperties = {
|
|
3458
|
+
/**
|
|
3459
|
+
* The types of files the user can export their design as.
|
|
3460
|
+
*
|
|
3461
|
+
* @remarks
|
|
3462
|
+
* You must provide at least one file type.
|
|
3463
|
+
*/
|
|
3464
|
+
acceptedFileTypes: (ExportFileType | ExportFileTypeWithProperties)[];
|
|
3465
|
+
};
|
|
3466
|
+
|
|
3376
3467
|
/**
|
|
3377
3468
|
* @public
|
|
3378
3469
|
* The result of exporting a design.
|
|
3379
3470
|
*/
|
|
3380
3471
|
export declare type ExportResponse = ExportCompleted | ExportAborted;
|
|
3381
3472
|
|
|
3473
|
+
/**
|
|
3474
|
+
* @beta
|
|
3475
|
+
* The result of exporting a design.
|
|
3476
|
+
*/
|
|
3477
|
+
export declare type ExportResponseWithZippedOptionOutput =
|
|
3478
|
+
| ExportCompletedWithZippedOptionOutput
|
|
3479
|
+
| ExportAborted;
|
|
3480
|
+
|
|
3382
3481
|
/**
|
|
3383
3482
|
* @public
|
|
3384
3483
|
* Image element or content to be added to the design at the end of a drag event.
|
|
@@ -4201,13 +4300,13 @@ declare type Point = {
|
|
|
4201
4300
|
declare type Primitive = undefined | null | number | boolean | string;
|
|
4202
4301
|
|
|
4203
4302
|
/**
|
|
4204
|
-
* @
|
|
4303
|
+
* @beta
|
|
4205
4304
|
* Exports the user's design as one or more static files.
|
|
4206
4305
|
* @param request - The request object containing configurations of the design export.
|
|
4207
4306
|
*/
|
|
4208
4307
|
export declare const requestExport: (
|
|
4209
|
-
request:
|
|
4210
|
-
) => Promise<
|
|
4308
|
+
request: ExportRequestWithFileTypeProperties,
|
|
4309
|
+
) => Promise<ExportResponseWithZippedOptionOutput>;
|
|
4211
4310
|
|
|
4212
4311
|
/**
|
|
4213
4312
|
* @public
|
|
@@ -5391,4 +5490,20 @@ declare type WidthAndHeight = {
|
|
|
5391
5490
|
height: number;
|
|
5392
5491
|
};
|
|
5393
5492
|
|
|
5493
|
+
/**
|
|
5494
|
+
* @beta
|
|
5495
|
+
* The behavior of zipping the exported files.
|
|
5496
|
+
*
|
|
5497
|
+
* @remarks
|
|
5498
|
+
* For `png`, `jpg`, and `svg`:
|
|
5499
|
+
* - `auto` (default): Files are zipped together if the design has multiple pages, unzipped if it has one page.
|
|
5500
|
+
* - `always`: Files are always zipped into a single zip file, regardless of page count.
|
|
5501
|
+
* - `never`: Files are never zipped, providing an array of files.
|
|
5502
|
+
*
|
|
5503
|
+
* For `video` and `gif`:
|
|
5504
|
+
* - `auto` or `never` (default): Files are never zipped together, regardless of count.
|
|
5505
|
+
* - `always`: Files are always zipped into a single file.
|
|
5506
|
+
*/
|
|
5507
|
+
export declare type ZipBehavior = "auto" | "always" | "never";
|
|
5508
|
+
|
|
5394
5509
|
export {};
|
|
@@ -14,6 +14,9 @@ _export(exports, {
|
|
|
14
14
|
},
|
|
15
15
|
get openDesign () {
|
|
16
16
|
return openDesign;
|
|
17
|
+
},
|
|
18
|
+
get requestExport () {
|
|
19
|
+
return requestExport;
|
|
17
20
|
}
|
|
18
21
|
});
|
|
19
22
|
const _version = require("./version");
|
|
@@ -36,4 +39,6 @@ function editContent(options, callback) {
|
|
|
36
39
|
return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
|
|
37
40
|
}
|
|
38
41
|
const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
42
|
+
const requestExport = canva_sdk.design.v2.export.requestExport;
|
|
39
43
|
window.__canva__?.sdkRegistration?.registerPackageVersion('design', _version.LATEST_VERSION, 'beta');
|
|
44
|
+
'comment';
|
|
@@ -4,5 +4,7 @@ export function editContent(options, callback) {
|
|
|
4
4
|
return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
|
|
5
5
|
}
|
|
6
6
|
export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
7
|
+
export const requestExport = canva_sdk.design.v2.export.requestExport;
|
|
7
8
|
export * from './public';
|
|
8
9
|
window.__canva__?.sdkRegistration?.registerPackageVersion('design', LATEST_VERSION, 'beta');
|
|
10
|
+
'comment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LATEST_VERSION = '2.7.
|
|
1
|
+
export const LATEST_VERSION = '2.7.4';
|