API reference
Asset: Test
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagebulkCreate.launchcreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignMetadatagetDesignTemplateMetadatagetDesignTokeninitAppElementopenDesignoverlay.registerOnCanOpenpublish.launchrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDragChangelog
Design: Test
Error
Error: Test
Intents
Intents: Content
Intents: Data
Intents: Design
Intents: Test
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInfonotification.addToastrequestOpenExternalUrlChangelog
Platform: Test
User
User: Test
initTestEnvironment
API reference for the initTestEnvironment method.
This API is only for use in unit testing and shouldn't be part of your main app code.
Initializes a test environment for the @canva/asset package, enabling unit tests to mock Canva's APIs.
This method should only be called once in a test environment, such as in a Jest setup file.
Usage: Setting up a test environment
// Import testing sub-packageimport * as asset from "@canva/asset/test";// Initialize the test environmentasset.initTestEnvironment();// Mock the SDKjest.mock("@canva/asset");
TYPESCRIPT
Returns
void