The SubscriberController is responsible for all listeners which can influence the application-state from outside. Callbacks inside this controller can be set by window.SDK.subscriber.{method-name}

Hierarchy

  • SubscriberController

Methods

  • Listener on actions, if this changes, this listener will get triggered with the updates

    Parameters

    • actions: string

      Stringified array of DocumentAction type

    Returns void

  • Listener on when a certain animation gets changed

    Parameters

    • animation: string

      Stringified array of FrameAnimationType

    Returns void

  • Listener on the playback state of the animation, it contains the current time of the playback (in milliseconds) and a flag that describes if the animation is currently playing

    Parameters

    • animationPlaybackState: string

      Stringified array of AnimationPlaybackType

    Returns void

  • Listener on async errors. Async errors are thrown at times not directly tied to SDK calls. e.g. Getting an action error triggered after a late event.

    If this is an ActionAsyncError:

    • id refers to the action id
    • event refers to the event that triggered the action
    • eventChain refers the chain of events that lead to the action, first item being the closest parent.

    Parameters

    • asyncError: string

      error triggered asynchronously

    Returns void

  • Listener on character styles, if this changes, this listener will get triggered with the updates

    Parameters

    • characterStyles: string

      Stringified object of character styles

    Returns void

  • Listener on the state of the currently selected color's styles, if this changes, this listener will get triggered with the updates

    Parameters

    • colors: string

      Stringified object of colors

    Returns void

  • Listener on connector events, this listener will get triggered when a connector emits one of those events

    • reloadRequired
    • authChanged
    • unloaded
    • stateChanged

    stateChanged - this event will be triggered by connector states: loading, loaded, running, ready, error

    Parameters

    • connectorEvent: string

      Stringified object of ConnectorEvent

    Returns void

  • Listener of editor entering / exiting the crop mode

    Parameters

    • Optional id: string

      frame id when entering / null when exiting

    Returns void

  • Listener on fonts, if this changes, this listener will get triggered with the updates

    Parameters

    • fonts: string

      Stringified object of fonts

    Returns void

  • Listener on layouts, this listener will get triggered when a (sub)layout is

    • created
    • removed
    • renamed
    • duplicated

    Parameters

    • layouts: string

      Stringified object of layouts

    Returns void

  • Listener on page size, this listener will get triggered when the page size is changed, while the document is a project. This will not emit anything if your document is a template.

    Parameters

    • pageSize: string

      Stringified object of the PageSize

    Returns void

  • Listener on paragraph styles, if this changes, this listener will get triggered with the updates

    Parameters

    • paragraphStyles: string

      Stringified object of paragraph styles

    Returns void

  • Listener on the state of the currently selected frame, it contains some basic information on the type of frame it is

    Parameters

    • frameContent: string

      Stringified object of FrameType

    Returns void

  • Listener on the state of the currently selected frame, if this changes, this listener will get triggered with the updates

    Parameters

    • frameLayout: string

      Stringified object of FrameLayoutType

    Returns void

  • Listener on the state of the currently selected layout's frames, if this changes, this listener will get triggered with the updates

    Parameters

    • layoutFrames: string

      Stringified object of Frames

    Returns void

  • Listener on selected layout id, this listener will get triggered when a different layout is selected.

    Parameters

    • id: string

      the currently selected layout id

    Returns void

  • Listener on the state of the currently selected layout, if its properties are changed, this listener will get triggered with the new properties

    Parameters

    • layoutProperties: string

      Stringified object of LayoutPropertiesType

    Returns void

  • Listener on the state of the currently selected text's styles, if this changes, this listener will get triggered with the updates

    Parameters

    • styles: string

      Stringified object of styles

    Returns void

  • Listener on when the tool has changed by the canvas

    Parameters

    • tool: string

      the string representation of a certain tool

    Returns void

  • Listener on corner radii of rectangle and polygon shapes, this listener will get triggered when any corner radius is changed

    Parameters

    • cornerRadius: string

      Stringified object of the CornerRadius

    Returns void

  • A listener on the general state of the document, gets triggered every time a change is done on the document.

    Returns void

  • Listener on state changes

    Parameters

    • undoState: string

      Stringified object of UndoState

    Returns void

  • Listener on when variables change

    Parameters

    • variablesJson: string

      Stringified array of Variable

    Returns void

  • Listener on scale factor of the canvas, this listener will get triggered when a zoom is applied to the canvas

    Parameters

    • zoom: string

      Stringified scale factor

    Returns void

Generated using TypeDoc