Skip to content

Actions

Editor actions

Constructors

new Actions()

new Actions(editor): Actions

Parameters

editor: Editor

Returns

Actions

Source

actions.ts:69

Properties

editor

editor: Editor

Source

actions.ts:67

Methods

addPage()

addPage(position?): Page

Add a page

Parameters

position?: number

Returns

Page

Source

actions.ts:90


alignBottom()

alignBottom(shapes?): void

Align selected shapes to bottom

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:683


alignCenter()

alignCenter(shapes?): void

Align selected shapes to horizontally center

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:622


alignHorizontalSpaceAround()

alignHorizontalSpaceAround(shapes?): void

Align selected shapes horizontally with space around

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:744


alignLeft()

alignLeft(shapes?): void

Align selected shapes to left

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:566


alignMiddle()

alignMiddle(shapes?): void

Align selected shapes to vertically middle

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:711


alignRight()

alignRight(shapes?): void

Align selected shapes to right

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:594


alignTop()

alignTop(shapes?): void

Align selected shapes to top

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:655


alignVerticalSpaceAround()

alignVerticalSpaceAround(shapes?): void

Align selected shapes vertically with space around

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:787


bringForward()

bringForward(shapes?): void

Bring selected shapes forward

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:526


bringToFront()

bringToFront(shapes?): void

Bring selected shapes to front

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:486


copy()

copy(shapes?): Promise<void>

Copy selected shapes

Parameters

shapes?: Shape[]

Returns

Promise<void>

Source

actions.ts:268


cut()

cut(shapes?): Promise<void>

Cut selected shapes

Parameters

shapes?: Shape[]

Returns

Promise<void>

Source

actions.ts:279


duplicate()

duplicate(shapes?, dx?, dy?, parent?): Shape[]

Duplicate shapes

Parameters

shapes?: Shape[]

The shapes to duplicate. If not provided, the selected shapes will be duplicated

dx?: number= 30

The horizontal distance to move the duplicated shapes

dy?: number= 30

The vertical distance to move the duplicated shapes

parent?: Shape

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

Returns

Shape[]

Source

actions.ts:369


duplicatePage()

duplicatePage(page, position, initializer?): Page

Duplicate a page

Parameters

page: Page

position: number

initializer?

Returns

Page

Source

actions.ts:134


group()

group(shapes?): void

Group selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:443


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:161


move()

move(dx, dy, shapes?): void

Move selected shapes

Parameters

dx: number

dy: number

shapes?: Shape[]

Returns

void

Source

actions.ts:406


paste()

paste(page?): Promise<void>

Paste

Parameters

page?: Page

Returns

Promise<void>

Source

actions.ts:300


redo()

redo(): void

Redo

Returns

void

Source

actions.ts:83


remove()

remove(shapes?): void

Remove selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:250


removePage()

removePage(page): void

Remove a page

Parameters

page: Page

Returns

void

Source

actions.ts:112


reorderPage()

reorderPage(page, position): void

Reorder a page

Parameters

page: Page

position: number

Returns

void

Source

actions.ts:123


sendBackward()

sendBackward(shapes?): void

Send selected shapes backward

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:546


sendToBack()

sendToBack(shapes?): void

Send selected shapes to back

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:506


undo()

undo(): void

Undo

Returns

void

Source

actions.ts:76


ungroup()

ungroup(shapes?): void

Ungroup selected shapes

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:463


update()

update(values, objs?): void

Update obj properties

Parameters

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

objs?: Obj[]

Returns

void

Source

actions.ts:176