Skip to main content
Version: 3.0.0

Action

IReplayActionSource

Implementation.

import type { IReplayActionSource } from '@picsart/web-replay-sdk';
ValuesDescription
'native'This value is used to specify that the action is created from a native tool(Some reference to glossary).
'miniapp'This value is used to specify that the action is created from a miniapp tool

IReplayActionMeta

Implementation.

import type { IReplayActionMeta } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
versionSemVeryesThe version of the tool at the moment when the action has been done
packageIdstringyesA unique identifier to that corresponds to the tool which has done the action. NOTE the packageId must remain the same for the tool regardless of the tool's version
sourceIReplayActionSourceyesIdentifies whether the tool is native or miniapp

IReplayAction

Implementation.

import type { IReplayAction } from '@picsart/web-replay-sdk';
PropertyTypeRequiredDescription
idUUIDStringyesA unique id identifying for the action. The value is auto-generated
paramsJsonObjectyesThis value can be used to store any information related to the action. The value will be later used in "Replay mode"(Some reference to glossary). NOTE the tool must store here all the required information about the changes it has done to the context in order to be able to replicate the same changes in "Replay mode"(Some reference to glossary)
metaIReplayActionMetayesThe meta information about the tool that has done the action
update-yesThe information of the changes done to the context
update.add-noAny information that is an addition to the context
update.add.layers(IReplayLayer & { parentId: IReplayLayer['uuid']; index?: number })[]noAn Array of layers that are being added to the context. Each array item includes the layer information and a layer id where the new layer must be added(parentId). Additionally it is possible to pass the index at which index to add the new layer. Index here is the child order(stacking context)
update.edit-noAny information that is an edition of the existing context
update.edit.layers(DeepPartial<IReplayLayer> & { uuid: IReplayLayer['uuid'] })[]noThe patches to the layers that have been edited by this action.
update.edit.layoutIReplayLayoutnoThe layout information that has been changed by this action
update.remove-noAny information that has been removed from the existing context
update.remove.layersIReplayLayer['uuid'][]noIds of the layers that are removed