The VariableController is responsible for all communication regarding the variables. Methods inside this controller can be called by window.SDK.variable.{method-name}

Hierarchy

  • VariableController

Properties

date: DateVariable
number: NumberVariable

Methods

  • This method aggregates the provided variables into a new group

    Returns

    group id

    Parameters

    • name: string

      name of the new group

    • ids: string[]

      list of variable ids to group together

    Returns Promise<EditorResponse<string>>

  • This method moves a variable's position

    Returns

    Parameters

    • order: number

      new order of variable

    • id: string

      id of the variable

    • parentId: string

      parent id of the created variable

    Returns Promise<EditorResponse<null>>

  • This method changes positions of variables

    Returns

    Parameters

    • order: number

      new order of variable

    • ids: string[]

      Array of the variable IDs

    • parentId: string

      parent id of the variables

    Returns Promise<EditorResponse<null>>

  • This method sets the image variable connector. Setting a connector will automatically remove the assetId linked to the connector if present. If a connector was the source of the variable, it will be unregistered.

    Returns

    The new id of the connector

    Parameters

    • id: string

      The id of the image variable to update

    • registration: ConnectorRegistration

      registration object containing all details about the connector

    Returns Promise<EditorResponse<string>>

  • This method sets the items of the list variable

    The items need to be unique and are not case sensitive.

    Returns

    Parameters

    • id: string

      the id of the list variable

    • items: string[]

      the items of the list

    Returns Promise<EditorResponse<null>>

  • Experimental

    Sets the prefix character style for a supported variable

    Returns

    Parameters

    • id: string

      the id of the variable to update

    • characterStyleId: null | string

      the id of the character style to use/clear for the prefix

    Returns Promise<EditorResponse<null>>

  • Experimental

    Sets the suffix character style for a supported variable

    Returns

    Parameters

    • id: string

      the id of the variable to update

    • characterStyleId: null | string

      the id of the character style to use/clear for the suffix

    Returns Promise<EditorResponse<null>>

  • This method sets a new value for a variable

    If the value is some text to be set on a ShortTextVariable, it must not contain any type of line breaks.

    Returns

    Parameters

    • id: string

      the id of the variable

    • value: null | string | number | boolean

      the new value of the variable

    Returns Promise<EditorResponse<null>>

Generated using TypeDoc