Action
IReplayActionSource
- Web
- Android
- IOS
import type { IReplayActionSource } from '@picsart/web-replay-sdk';
import com.picsart.media.actions.ActionMeta.Source
| Values | Description |
|---|---|
| '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
- Web
- Android
- IOS
import type { IReplayActionMeta } from '@picsart/web-replay-sdk';
import com.picsart.media.actions.ActionMeta
| Property | Type | Required | Description |
|---|---|---|---|
| version | SemVer | yes | The version of the tool at the moment when the action has been done |
| packageId | string | yes | A 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 |
| source | IReplayActionSource | yes | Identifies whether the tool is native or miniapp |
IReplayAction
- Web
- Android
- IOS
import type { IReplayAction } from '@picsart/web-replay-sdk';
import com.picsart.media.actions.Action
| Property | Type | Required | Description |
|---|---|---|---|
| id | UUIDString | yes | A unique id identifying for the action. The value is auto-generated |
| params | JsonObject | yes | This 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) |
| meta | IReplayActionMeta | yes | The meta information about the tool that has done the action |
| update | - | yes | The information of the changes done to the context |
| update.add | - | no | Any information that is an addition to the context |
| update.add.layers | (IReplayLayer & { parentId: IReplayLayer['uuid']; index?: number })[] | no | An 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 | - | no | Any information that is an edition of the existing context |
| update.edit.layers | (DeepPartial<IReplayLayer> & { uuid: IReplayLayer['uuid'] })[] | no | The patches to the layers that have been edited by this action. |
| update.edit.layout | IReplayLayout | no | The layout information that has been changed by this action |
| update.remove | - | no | Any information that has been removed from the existing context |
| update.remove.layers | IReplayLayer['uuid'][] | no | Ids of the layers that are removed |