@canva/design 2.8.1-alpha.1 → 2.8.1-beta.0

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.
@@ -2,7 +2,7 @@
2
2
  * @beta
3
3
  * Information about a page within a design with fixed or unbounded dimensions.
4
4
  */
5
- declare type AbsolutePageMetadata = {
5
+ export declare type AbsolutePageMetadata = {
6
6
  /**
7
7
  * The type of page.
8
8
  */
@@ -828,17 +828,6 @@ export declare type AppElementClientConfiguration<A extends AppElementData> = {
828
828
  render: AppElementRenderer<A>;
829
829
  };
830
830
 
831
- /**
832
- * @alpha
833
- * Configuration for an App Element
834
- */
835
- export declare type AppElementClientConfigurationV2<A extends AppElementData> = {
836
- /**
837
- * The AppElementRenderer to use when rendering the app element
838
- */
839
- render: AppElementRendererV2<A>;
840
- };
841
-
842
831
  /**
843
832
  * @public
844
833
  * The data associated with an app element.
@@ -874,71 +863,6 @@ export declare type AppElementRenderer<A extends AppElementData> = (appElementDa
874
863
  */
875
864
  export declare type AppElementRendererOutput = GroupContentAtPoint[];
876
865
 
877
- /**
878
- * @alpha
879
- * A return value of {@link AppElementRendererV2} function.
880
- * It is an array of elements to render within an app element.
881
- */
882
- export declare type AppElementRendererOutputV2 = AppElementRendererOutput;
883
-
884
- /**
885
- * @alpha
886
- * A callback that runs when an app's element is changed.
887
- *
888
- * @remarks
889
- * This callback must return one or more elements to render within the app element.
890
- */
891
- export declare type AppElementRendererV2<A extends AppElementData> = (appElementData: A) => AppElementRendererOutputV2;
892
-
893
- /**
894
- * @alpha
895
- * Apply a template to the current design given a template id.
896
- *
897
- * @example Apply a template to the current design
898
- * ```typescript
899
- * import {
900
- * applyTemplate,
901
- * requestBrandTemplates,
902
- * type BrandTemplateId,
903
- * } from "@canva/design";
904
- *
905
- * const selection = await requestBrandTemplates();
906
- * if (selection.status === "aborted") return;
907
- *
908
- * const templateId = selection.brandTemplates[0]?.token as BrandTemplateId | undefined;
909
- * if (!templateId) return;
910
- *
911
- * const result = await applyTemplate({
912
- * template: { id: templateId },
913
- * mode: "overwrite",
914
- * });
915
- *
916
- * if (result.status === "completed") {
917
- * // Template was successfully applied
918
- * }
919
- * ```
920
- */
921
- export declare const applyTemplate: (options: ApplyTemplateOptions) => Promise<ApplyTemplateResult>;
922
-
923
- /**
924
- * @alpha
925
- * Options for applying a template to a design.
926
- */
927
- export declare type ApplyTemplateOptions = {
928
- template: {
929
- id: BrandTemplateId;
930
- };
931
- mode: 'overwrite';
932
- };
933
-
934
- /**
935
- * @alpha
936
- * Response object from the ApplyTemplate operation.
937
- */
938
- export declare type ApplyTemplateResult = {
939
- status: 'completed' | 'aborted';
940
- };
941
-
942
866
  /**
943
867
  * @public
944
868
  * A unique identifier that references an app runtime process
@@ -991,61 +915,6 @@ export declare type AudioTrack = {
991
915
  ref: AudioRef;
992
916
  };
993
917
 
994
- /**
995
- * @alpha
996
- * Configuration for the Autofill call to request the Data Connector intent implemented by the app
997
- * and skipping the data preview modal.
998
- */
999
- export declare type AutofillDataConnectorNoPreview = {
1000
- dataSelectionDisplay: 'hide';
1001
- dataSourceRef: DataSourceRef;
1002
- };
1003
-
1004
- /**
1005
- * @alpha
1006
- * Configuration for the Autofill call to request the Data Connector intent implemented by the app
1007
- * and displaying the data preview modal.
1008
- */
1009
- export declare type AutofillDataConnectorWithPreview = {
1010
- dataSelectionDisplay: 'show';
1011
- };
1012
-
1013
- /**
1014
- * @alpha
1015
- * Wrapper for the configurations that will query the app owned Data Connector.
1016
- */
1017
- export declare type AutofillFromDataConnector = {
1018
- type: 'data_connector';
1019
- withDataConnector: 'self';
1020
- limit?: DataTableLimit;
1021
- } & (AutofillDataConnectorWithPreview | AutofillDataConnectorNoPreview);
1022
-
1023
- /**
1024
- * @alpha
1025
- * Configuration for providing a fully populated data table to the Autofill call.
1026
- */
1027
- export declare type AutofillFromDataTable = {
1028
- type: 'data_table';
1029
- dataTable: DataTable;
1030
- };
1031
-
1032
- /**
1033
- * @alpha
1034
- * A set of options to configure the Autofill call.
1035
- * @param title - an optional title that will be set to the document after Autofill is done.
1036
- */
1037
- export declare type AutofillOptions = {
1038
- title?: string;
1039
- } & (AutofillFromDataTable | AutofillFromDataConnector);
1040
-
1041
- /**
1042
- * @alpha
1043
- * Response object from the Autofill operation.
1044
- */
1045
- export declare type AutofillResponse = {
1046
- status: 'success';
1047
- };
1048
-
1049
918
  /**
1050
919
  * @public
1051
920
  * Cell containing a boolean value.
@@ -1121,23 +990,6 @@ export declare type Bounds = {
1121
990
  */
1122
991
  export declare type Box = Point & (WidthAndHeight | Width | Height);
1123
992
 
1124
- /**
1125
- * @alpha
1126
- * A unique identifier that references a brand template.
1127
- */
1128
- export declare type BrandTemplateId = string & {
1129
- __brandTemplateId: never;
1130
- };
1131
-
1132
- /**
1133
- * @alpha
1134
- * Metadata for a brand template.
1135
- */
1136
- export declare type BrandTemplateMetadata = Omit<TemplateMetadata, 'domain'> & {
1137
- domain: 'brand';
1138
- dataset?: DataField[];
1139
- };
1140
-
1141
993
  /**
1142
994
  * @public
1143
995
  * An alias for the BulkCreateLauncher interface, providing access to bulk create related functionality
@@ -1333,7 +1185,7 @@ export declare interface ContentDraft<T> {
1333
1185
  /**
1334
1186
  * @beta
1335
1187
  */
1336
- declare type ContentType = 'richtext' | 'fill';
1188
+ export declare type ContentType = 'richtext' | 'fill';
1337
1189
 
1338
1190
  /**
1339
1191
  * @public
@@ -1448,14 +1300,6 @@ export declare type Coordinates = {
1448
1300
  */
1449
1301
  export declare const createRichtextRange: () => RichtextRange;
1450
1302
 
1451
- /**
1452
- * @alpha
1453
- * Session for the `openDesign` callback (current page) when `helpers` is {@link PageHelpersWithTiming}.
1454
- */
1455
- export declare type CurrentPageSessionWithTiming<Page extends DesignEditing.Page = DesignEditing.Page> = Omit<DesignEditing.CurrentPageSession<Page, DesignEditing.PageHelpers>, 'helpers'> & {
1456
- helpers: PageHelpersWithTiming;
1457
- };
1458
-
1459
1303
  /**
1460
1304
  * @beta
1461
1305
  * Metadata for a data field in a brand template.
@@ -1465,18 +1309,6 @@ export declare type DataField = {
1465
1309
  type: 'image' | 'text' | 'chart';
1466
1310
  };
1467
1311
 
1468
- /**
1469
- * @alpha
1470
- * A representation of the data source that is given to the Data Connector.
1471
- */
1472
- export declare type DataSourceRef = {
1473
- /**
1474
- * This 'source' will be passed on to the Data Connector intent.
1475
- */
1476
- source: string;
1477
- title?: string;
1478
- };
1479
-
1480
1312
  /**
1481
1313
  * @public
1482
1314
  * Structured tabular data for import into Canva.
@@ -3183,7 +3015,7 @@ export declare type DesignElement = ImageElement | VideoElement | EmbedElement |
3183
3015
  * @beta
3184
3016
  * Information about the design.
3185
3017
  */
3186
- declare type DesignMetadata = {
3018
+ export declare type DesignMetadata = {
3187
3019
  /**
3188
3020
  * The title of the user's design.
3189
3021
  * @remarks
@@ -3219,40 +3051,6 @@ declare type DesignMetadata = {
3219
3051
  dataset?: DataField[];
3220
3052
  };
3221
3053
 
3222
- /**
3223
- * @public
3224
- * Information about the design.
3225
- */
3226
- declare type DesignMetadata_2 = {
3227
- /**
3228
- * The title of the user's design.
3229
- * @remarks
3230
- * This is optional and will be `undefined` if the user hasn't set a title.
3231
- */
3232
- title?: string;
3233
- /**
3234
- * The default dimensions that a new page will have when it is added to a design.
3235
- * It is possible for a user to resize a page without resizing the entire design, e.g. by clicking
3236
- * "Expand to Whiteboard". However, there will always be a single set of default dimensions for a
3237
- * design that is applied whenever a new page is created.
3238
- * @remarks
3239
- * This is optional and will be `undefined` if the design is unbounded (e.g. Whiteboard or Doc).
3240
- */
3241
- defaultPageDimensions?: PageDimensions;
3242
- /**
3243
- * The information associated with each page of the design.
3244
- * @remarks
3245
- * The order of pages is not guaranteed.
3246
- */
3247
- pageMetadata: Iterable<PageMetadata_2>;
3248
- /**
3249
- * The duration of the whole design in seconds.
3250
- * @remarks
3251
- * This is the precise value, which differs from what is displayed in the UI as duration in Canva UI is formatted differently.
3252
- */
3253
- durationInSeconds: number;
3254
- };
3255
-
3256
3054
  /**
3257
3055
  * @beta
3258
3056
  * A callback for operating on all pages of the design.
@@ -3280,16 +3078,16 @@ export declare type DesignOpenCallback = (session: DesignEditing.CurrentPageSess
3280
3078
 
3281
3079
  /**
3282
3080
  * @beta
3283
- * A callback for operating on the current page of the design.
3284
- * @param session - Session received by the `openDesign` callback when opening the current page.
3081
+ * A callback for operating on the design.
3285
3082
  */
3286
- export declare type DesignOpenCurrentPageCallback = (session: DesignEditing.CurrentPageSession) => Promise<void>;
3083
+ declare type DesignOpenCallback_2 = DesignOpenCurrentPageCallback | DesignOpenAllPagesCallback;
3287
3084
 
3288
3085
  /**
3289
- * @alpha
3290
- * Callback for `openDesign` when the session exposes {@link PageHelpersWithTiming}.
3086
+ * @beta
3087
+ * A callback for operating on the current page of the design.
3088
+ * @param session - Session received by the `openDesign` callback when opening the current page.
3291
3089
  */
3292
- declare type DesignOpenCurrentPageCallbackWithTiming = (session: CurrentPageSessionWithTiming<DesignEditing.Page>) => Promise<void>;
3090
+ export declare type DesignOpenCurrentPageCallback = (session: DesignEditing.CurrentPageSession) => Promise<void>;
3293
3091
 
3294
3092
  /**
3295
3093
  * @beta
@@ -3609,31 +3407,44 @@ export declare type DragStartEvent<E extends Element> = Pick<DragEvent, 'dataTra
3609
3407
  };
3610
3408
 
3611
3409
  /**
3612
- * @public
3613
- * Reads and edits content of the specified type from the user's design.
3614
- * @param options - Options for configuring how a design is read.
3615
- * @param callback - A callback for operating on the read content.
3616
- *
3617
- * @example Read richtext content
3618
- * ```typescript
3619
- * import { editContent } from "@canva/design";
3620
- *
3621
- * await editContent(
3622
- * { contentType: 'richtext', target: 'current_page' },
3623
- * async (session) => {
3624
- * // Do something with the richtext content, e.g. `session.contents`
3625
- * }
3626
- * );
3627
- * ```
3410
+ * @beta
3411
+ * Reads and edits richtext content from the user's design.
3412
+ * @param options - Options for configuring how a design is read. Must specify `contentType: 'richtext'`.
3413
+ * @param callback - A callback that receives a `RichtextContentSession` for editing.
3414
+ * @returns A promise that resolves when editing is complete.
3415
+ */
3416
+ export declare function editContent(options: EditContentOptions & {
3417
+ contentType: 'richtext';
3418
+ }, callback: (session: RichtextContentSession) => Promise<void> | void): Promise<void>;
3419
+
3420
+ /**
3421
+ * @beta
3422
+ * Reads and edits fill content from the user's design.
3423
+ * @param options - Options for configuring how a design is read. Must specify `contentType: 'fill'`.
3424
+ * @param callback - A callback that receives a `FillContentSession` for editing.
3425
+ * @returns A promise that resolves when editing is complete.
3426
+ */
3427
+ export declare function editContent(options: EditContentOptions & {
3428
+ contentType: 'fill';
3429
+ }, callback: (session: FillContentSession) => Promise<void> | void): Promise<void>;
3430
+
3431
+ /**
3432
+ * @beta
3433
+ * Reads and edits content from the user's design.
3434
+ * @param options - Options for configuring how a design is read. Must specify a content type.
3435
+ * @param callback - A callback that receives a session for editing.
3436
+ * @returns A promise that resolves when editing is complete.
3628
3437
  */
3629
- export declare const editContent: (options: EditContentOptions_2, callback: EditContentCallback_2) => Promise<void>;
3438
+ export declare function editContent<T extends ContentType>(options: EditContentOptions & {
3439
+ contentType: T;
3440
+ }, callback: (session: ContentTypeMap[T]) => Promise<void> | void): Promise<void>;
3630
3441
 
3631
3442
  /**
3632
3443
  * @beta
3633
3444
  * A callback for reading and updating the requested design content.
3634
3445
  * @param session - Session for reading and updating content in the design.
3635
3446
  */
3636
- declare type EditContentCallback = (session: RichtextContentSession | FillContentSession) => Promise<void> | void;
3447
+ export declare type EditContentCallback = (session: RichtextContentSession | FillContentSession) => Promise<void> | void;
3637
3448
 
3638
3449
  /**
3639
3450
  * @public
@@ -3646,7 +3457,7 @@ declare type EditContentCallback_2 = (session: RichtextContentSession) => Promis
3646
3457
  * @beta
3647
3458
  * Options for configuring how the design content is read.
3648
3459
  */
3649
- declare type EditContentOptions = {
3460
+ export declare type EditContentOptions = {
3650
3461
  /**
3651
3462
  * The type of content to edit from the user's design
3652
3463
  */
@@ -3991,21 +3802,6 @@ export declare type FontRef = string & {
3991
3802
  **/
3992
3803
  export declare type FontWeight = 'normal' | 'thin' | 'extralight' | 'light' | 'medium' | 'semibold' | 'bold' | 'ultrabold' | 'heavy';
3993
3804
 
3994
- /**
3995
- * @alpha
3996
- * Return metadata for a brand template given its ID.
3997
- *
3998
- * @example Get brand template metadata
3999
- * ```typescript
4000
- * import { getBrandTemplateMetadata, BrandTemplateId } from "@canva/design";
4001
- *
4002
- * const templateId = resolveToken(requestBrandTemplates()) as BrandTemplateId;
4003
- *
4004
- * const metadata = await getBrandTemplateMetadata(templateId);
4005
- * ```
4006
- */
4007
- export declare const getBrandTemplateMetadata: (id: BrandTemplateId) => Promise<BrandTemplateMetadata>;
4008
-
4009
3805
  /**
4010
3806
  * Allows to get the context of currently selected page.
4011
3807
  * @public
@@ -4076,19 +3872,25 @@ export declare const getCurrentPageContext: () => Promise<PageContext>;
4076
3872
  export declare const getDefaultPageDimensions: () => Promise<Dimensions | undefined>;
4077
3873
 
4078
3874
  /**
4079
- * @public
3875
+ * @beta
4080
3876
  * Retrieves information about the design.
3877
+ */
3878
+ export declare const getDesignMetadata: () => Promise<DesignMetadata>;
3879
+
3880
+ /**
3881
+ * @beta
3882
+ * Retrieves information about the template that was used in a design.
4081
3883
  *
4082
- * @example Get design metadata
3884
+ * @example Get design template metadata
4083
3885
  * ```typescript
4084
- * import { getDesignMetadata } from "@canva/design";
3886
+ * import { getDesignTemplateMetadata } from "@canva/design";
4085
3887
  *
4086
- * const metadata = await getDesignMetadata();
3888
+ * const templateMetadata = await getDesignTemplateMetadata();
4087
3889
  *
4088
- * const { title, defaultPageDimensions, pageMetadata, durationInSeconds } = metadata;
3890
+ * const { keywords, domain } = templateMetadata;
4089
3891
  * ```
4090
3892
  */
4091
- export declare const getDesignMetadata: () => Promise<DesignMetadata_2>;
3893
+ export declare const getDesignTemplateMetadata: () => Promise<DesignTemplateMetadata>;
4092
3894
 
4093
3895
  /**
4094
3896
  * @public
@@ -4436,13 +4238,44 @@ declare type ImageUploadOptions = {
4436
4238
  } & AllOrNone<Dimensions_2>;
4437
4239
 
4438
4240
  /**
4439
- * @alpha
4241
+ * @public
4440
4242
  * @param appElementConfig - Configuration for an AppElementClient
4243
+ *
4244
+ * @example Initialize app element client
4245
+ * ```typescript
4246
+ * import { initAppElement } from "@canva/design";
4247
+ *
4248
+ * const appElement = initAppElement<{ content: string }>({
4249
+ * render: (data) => {
4250
+ * return [{
4251
+ * type: 'text',
4252
+ * children: [data.content],
4253
+ * top: 100,
4254
+ * left: 100,
4255
+ * width: 200
4256
+ * }];
4257
+ * }
4258
+ * });
4259
+ * ```
4260
+ *
4261
+ * @example Initialize V2 app element client
4262
+ * ```typescript
4263
+ * import { initAppElement } from "@canva/design";
4264
+ *
4265
+ * const appElement = initAppElement<{ content: string }>({
4266
+ * render: (data) => {
4267
+ * return [{
4268
+ * type: 'text',
4269
+ * children: [data.content],
4270
+ * top: 100,
4271
+ * left: 100,
4272
+ * width: 200
4273
+ * }];
4274
+ * }
4275
+ * });
4276
+ * ```
4441
4277
  */
4442
- export declare const initAppElement: {
4443
- <A extends AppElementData>(appElementConfig: AppElementClientConfigurationV2<A>): AppElementClient<A>;
4444
- <A extends AppElementData>(appElementConfig: AppElementClientConfiguration<A>): AppElementClient<A>;
4445
- };
4278
+ export declare const initAppElement: <A extends AppElementData>(appElementConfig: AppElementClientConfiguration<A>) => AppElementClient<A>;
4446
4279
 
4447
4280
  /**
4448
4281
  * @public
@@ -4782,13 +4615,16 @@ declare type NumberDataTableCell = {
4782
4615
  declare type ObjectPrimitive = Boolean | String;
4783
4616
 
4784
4617
  /**
4785
- * @alpha
4786
- * Reads (and optionally updates) the current page of the user's design, with timing support for
4787
- * video timeline elements.
4788
- * @param options - Options for configuring how the current page of the design is read.
4789
- * @param callback - A callback for operating on the current page of the design.
4790
- */
4791
- export declare const openDesign: (options: DesignOpenCurrentPageOptions, callback: DesignOpenCurrentPageCallbackWithTiming) => Promise<void>;
4618
+ * @beta
4619
+ * Reads (and optionally updates) a specified part of the user's design.
4620
+ * @param options - Options for configuring how the design is read.
4621
+ * @param callback - A callback for operating on the design.
4622
+ */
4623
+ export declare const openDesign: {
4624
+ (options: DesignOpenCurrentPageOptions, callback: DesignOpenCurrentPageCallback): Promise<void>;
4625
+ (options: DesignOpenAllPagesOptions, callback: DesignOpenAllPagesCallback): Promise<void>;
4626
+ (options: DesignOpenOptions_2, callback: DesignOpenCallback_2): Promise<void>;
4627
+ };
4792
4628
 
4793
4629
  /**
4794
4630
  * @public
@@ -4881,55 +4717,11 @@ export declare type PageDimensions = {
4881
4717
  height: number;
4882
4718
  };
4883
4719
 
4884
- /**
4885
- * @alpha
4886
- * {@link DesignEditing.PageHelpers} plus {@link PageHelpersWithTiming.timingFor | timingFor} for **video / fixed pages** with a timeline.
4887
- *
4888
- * @preventInline
4889
- */
4890
- export declare type PageHelpersWithTiming = DesignEditing.PageHelpers & {
4891
- /**
4892
- * Timing API for one element on the current page.
4893
- *
4894
- * @param elementRef - Must belong to the current page.
4895
- * @returns A {@link TimingAccessor} for the element.
4896
- */
4897
- timingFor(elementRef: DesignEditing.AbsoluteElement): TimingAccessor;
4898
- };
4899
-
4900
4720
  /**
4901
4721
  * @beta
4902
4722
  * Information about a page within a design.
4903
4723
  */
4904
- declare type PageMetadata = AbsolutePageMetadata | UnsupportedPageMetadata;
4905
-
4906
- /**
4907
- * @public
4908
- * Information about a page.
4909
- */
4910
- declare type PageMetadata_2 = {
4911
-
4912
- /**
4913
- *
4914
- * The dimensions of the page, in pixels.
4915
- *
4916
- * @remarks
4917
- * This may be `undefined` because some types of pages don't have dimensions, such as whiteboards.
4918
- */
4919
- dimensions?: PageDimensions;
4920
- };
4921
-
4922
- /**
4923
- * @alpha
4924
- * Partial update shape: only listed properties are applied; others stay as they are.
4925
- *
4926
- * @remarks
4927
- * Each key may be the normal value, {@link ResetToDefault} to reset that property to its default, or
4928
- * omitted / **`undefined`** to leave that property **unchanged**.
4929
- */
4930
- export declare type Patch<T extends Record<string, unknown>> = {
4931
- [K in keyof T]?: T[K] | typeof ResetToDefault;
4932
- };
4724
+ export declare type PageMetadata = AbsolutePageMetadata | UnsupportedPageMetadata;
4933
4725
 
4934
4726
  /**
4935
4727
  * @public
@@ -5037,131 +4829,22 @@ export declare type PublishLauncher = {
5037
4829
  };
5038
4830
 
5039
4831
  /**
5040
- * @alpha
5041
- * Requests the Autofill flow to start of the given options. The flow can request data from the app
5042
- * owned Data Connector, or use any given data that is passed in the options object.
5043
- *
5044
- * @param opts - The configuration options for this Autofill flow.
5045
- *
5046
- * @example Basic usage - Open data connector preview dialog to request data
5047
- * ```typescript
5048
- * import { requestAutofillDesign } from "@canva/design";
5049
- * import type { AutofillOptions } from "@canva/design";
5050
- *
5051
- * const opts: AutofillOptions = {
5052
- * title: 'Updated design',
5053
- * type: 'data_connector',
5054
- * dataSelectionDisplay: 'show',
5055
- * };
5056
- *
5057
- * const response = await requestAutofillDesign(element);
5058
- * ```
5059
- *
5060
- * @example Basic usage - Request data from the data connector without preview
5061
- * ```typescript
5062
- * import { requestAutofillDesign } from "@canva/design";
5063
- * import type { AutofillOptions } from "@canva/design";
5064
- *
5065
- * const opts: AutofillOptions = {
5066
- * title: 'Updated design',
5067
- * type: 'data_connector',
5068
- * dataSelectionDisplay: 'hide',
5069
- * dataSourceRef: { source: 'serialized_content' }
5070
- * };
5071
- *
5072
- * const response = await requestAutofillDesign(element);
5073
- * ```
5074
- *
5075
- * @example Basic usage - Use the data given in the options
5076
- * ```typescript
5077
- * import { requestAutofillDesign } from "@canva/design";
5078
- * import type { AutofillOptions } from "@canva/design";
5079
- *
5080
- * const opts: AutofillOptions = {
5081
- * title: 'Updated design',
5082
- * type: 'data_table',
5083
- * dataTable: // Set the data table containing the data entries for each field.
5084
- * };
5085
- *
5086
- * const response = await requestAutofillDesign(element);
5087
- * ```
5088
- */
5089
- export declare const requestAutofillDesign: (opts: AutofillOptions) => Promise<AutofillResponse>;
5090
-
5091
- /**
5092
- * @alpha
5093
- * Trigger brand template selection panel and returns the selected template token.
5094
- *
5095
- * @example Request brand templates
5096
- * ```typescript
5097
- * import { requestBrandTemplates } from "@canva/design";
5098
- *
5099
- * const response = await requestBrandTemplates();
5100
- *
5101
- * if (response.status === 'aborted') return;
5102
- *
5103
- * const { token } = response.brandTemplates[0];
5104
- * ```
4832
+ * @public
4833
+ * Exports the user's design as one or more static files.
4834
+ * @param request - The request object containing configurations of the design export.
5105
4835
  */
5106
- export declare const requestBrandTemplates: () => Promise<RequestBrandTemplatesResponse>;
4836
+ export declare const requestExport: (request: ExportRequest) => Promise<ExportResponse>;
5107
4837
 
5108
4838
  /**
5109
- * @alpha
5110
- * Response object from the RequestBrandTemplate operation.
4839
+ * @public
4840
+ * Provides methods for interacting with a range of formatted text.
5111
4841
  */
5112
- export declare type RequestBrandTemplatesResponse = RequestBrandTemplatesResponseCompleted | RequestBrandTemplatesResponseAborted;
5113
-
5114
- /**
5115
- * @alpha
5116
- * Response object from the RequestBrandTemplate operation that was aborted.
5117
- */
5118
- export declare type RequestBrandTemplatesResponseAborted = {
5119
- status: 'aborted';
5120
- };
5121
-
5122
- /**
5123
- * @alpha
5124
- * Response object from the RequestBrandTemplate operation completed successfully.
5125
- */
5126
- export declare type RequestBrandTemplatesResponseCompleted = {
5127
- status: 'completed';
5128
- brandTemplates: RequestBrandTemplatesResponseContent[];
5129
- };
5130
-
5131
- /**
5132
- * @alpha
5133
- * Response object from the RequestBrandTemplate operation completed successfully.
5134
- */
5135
- export declare type RequestBrandTemplatesResponseContent = {
5136
- token: string;
5137
- };
5138
-
5139
- /**
5140
- * @public
5141
- * Exports the user's design as one or more static files.
5142
- * @param request - The request object containing configurations of the design export.
5143
- */
5144
- export declare const requestExport: (request: ExportRequest) => Promise<ExportResponse>;
5145
-
5146
- /**
5147
- * @alpha
5148
- * Use in a {@link Patch} to mean “set this property to its default” instead of a concrete value.
5149
- *
5150
- * @remarks
5151
- * String literals like `'default'` are avoided so they cannot clash with future string-valued fields.
5152
- */
5153
- export declare const ResetToDefault: unique symbol;
5154
-
5155
- /**
5156
- * @public
5157
- * Provides methods for interacting with a range of formatted text.
5158
- */
5159
- export declare interface RichtextContentRange extends RichtextRange {
5160
- /**
5161
- * Indicates whether the object containing this richtext range has been deleted.
5162
- */
5163
- readonly deleted: boolean;
5164
- }
4842
+ export declare interface RichtextContentRange extends RichtextRange {
4843
+ /**
4844
+ * Indicates whether the object containing this richtext range has been deleted.
4845
+ */
4846
+ readonly deleted: boolean;
4847
+ }
5165
4848
 
5166
4849
  /**
5167
4850
  * @public
@@ -6142,401 +5825,406 @@ export declare type TextRegion = {
6142
5825
  };
6143
5826
 
6144
5827
  /**
6145
- * @alpha
6146
- * Start time and duration for an element on the **video timeline** (seconds).
5828
+ * @public
5829
+ * Provides methods for adding drag and drop behavior to an app.
6147
5830
  */
6148
- export declare type Timing = {
5831
+ export declare interface UI {
6149
5832
  /**
6150
- * Delay from the start of the page’s timeline until this element becomes visible. Minimum `0`.
5833
+ * @deprecated The method has been superseded by `startDragToPoint`.
5834
+ * @public
5835
+ * Adds the specified element or content to a design at the end of a drag event.
5836
+ *
5837
+ * @param event - A drag start event.
5838
+ * @param dragData - Element or content to be added to the design at the end of the drag event.
6151
5839
  */
6152
- readonly delayInSeconds: number;
5840
+ startDrag<E extends Element>(event: DragStartEvent<E>, dragData: TextDragConfig | AudioDragConfig | EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
5841
+ /**
5842
+ * @public
5843
+ * Adds the specified element or content to fixed designs, which use a coordinate-based positioning system at the end of a drag event.
5844
+ *
5845
+ * @param event - A drag start event.
5846
+ * @param dragData - Element or content to be added to the design at the end of the drag event.
5847
+ */
5848
+ startDragToPoint<E extends Element>(event: DragStartEvent<E>, dragData: TextDragConfig | AudioDragConfig | EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
5849
+ /**
5850
+ * @public
5851
+ * Adds the specified element or content to responsive documents, which slot things into a text stream at the end of a drag event.
5852
+ *
5853
+ * @param event - A drag start event.
5854
+ * @param dragData - Element or content to be added to the design at the end of the drag event.
5855
+ */
5856
+ startDragToCursor<E extends Element>(event: DragStartEvent<E>, dragData: EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
5857
+ }
5858
+
5859
+ /**
5860
+ * An alias for the UI interface, providing access to ui related functionality
5861
+ * @public
5862
+ */
5863
+ export declare const ui: UI;
5864
+
5865
+ /**
5866
+ * @beta
5867
+ * Pages that do not have fixed or unbounded dimensions currently do not return metadata.
5868
+ */
5869
+ export declare type UnsupportedPageMetadata = {
6153
5870
  /**
6154
- * How long the element stays visible. A **number** is a duration in seconds (Positive number).
6155
- * The string **`'until_end_of_page'`** means until the **end of the current page** (default).
5871
+ * The type of page.
6156
5872
  */
6157
- readonly durationInSeconds: number | 'until_end_of_page';
5873
+ type: 'unsupported';
6158
5874
  };
6159
5875
 
6160
5876
  /**
6161
- * @alpha
6162
- * Read/write timing for a single element. Obtained from {@link PageHelpersWithTiming.timingFor}.
6163
- *
6164
- * @preventInline
5877
+ * @public
5878
+ * A data type that can be used in app element data.
5879
+ */
5880
+ export declare type Value = Primitive | ObjectPrimitive | Exclude<Value, undefined>[] | {
5881
+ [key: string]: Value;
5882
+ };
5883
+
5884
+ /**
5885
+ * @public
5886
+ * Video element or content to be added to the design at the end of a drag event.
6165
5887
  */
6166
- export declare type TimingAccessor = {
5888
+ export declare type VideoDragConfig = {
6167
5889
  /**
6168
- * Reads the element’s current timing.
5890
+ * The type of element.
5891
+ */
5892
+ type: 'video';
5893
+ /**
5894
+ * A function that returns a reference (ref) to a video asset in Canva's backend.
5895
+ */
5896
+ resolveVideoRef: () => Promise<{
5897
+ ref: VideoRef;
5898
+ }>;
5899
+ /**
5900
+ * The dimensions of the preview image.
5901
+ */
5902
+ previewSize: Dimensions;
5903
+ /**
5904
+ * The dimensions of the full-size video.
6169
5905
  *
6170
- * @returns {@link Timing}
6171
- *
6172
- * @remarks
6173
- * If set(ResetToDefault) and then get(), it will returns `{ startMs: 0, durationMs: 'until_end_of_page' }` instead
6174
- */
6175
- get(): Timing;
6176
- /**
6177
- * Updates timing on the element, or resets it entirely.
6178
- *
6179
- * @param timing - Either:
6180
- * - **`ResetToDefault`** alone — reset **all** timing to defaults (delay at 0, duration to end of page).
6181
- * - A **patch object** — merge with current timing. Omitted keys or keys set to `undefined` are
6182
- * **unchanged**. Use {@link ResetToDefault} on a key to reset that property to its default.
6183
- */
6184
- set(timing: Patch<Timing> | typeof ResetToDefault): Promise<void>;
6185
- };
6186
-
5906
+ * @remarks
5907
+ * - These dimensions are used when adding the video to the design
5908
+ * - If omitted, the `previewSize` dimensions are used as a fallback.
5909
+ */
5910
+ fullSize?: Dimensions;
6187
5911
  /**
6188
- * @public
6189
- * Provides methods for adding drag and drop behavior to an app.
5912
+ * The URL of an image to display under the user's cursor during the drag and drop event.
6190
5913
  */
6191
- export declare interface UI {
6192
- /**
6193
- * @deprecated The method has been superseded by `startDragToPoint`.
6194
- * @public
6195
- * Adds the specified element or content to a design at the end of a drag event.
6196
- *
6197
- * @param event - A drag start event.
6198
- * @param dragData - Element or content to be added to the design at the end of the drag event.
6199
- */
6200
- startDrag<E extends Element>(event: DragStartEvent<E>, dragData: TextDragConfig | AudioDragConfig | EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
6201
- /**
6202
- * @public
6203
- * Adds the specified element or content to fixed designs, which use a coordinate-based positioning system at the end of a drag event.
6204
- *
6205
- * @param event - A drag start event.
6206
- * @param dragData - Element or content to be added to the design at the end of the drag event.
6207
- */
6208
- startDragToPoint<E extends Element>(event: DragStartEvent<E>, dragData: TextDragConfig | AudioDragConfig | EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
6209
- /**
6210
- * @public
6211
- * Adds the specified element or content to responsive documents, which slot things into a text stream at the end of a drag event.
6212
- *
6213
- * @param event - A drag start event.
6214
- * @param dragData - Element or content to be added to the design at the end of the drag event.
6215
- */
6216
- startDragToCursor<E extends Element>(event: DragStartEvent<E>, dragData: EmbedDragConfig | VideoDragConfigForElement<E> | ImageDragConfigForElement<E>): Promise<void>;
6217
- }
5914
+ previewUrl: string;
5915
+ };
5916
+
5917
+ /**
5918
+ * @public
5919
+ * Video element or content to be added to the design at the end of a drag event.
5920
+ */
5921
+ export declare type VideoDragConfigForElement<E extends Element> = E extends HTMLImageElement ? Partial<VideoDragConfig> & Pick<VideoDragConfig, 'type' | 'resolveVideoRef'> : VideoDragConfig;
6218
5922
 
5923
+ /**
5924
+ * @public
5925
+ * An element that renders video content.
5926
+ */
5927
+ export declare type VideoElement = {
6219
5928
  /**
6220
- * An alias for the UI interface, providing access to ui related functionality
6221
- * @public
5929
+ * The type of element.
6222
5930
  */
6223
- export declare const ui: UI;
6224
-
5931
+ type: 'video';
5932
+ /**
5933
+ * A unique identifier that points to a video asset in Canva's backend.
5934
+ */
5935
+ ref: VideoRef;
5936
+ /**
5937
+ * A description of the video content.
5938
+ *
5939
+ * @remarks
5940
+ * Use `undefined` for content with no description.
5941
+ */
5942
+ altText: AltText | undefined;
6225
5943
  /**
6226
5944
  * @beta
6227
- * Pages that do not have fixed or unbounded dimensions currently do not return metadata.
5945
+ * Options for configuring the cropping of the video.
6228
5946
  */
6229
- declare type UnsupportedPageMetadata = {
6230
- /**
6231
- * The type of page.
6232
- */
6233
- type: 'unsupported';
6234
- };
6235
-
5947
+ imageBox?: VideoImageBox;
6236
5948
  /**
6237
- * @public
6238
- * A data type that can be used in app element data.
5949
+ * @beta
5950
+ * Options for configuring the start, and end of the video.
6239
5951
  */
6240
- export declare type Value = Primitive | ObjectPrimitive | Exclude<Value, undefined>[] | {
6241
- [key: string]: Value;
6242
- };
5952
+ trim?: VideoTrim;
5953
+ };
5954
+
5955
+ /**
5956
+ * @public
5957
+ * An element that renders video content and has positional properties.
5958
+ */
5959
+ export declare type VideoElementAtPoint = VideoElement & Point & (WidthAndHeight | Width | Height);
6243
5960
 
5961
+ /**
5962
+ * @public
5963
+ * A video asset that fills a path's interior.
5964
+ */
5965
+ export declare type VideoFill = {
6244
5966
  /**
6245
- * @public
6246
- * Video element or content to be added to the design at the end of a drag event.
5967
+ * The type of fill.
6247
5968
  */
6248
- export declare type VideoDragConfig = {
6249
- /**
6250
- * The type of element.
6251
- */
6252
- type: 'video';
6253
- /**
6254
- * A function that returns a reference (ref) to a video asset in Canva's backend.
6255
- */
6256
- resolveVideoRef: () => Promise<{
6257
- ref: VideoRef;
6258
- }>;
6259
- /**
6260
- * The dimensions of the preview image.
6261
- */
6262
- previewSize: Dimensions;
6263
- /**
6264
- * The dimensions of the full-size video.
6265
- *
6266
- * @remarks
6267
- * - These dimensions are used when adding the video to the design
6268
- * - If omitted, the `previewSize` dimensions are used as a fallback.
6269
- */
6270
- fullSize?: Dimensions;
6271
- /**
6272
- * The URL of an image to display under the user's cursor during the drag and drop event.
6273
- */
6274
- previewUrl: string;
6275
- };
6276
-
5969
+ type: 'video';
6277
5970
  /**
6278
- * @public
6279
- * Video element or content to be added to the design at the end of a drag event.
5971
+ * A unique identifier that points to a video asset in Canva's backend.
6280
5972
  */
6281
- export declare type VideoDragConfigForElement<E extends Element> = E extends HTMLImageElement ? Partial<VideoDragConfig> & Pick<VideoDragConfig, 'type' | 'resolveVideoRef'> : VideoDragConfig;
6282
-
5973
+ ref: VideoRef;
6283
5974
  /**
6284
- * @public
6285
- * An element that renders video content.
5975
+ * A description of the image content.
5976
+ *
5977
+ * @remarks
5978
+ * Use `undefined` for content with no description.
6286
5979
  */
6287
- export declare type VideoElement = {
6288
- /**
6289
- * The type of element.
6290
- */
6291
- type: 'video';
6292
- /**
6293
- * A unique identifier that points to a video asset in Canva's backend.
6294
- */
6295
- ref: VideoRef;
6296
- /**
6297
- * A description of the video content.
6298
- *
6299
- * @remarks
6300
- * Use `undefined` for content with no description.
6301
- */
6302
- altText: AltText | undefined;
6303
- };
5980
+ altText?: AltText;
5981
+ };
6304
5982
 
5983
+ /**
5984
+ * @beta
5985
+ * Options for configuring the visible portion of a video.
5986
+ */
5987
+ export declare type VideoImageBox = {
6305
5988
  /**
6306
- * @public
6307
- * An element that renders video content and has positional properties.
5989
+ * The distance of the image box from the top edge of the video, in pixels.
5990
+ */
5991
+ top: number;
5992
+ /**
5993
+ * The distance of the image box from the left edge of the video, in pixels.
5994
+ */
5995
+ left: number;
5996
+ /**
5997
+ * The width of the image box, in pixels.
6308
5998
  */
6309
- export declare type VideoElementAtPoint = VideoElement & Point & (WidthAndHeight | Width | Height);
5999
+ width: number;
6000
+ /**
6001
+ * The height of the image box, in pixels.
6002
+ */
6003
+ height: number;
6004
+ };
6005
+
6006
+ /**
6007
+ * @public
6008
+ * The MIME type of a video file that's supported by Canva's backend.
6009
+ *
6010
+ * @remarks
6011
+ * - GIFs are treated as videos, not images.
6012
+ * - `"application/json"` is only used for Lottie files.
6013
+ */
6014
+ declare type VideoMimeType = 'video/avi' | 'video/x-msvideo' | 'image/gif' | 'video/x-m4v' | 'video/x-matroska' | 'video/quicktime' | 'video/mp4' | 'video/mpeg' | 'video/webm' | 'application/json';
6015
+
6016
+ /**
6017
+ * @public
6018
+ * A unique identifier that references a video asset in Canva's backend.
6019
+ */
6020
+ export declare type VideoRef = string & {
6021
+ __videoRef: never;
6022
+ };
6310
6023
 
6024
+ /**
6025
+ * @public
6026
+ * A unique identifier that points to a video asset in Canva's backend.
6027
+ */
6028
+ declare type VideoRef_2 = string & {
6029
+ __videoRef: never;
6030
+ };
6031
+
6032
+ /**
6033
+ * @beta
6034
+ * Options for configuring the start and end points for video playback.
6035
+ */
6036
+ export declare type VideoTrim = {
6311
6037
  /**
6312
- * @public
6313
- * A video asset that fills a path's interior.
6038
+ * The start point of the video, in seconds relative to the start of the source video.
6314
6039
  */
6315
- export declare type VideoFill = {
6316
- /**
6317
- * The type of fill.
6318
- */
6319
- type: 'video';
6320
- /**
6321
- * A unique identifier that points to a video asset in Canva's backend.
6322
- */
6323
- ref: VideoRef;
6324
- /**
6325
- * A description of the image content.
6326
- *
6327
- * @remarks
6328
- * Use `undefined` for content with no description.
6329
- */
6330
- altText?: AltText;
6331
- };
6040
+ startInSeconds: number;
6041
+ /**
6042
+ * The end point of the video, in seconds relative to the start of the source video.
6043
+ */
6044
+ endInSeconds: number;
6045
+ };
6332
6046
 
6047
+ /**
6048
+ * @public
6049
+ * Options for uploading a video asset to the user's private media library.
6050
+ */
6051
+ declare type VideoUploadOptions = {
6333
6052
  /**
6334
- * @public
6335
- * The MIME type of a video file that's supported by Canva's backend.
6053
+ * The type of asset.
6054
+ */
6055
+ type: 'video';
6056
+ /**
6057
+ * A human-readable name for the video asset.
6336
6058
  *
6337
6059
  * @remarks
6338
- * - GIFs are treated as videos, not images.
6339
- * - `"application/json"` is only used for Lottie files.
6060
+ * This name is displayed in the user's media library and helps users identify
6061
+ * and find the asset later. If not provided, Canva will generate a name based
6062
+ * on the asset's URL or a unique identifier.
6063
+ *
6064
+ * Requirements:
6065
+ * - Minimum length: 1 character (empty strings are not allowed)
6066
+ * - Maximum length: 255 characters
6340
6067
  */
6341
- declare type VideoMimeType = 'video/avi' | 'video/x-msvideo' | 'image/gif' | 'video/x-m4v' | 'video/x-matroska' | 'video/quicktime' | 'video/mp4' | 'video/mpeg' | 'video/webm' | 'application/json';
6342
-
6068
+ name?: string;
6343
6069
  /**
6344
- * @public
6345
- * A unique identifier that references a video asset in Canva's backend.
6070
+ * The ref of the original asset from which this new asset was derived.
6071
+ *
6072
+ * @remarks
6073
+ * For example, if an app applies an effect to a video, `parentRef` should contain the ref of the original video.
6346
6074
  */
6347
- export declare type VideoRef = string & {
6348
- __videoRef: never;
6349
- };
6350
-
6075
+ parentRef?: VideoRef_2;
6351
6076
  /**
6352
- * @public
6353
- * A unique identifier that points to a video asset in Canva's backend.
6077
+ * The URL of the video file to upload.
6078
+ *
6079
+ * @remarks
6080
+ * Requirements:
6081
+ *
6082
+ * - Must use HTTPS
6083
+ * - Must return a `200` status code
6084
+ * - `Content-Type` must match the file's MIME type
6085
+ * - Must be publicly accessible (i.e. not a localhost URL)
6086
+ * - Must not redirect
6087
+ * - Must not contain an IP address
6088
+ * - Maximum length: 4096 characters
6089
+ * - Must not contain whitespace
6090
+ * - Must not contain these characters: `>`, `<`, `{`, `}`, `^`, backticks
6091
+ * - Maximum file size: 1000MB (1GB)
6354
6092
  */
6355
- declare type VideoRef_2 = string & {
6356
- __videoRef: never;
6357
- };
6358
-
6093
+ url: string;
6359
6094
  /**
6360
- * @public
6361
- * Options for uploading a video asset to the user's private media library.
6095
+ * The MIME type of the video file.
6362
6096
  */
6363
- declare type VideoUploadOptions = {
6364
- /**
6365
- * The type of asset.
6366
- */
6367
- type: 'video';
6368
- /**
6369
- * A human-readable name for the video asset.
6370
- *
6371
- * @remarks
6372
- * This name is displayed in the user's media library and helps users identify
6373
- * and find the asset later. If not provided, Canva will generate a name based
6374
- * on the asset's URL or a unique identifier.
6375
- *
6376
- * Requirements:
6377
- * - Minimum length: 1 character (empty strings are not allowed)
6378
- * - Maximum length: 255 characters
6379
- */
6380
- name?: string;
6381
- /**
6382
- * The ref of the original asset from which this new asset was derived.
6383
- *
6384
- * @remarks
6385
- * For example, if an app applies an effect to a video, `parentRef` should contain the ref of the original video.
6386
- */
6387
- parentRef?: VideoRef_2;
6388
- /**
6389
- * The URL of the video file to upload.
6390
- *
6391
- * @remarks
6392
- * Requirements:
6393
- *
6394
- * - Must use HTTPS
6395
- * - Must return a `200` status code
6396
- * - `Content-Type` must match the file's MIME type
6397
- * - Must be publicly accessible (i.e. not a localhost URL)
6398
- * - Must not redirect
6399
- * - Must not contain an IP address
6400
- * - Maximum length: 4096 characters
6401
- * - Must not contain whitespace
6402
- * - Must not contain these characters: `>`, `<`, `{`, `}`, `^`, backticks
6403
- * - Maximum file size: 1000MB (1GB)
6404
- */
6405
- url: string;
6406
- /**
6407
- * The MIME type of the video file.
6408
- */
6409
- mimeType: VideoMimeType;
6410
- /**
6411
- * The URL of a thumbnail video to display while the video is queued for upload.
6412
- *
6413
- * @remarks
6414
- * Requirements:
6415
- *
6416
- * - Must use HTTPS
6417
- * - Must support [Cross-Origin Resource Sharing](https://www.canva.dev/docs/apps/cross-origin-resource-sharing/)
6418
- * - Maximum length: 4096 characters
6419
- * - The dimensions of the thumbnail video must match the video's aspect ratio to prevent the thumbnail from appearing squashed or stretched
6420
- * - Must not be an AVI file. Although our APIs support uploading AVI videos, Canva can't preview them because of native support of browsers
6421
- */
6422
- thumbnailVideoUrl?: string;
6423
- /**
6424
- * The URL of a thumbnail image to use as a fallback if `thumbnailVideoUrl` isn't provided.
6425
- * This can be an external URL or a data URL.
6426
- *
6427
- * @remarks
6428
- * Requirements for external URLs:
6429
- *
6430
- * - Must use HTTPS
6431
- * - Must support [Cross-Origin Resource Sharing](https://www.canva.dev/docs/apps/cross-origin-resource-sharing/)
6432
- * - Must be a PNG, JPEG, or SVG file
6433
- * - Maximum length: 4096 characters
6434
- *
6435
- * Requirements for data URLs:
6436
- *
6437
- * - Must include `;base64` for base64-encoded data
6438
- * - Maximum size: 10MB (10 × 1024 × 1024 characters)
6439
- * - The dimensions of the thumbnail must match the video's aspect ratio to prevent the thumbnail from appearing squashed or stretched
6440
- */
6441
- thumbnailImageUrl: string;
6442
- /**
6443
- * A disclosure identifying if the app generated this video using AI.
6444
- *
6445
- * @remarks
6446
- * Helps users make informed decisions about the content they interact with.
6447
- * See {@link AiDisclosure} for the full definition.
6448
- *
6449
- * **App Generated**
6450
- *
6451
- * 'app_generated' indicates when the app creates or significantly alters an asset using AI. Includes when
6452
- * the app requests a third-party service to take similar action on a video using AI.
6453
- *
6454
- * Required for the following cases (this list is not exhaustive):
6455
- * | Case | Reason |
6456
- * | -- | -- |
6457
- * | AI generates a new video from scratch | Creates new creative content |
6458
- * | AI changes the style of the video e.g. makes it cartoon | Significantly alters the style |
6459
- * | AI adds subtitles that rely on subjective interpretation | Creates new creative content |
6460
- * | AI expands a video by generating new content to fill the edges | Creates new creative content |
6461
- * | AI animates an image | Creates new creative content |
6462
- * | AI fixes defects e.g. blur in a video by generating details | Creates new creative content |
6463
- * | AI generates a talking head presenter | Creates new creative content |
6464
- *
6465
- * **None**
6466
- *
6467
- * 'none' indicates when the app doesn't create or significantly alter an asset using AI, or as a part of
6468
- * a request to third-party hosted content.
6469
- *
6470
- * Required for the following cases (this list is not exhaustive):
6471
- * | Case | Reason |
6472
- * | -- | -- |
6473
- * | Asset comes from an asset library | Didn't generate the asset itself |
6474
- * | AI corrects red eyes | A minor correction |
6475
- * | AI adjusts brightness and contrast on a video | Doesn't change original meaning by itself |
6476
- * | AI creates a slow motion effect in a video | Doesn't change original meaning by itself |
6477
- * | AI adds AI word-by-word transcribed subtitles to a video | Doesn't change original meaning by itself |
6478
- */
6479
- aiDisclosure: AiDisclosure;
6097
+ mimeType: VideoMimeType;
6098
+ /**
6099
+ * The URL of a thumbnail video to display while the video is queued for upload.
6100
+ *
6101
+ * @remarks
6102
+ * Requirements:
6103
+ *
6104
+ * - Must use HTTPS
6105
+ * - Must support [Cross-Origin Resource Sharing](https://www.canva.dev/docs/apps/cross-origin-resource-sharing/)
6106
+ * - Maximum length: 4096 characters
6107
+ * - The dimensions of the thumbnail video must match the video's aspect ratio to prevent the thumbnail from appearing squashed or stretched
6108
+ * - Must not be an AVI file. Although our APIs support uploading AVI videos, Canva can't preview them because of native support of browsers
6109
+ */
6110
+ thumbnailVideoUrl?: string;
6111
+ /**
6112
+ * The URL of a thumbnail image to use as a fallback if `thumbnailVideoUrl` isn't provided.
6113
+ * This can be an external URL or a data URL.
6114
+ *
6115
+ * @remarks
6116
+ * Requirements for external URLs:
6117
+ *
6118
+ * - Must use HTTPS
6119
+ * - Must support [Cross-Origin Resource Sharing](https://www.canva.dev/docs/apps/cross-origin-resource-sharing/)
6120
+ * - Must be a PNG, JPEG, or SVG file
6121
+ * - Maximum length: 4096 characters
6122
+ *
6123
+ * Requirements for data URLs:
6124
+ *
6125
+ * - Must include `;base64` for base64-encoded data
6126
+ * - Maximum size: 10MB (10 × 1024 × 1024 characters)
6127
+ * - The dimensions of the thumbnail must match the video's aspect ratio to prevent the thumbnail from appearing squashed or stretched
6128
+ */
6129
+ thumbnailImageUrl: string;
6130
+ /**
6131
+ * A disclosure identifying if the app generated this video using AI.
6132
+ *
6133
+ * @remarks
6134
+ * Helps users make informed decisions about the content they interact with.
6135
+ * See {@link AiDisclosure} for the full definition.
6136
+ *
6137
+ * **App Generated**
6138
+ *
6139
+ * 'app_generated' indicates when the app creates or significantly alters an asset using AI. Includes when
6140
+ * the app requests a third-party service to take similar action on a video using AI.
6141
+ *
6142
+ * Required for the following cases (this list is not exhaustive):
6143
+ * | Case | Reason |
6144
+ * | -- | -- |
6145
+ * | AI generates a new video from scratch | Creates new creative content |
6146
+ * | AI changes the style of the video e.g. makes it cartoon | Significantly alters the style |
6147
+ * | AI adds subtitles that rely on subjective interpretation | Creates new creative content |
6148
+ * | AI expands a video by generating new content to fill the edges | Creates new creative content |
6149
+ * | AI animates an image | Creates new creative content |
6150
+ * | AI fixes defects e.g. blur in a video by generating details | Creates new creative content |
6151
+ * | AI generates a talking head presenter | Creates new creative content |
6152
+ *
6153
+ * **None**
6154
+ *
6155
+ * 'none' indicates when the app doesn't create or significantly alter an asset using AI, or as a part of
6156
+ * a request to third-party hosted content.
6157
+ *
6158
+ * Required for the following cases (this list is not exhaustive):
6159
+ * | Case | Reason |
6160
+ * | -- | -- |
6161
+ * | Asset comes from an asset library | Didn't generate the asset itself |
6162
+ * | AI corrects red eyes | A minor correction |
6163
+ * | AI adjusts brightness and contrast on a video | Doesn't change original meaning by itself |
6164
+ * | AI creates a slow motion effect in a video | Doesn't change original meaning by itself |
6165
+ * | AI adds AI word-by-word transcribed subtitles to a video | Doesn't change original meaning by itself |
6166
+ */
6167
+ aiDisclosure: AiDisclosure;
6480
6168
 
6481
- } & AllOrNone<Dimensions_2>;
6169
+ } & AllOrNone<Dimensions_2>;
6482
6170
 
6171
+ /**
6172
+ * A set of dimensions with an auto-calculated height.
6173
+ */
6174
+ declare type Width = {
6483
6175
  /**
6484
- * A set of dimensions with an auto-calculated height.
6176
+ * A width, in pixels.
6177
+ *
6178
+ * @remarks
6179
+ * - The pixels are relative to their container.
6180
+ * - Minimum: 0
6181
+ * - Maximum: 32767
6485
6182
  */
6486
- declare type Width = {
6487
- /**
6488
- * A width, in pixels.
6489
- *
6490
- * @remarks
6491
- * - The pixels are relative to their container.
6492
- * - Minimum: 0
6493
- * - Maximum: 32767
6494
- */
6495
- width: number;
6496
- /**
6497
- * Indicates that the height should be auto-calculated.
6498
- */
6499
- height: 'auto';
6500
- };
6501
-
6183
+ width: number;
6502
6184
  /**
6503
- * A set of dimensions, in pixels.
6185
+ * Indicates that the height should be auto-calculated.
6504
6186
  */
6505
- declare type WidthAndHeight = {
6506
- /**
6507
- * A width, in pixels.
6508
- *
6509
- * @remarks
6510
- * - The pixels are relative to their container.
6511
- * - Minimum: 0
6512
- * - Maximum: 32767
6513
- */
6514
- width: number;
6515
- /**
6516
- * A height, in pixels.
6517
- *
6518
- * @remarks
6519
- * - The pixels are relative to their container.
6520
- * - Minimum: 0
6521
- * - Maximum: 32767
6522
- */
6523
- height: number;
6524
- };
6187
+ height: 'auto';
6188
+ };
6525
6189
 
6190
+ /**
6191
+ * A set of dimensions, in pixels.
6192
+ */
6193
+ declare type WidthAndHeight = {
6526
6194
  /**
6527
- * @public
6528
- * The behavior of zipping the exported files.
6195
+ * A width, in pixels.
6529
6196
  *
6530
6197
  * @remarks
6531
- * For `png`, `jpg`, and `svg`:
6532
- * - `auto` (default): Files are zipped together if the design has multiple pages, unzipped if it has one page.
6533
- * - `always`: Files are always zipped into a single zip file, regardless of page count.
6534
- * - `never`: Files are never zipped, providing an array of files.
6198
+ * - The pixels are relative to their container.
6199
+ * - Minimum: 0
6200
+ * - Maximum: 32767
6201
+ */
6202
+ width: number;
6203
+ /**
6204
+ * A height, in pixels.
6535
6205
  *
6536
- * For `video` and `gif`:
6537
- * - `auto` or `never` (default): Files are never zipped together, regardless of count.
6538
- * - `always`: Files are always zipped into a single file.
6206
+ * @remarks
6207
+ * - The pixels are relative to their container.
6208
+ * - Minimum: 0
6209
+ * - Maximum: 32767
6539
6210
  */
6540
- export declare type ZipBehavior = 'auto' | 'always' | 'never';
6211
+ height: number;
6212
+ };
6213
+
6214
+ /**
6215
+ * @public
6216
+ * The behavior of zipping the exported files.
6217
+ *
6218
+ * @remarks
6219
+ * For `png`, `jpg`, and `svg`:
6220
+ * - `auto` (default): Files are zipped together if the design has multiple pages, unzipped if it has one page.
6221
+ * - `always`: Files are always zipped into a single zip file, regardless of page count.
6222
+ * - `never`: Files are never zipped, providing an array of files.
6223
+ *
6224
+ * For `video` and `gif`:
6225
+ * - `auto` or `never` (default): Files are never zipped together, regardless of count.
6226
+ * - `always`: Files are always zipped into a single file.
6227
+ */
6228
+ export declare type ZipBehavior = 'auto' | 'always' | 'never';
6541
6229
 
6542
- export { }
6230
+ export { }