This article contains a list of all methods available on main pixie object. For description and method list of various available tools see individual articles for tools:
Create a new editor instance.
init(config: PixieConfig): Promise<Pixie>
Open editor.
open(config?: Partial<PixieConfig>): void
Close editor.
close(): void
Override editor configuration.
setConfig(config: Partial<PixieConfig>): void
Open file upload window and add selected image to canvas.
uploadAndAddImage(): Promise<void>
Open file upload window and replace canvas contents with selected image.
uploadAndReplaceMainImage(): Promise<void>
Open file upload window and replace canvas contents with selected state file.
uploadAndOpenStateFile(): Promise<void>
Clear current canvas and open a new one at specified size.
newCanvas(width: number, height: number, bgColor?: string): Promise<{ width: number; height: number }>
Get current canvas state as json string.
getState(customProps?: string[]): string
Replace current canvas contents with specified pixie state.
setState(data: string | SerializedPixieState): Promise<void>
Replace current canvas contents with pixie state file loaded from specified url.
setStateFromUrl(url: string): Promise<void>
Open specified tool (crop, draw, text etc.)
openTool(name: ToolName): void
Apply any pending changes from currently open tool. This is identical to clicking "apply" button in the editor.
applyChanges(): void
Cancel any pending changes from currently open tool. This is identical to clicking "cancel" button in the editor.
cancelChanges(): void
Fully reset editor state and optionally override specified configuration.
resetEditor(config?: PixieConfig): Promise<void>
Toggle specified floating panel.
togglePanel(name: "newImage" | "history" | "objects" | "export", isOpen?: boolean): void
Listen to specified canvas event. (List of all available events can be found in the documentation)
on(event: "object:modified", handler: (e: ObjectModifiedEvent) => void): void
isDirty(): boolean
Check if any modifications made to canvas have not been applied yet.
Display specified notification message in the editor.
notify(message: string): string