Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EditorApi

Hierarchy

Index

Constructors

constructor

Properties

close

close: () => void

Closes the PhotoEditor SDK UI and disposes all Engine instance

Type declaration

    • (): void
    • Returns void

deserialize

deserialize: (data: SerialisationSchema) => Promise<void>

Deserializes serialization schema to editor state

param

Type declaration

dispose

dispose: () => void

Disposes the PhotoEditor SDK Engine instance

Type declaration

    • (): void
    • Returns void

events

events: {}

Type declaration

export

export: (options?: ExportConfiguration["image"] & { preventExportEvent?: boolean }) => Promise<ExportData>

Exports an image

param
returns

Type declaration

    • (options?: ExportConfiguration["image"] & { preventExportEvent?: boolean }): Promise<ExportData>
    • Parameters

      • Optional options: ExportConfiguration["image"] & { preventExportEvent?: boolean }

      Returns Promise<ExportData>

hasChanges

hasChanges: () => boolean

returns if editor has some changes

Type declaration

    • (): boolean
    • Returns boolean

reset

reset: () => void

Resets the PhotoEditor SDK

Type declaration

    • (): void
    • Returns void

serialize

serialize: (options: { image: boolean }) => Promise<SerialisationSchema>

Serializes current editor state to the serialization schema

param
param

Type declaration

setImage

setImage: (image: string | HTMLImageElement) => Promise<void>

Dynamically sets the image to the ui

param

Type declaration

    • (image: string | HTMLImageElement): Promise<void>
    • Parameters

      • image: string | HTMLImageElement

      Returns Promise<void>

Methods

addListener

  • Adds the listener function to the end of the list of listeners for the specified event. No checks are made to see if listener has already been added. Multiple calls passing the same combination of event and listener will result in the listener being added, and called, multiple times.

    Parameters

    • event: UIEvent

      The name of the event.

    • listener: Listener

      The callback function.

    Returns this

emit

  • emit(event: UIEvent, ...args: any[]): boolean
  • Emits the event to all of its registered listeners.

    Parameters

    • event: UIEvent

      The event to be emitted to its listeners.

    • Rest ...args: any[]

      The arguments to be passed along with the event.

    Returns boolean

    false if there were no listeners for the emitted event.

off

on

removeAllListeners

  • removeAllListeners(event: UIEvent): this

removeListener

  • Removes the most recently added instance of listener from the list of listeners for the specified event.

    Once an event has been emitted, all listeners attached to it at the time of emitting will be called in order. This implies that any removeListener or removeAllListeners calls after emitting and before the last listener finishes execution will not remove them from emit() in progress. Subsequent events will behave as expected.

    Parameters

    • event: UIEvent

      The name of the event.

    • listener: Listener

      The callback function to be removed.

    Returns this