Actions
Editor actions
Constructors
new Actions()
new Actions(
editor
):Actions
Parameters
• editor: Editor
Returns
Source
Properties
editor
editor:
Editor
Source
Methods
addPage()
addPage(
position
?):Page
Add a page
Parameters
• position?: number
Returns
Source
alignBottom()
alignBottom(
shapes
?):void
Align selected shapes to bottom
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignCenter()
alignCenter(
shapes
?):void
Align selected shapes to horizontally center
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignHorizontalSpaceAround()
alignHorizontalSpaceAround(
shapes
?):void
Align selected shapes horizontally with space around
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignLeft()
alignLeft(
shapes
?):void
Align selected shapes to left
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignMiddle()
alignMiddle(
shapes
?):void
Align selected shapes to vertically middle
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignRight()
alignRight(
shapes
?):void
Align selected shapes to right
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignTop()
alignTop(
shapes
?):void
Align selected shapes to top
Parameters
• shapes?: Shape
[]
Returns
void
Source
alignVerticalSpaceAround()
alignVerticalSpaceAround(
shapes
?):void
Align selected shapes vertically with space around
Parameters
• shapes?: Shape
[]
Returns
void
Source
bringForward()
bringForward(
shapes
?):void
Bring selected shapes forward
Parameters
• shapes?: Shape
[]
Returns
void
Source
bringToFront()
bringToFront(
shapes
?):void
Bring selected shapes to front
Parameters
• shapes?: Shape
[]
Returns
void
Source
copy()
copy(
shapes
?):Promise
<void
>
Copy selected shapes
Parameters
• shapes?: Shape
[]
Returns
Promise
<void
>
Source
cut()
cut(
shapes
?):Promise
<void
>
Cut selected shapes
Parameters
• shapes?: Shape
[]
Returns
Promise
<void
>
Source
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
duplicatePage()
duplicatePage(
page
,position
,initializer
?):Page
Duplicate a page
Parameters
• page: Page
• position: number
• initializer?
Returns
Source
group()
group(
shapes
?):void
Group selected shapes
Parameters
• shapes?: Shape
[]
Returns
void
Source
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
move()
move(
dx
,dy
,shapes
?):void
Move selected shapes
Parameters
• dx: number
• dy: number
• shapes?: Shape
[]
Returns
void
Source
paste()
paste(
page
?):Promise
<void
>
Paste
Parameters
• page?: Page
Returns
Promise
<void
>
Source
redo()
redo():
void
Redo
Returns
void
Source
remove()
remove(
shapes
?):void
Remove selected shapes
Parameters
• shapes?: Shape
[]
Returns
void
Source
removePage()
removePage(
page
):void
Remove a page
Parameters
• page: Page
Returns
void
Source
reorderPage()
reorderPage(
page
,position
):void
Reorder a page
Parameters
• page: Page
• position: number
Returns
void
Source
sendBackward()
sendBackward(
shapes
?):void
Send selected shapes backward
Parameters
• shapes?: Shape
[]
Returns
void
Source
sendToBack()
sendToBack(
shapes
?):void
Send selected shapes to back
Parameters
• shapes?: Shape
[]
Returns
void
Source
undo()
undo():
void
Undo
Returns
void
Source
ungroup()
ungroup(
shapes
?):void
Ungroup selected shapes
Parameters
• shapes?: Shape
[]
Returns
void
Source
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