Skip to content

Actions

Editor actions

Constructors

new Actions()

new Actions(editor): Actions

Parameters

editor: Editor

Returns

Actions

Source

actions.ts:29

Properties

editor

editor: Editor

Source

actions.ts:27

Methods

addPage()

addPage(position?): Page

Add a page

Parameters

position?: number

Returns

Page

Source

actions.ts:50


alignBottom()

alignBottom(shapes?): void

Align selected shapes to bottom

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:602


alignCenter()

alignCenter(shapes?): void

Align selected shapes to horizontally center

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:541


alignLeft()

alignLeft(shapes?): void

Align selected shapes to left

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:485


alignMiddle()

alignMiddle(shapes?): void

Align selected shapes to vertically middle

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:630


alignRight()

alignRight(shapes?): void

Align selected shapes to right

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:513


alignTop()

alignTop(shapes?): void

Align selected shapes to top

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:574


bringForward()

bringForward(shapes?): void

Bring selected shapes forward

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:445


bringToFront()

bringToFront(shapes?): void

Bring selected shapes to front

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:405


copy()

copy(shapes?): Promise<void>

Copy selected shapes

Parameters

shapes?: Shape[]

Returns

Promise<void>

Source

actions.ts:179


cut()

cut(shapes?): Promise<void>

Cut selected shapes

Parameters

shapes?: Shape[]

Returns

Promise<void>

Source

actions.ts:190


duplicate()

duplicate(shapes?): void

Duplicate shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:276


duplicatePage()

duplicatePage(page, position): Page

Duplicate a page

Parameters

page: Page

position: number

Returns

Page

Source

actions.ts:94


group()

group(shapes?): void

Group selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:340


insert()

insert(shape, parent?): void

Insert a shape into the current page or another shape

Parameters

shape: Shape

The shape to insert

parent?: Shape

The parent shape to insert the shape into. If not provided, the shape will be inserted into the current page

Returns

void

Source

actions.ts:115


move()

move(dx, dy, shapes?): void

Move selected shapes

Parameters

dx: number

dy: number

shapes?: Shape[]

Returns

void

Source

actions.ts:303


paste()

paste(page?): Promise<void>

Paste

Parameters

page?: Page

Returns

Promise<void>

Source

actions.ts:211


redo()

redo(): void

Redo

Returns

void

Source

actions.ts:43


remove()

remove(shapes?): void

Remove selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:161


removePage()

removePage(page): void

Remove a page

Parameters

page: Page

Returns

void

Source

actions.ts:72


reorderPage()

reorderPage(page, position): void

Reorder a page

Parameters

page: Page

position: number

Returns

void

Source

actions.ts:83


sendBackward()

sendBackward(shapes?): void

Send selected shapes backward

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:465


sendToBack()

sendToBack(shapes?): void

Send selected shapes to back

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:425


undo()

undo(): void

Undo

Returns

void

Source

actions.ts:36


ungroup()

ungroup(shapes?): void

Ungroup selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:375


update()

update(values, objs?): void

Update obj properties

Parameters

values: Partial<Shape & Doc & Page & Box & Path & Line & Rectangle & Ellipse & Text & Image & Connector & Freehand & Highlighter & Group & Frame & Embed>

objs?: Obj[]

Returns

void

Source

actions.ts:130