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 authentication expiration. The callback should resolve to the refreshed authentication. If the listener is not defined, the http requests from the connector will return 401 with no refetch of assets.

    When this emits it means either:

    • the grafxToken needs to be renewed
    • any other authentication needs to be renewed (user impersonation, static..)

    Parameters

    • authRefreshRequest: string

      Stringified object of AuthRefreshRequest

    Returns Promise<null | string>

  • Listener on when barcode frames change their validation state

    Parameters

    • validationResults: string

      the json string representation of the validation results

    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 on connectors, if this changes, this listener will get triggered with the updates

    Parameters

    • connectors: string

      Stringified array of ConnectorInstance type

    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 font families

    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

    • framesContent: string

      Stringified array of Frame objects

    Returns void

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

    Parameters

    • framesLayout: string

      Stringified array of FrameLayoutType objects

    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 unit of the currently active layout. If you switch between layouts with different units, this listener will get triggered with the new unit If you switch the unit of a layout this listener will get triggered with the new unit

    Parameters

    • unit: string

      Stringified object of MeasurementUnit

    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

  • 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 when the view mode has changed

    Parameters

    • viewMode: string

      the string representation of a view mode

    Returns void

  • Listener on viewport request. The callback should resolve to the visible viewport. If the listener is not defined, the viewport will take full size.

    When this emits it means that the engine requested the viewport for a zoom to page call.

    Returns null | string

  • 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