editContent
Reads and edits fill content from the user's design.
Parameters
options
object
Options for configuring how a design is read. Must specify contentType: 'fill'
.
target
string
This must be "current_page"
.
contentType
string
This must be "fill"
.
callback
function
A callback that receives a FillContentSession
for editing.
Parameters
session
FillContentSession
Session for reading and updating fill content in a user's design.
contents
FillContent[]
Read-onlyFill content in the design.
type
string
This must be "image"
.
ref
ImageRef
A unique identifier that points to an image asset in Canva's backend.
deleted
boolean
Indicates whether the object containing this fill has been deleted.
altText
AltText
A description of the image content.
Use undefined
for content with no description.
text
string
The text content.
decorative
boolean | undefined
Indicates where the alternative text should be displayed.
- If
true
, the alternative text will only be displayed in the editor. - If
false
, the alternative text will be displayed in the editor and in view-only mode.
type
string
This must be "video"
.
ref
VideoRef
A unique identifier that points to an video asset in Canva's backend.
deleted
boolean
Indicates whether the object containing this fill has been deleted.
altText
AltText
A description of the video content.
Use undefined
for content with no description.
text
string
The text content.
decorative
boolean | undefined
Indicates where the alternative text should be displayed.
- If
true
, the alternative text will only be displayed in the editor. - If
false
, the alternative text will be displayed in the editor and in view-only mode.
sync
function
- Any changes in the session are only reflected in the design after this method is called.
- Once this method is called, further changes in the session can still be made.
Returns
Promise<void>
Returns
void
or Promise<void>
Returns
A promise that resolves when editing is complete.
Promise<void>