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


alignCenter()

alignCenter(shapes?): void

Align selected shapes to horizontally center

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:614


alignHorizontalSpaceAround()

alignHorizontalSpaceAround(shapes?): void

Align selected shapes horizontally with space around

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:736


alignLeft()

alignLeft(shapes?): void

Align selected shapes to left

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:558


alignMiddle()

alignMiddle(shapes?): void

Align selected shapes to vertically middle

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:703


alignRight()

alignRight(shapes?): void

Align selected shapes to right

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:586


alignTop()

alignTop(shapes?): void

Align selected shapes to top

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:647


alignVerticalSpaceAround()

alignVerticalSpaceAround(shapes?): void

Align selected shapes vertically with space around

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:779


bringForward()

bringForward(shapes?): void

Bring selected shapes forward

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:518


bringToFront()

bringToFront(shapes?): void

Bring selected shapes to front

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:478


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?): 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

Returns

Shape[]

Source

actions.ts:368


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


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


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


sendToBack()

sendToBack(shapes?): void

Send selected shapes to back

Parameters

shapes?: Shape[]

Returns

void

Source

actions.ts:498


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


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