The Asset class represents an asset in Editor.

Hierarchy

  • Events
    • Asset

Constructors

Accessors

Methods

  • Checks if path exists. See the Asset overview for a full list of properties.

    Parameters

    • path: string

      The path

    Returns boolean

    True if path exists

  • Inserts value in array at path, at specified index. See the Asset overview for a full list of properties.

    Parameters

    • path: any

      The path

    • value: any

      The value

    • index: any

      The index (if undefined the value will be inserted in the end)

    Returns boolean

    Whether the value was inserted

  • Creates an instance of this template asset. Assumes this asset is a template asset.

    Parameters

    • parent: Entity

      The parent entity

    • options: { extraData?: object; history?: boolean; index?: number; select?: boolean } = {}
      • OptionalextraData?: object

        Extra data passed to the backend. Used by the Editor on specific cases.

      • Optionalhistory?: boolean

        Whether to record a history action.

      • Optionalindex?: number

        The desired index under the parent to instantiate the template.

      • Optionalselect?: boolean

        Whether to select the new entity.

    Returns Promise<Entity>

    The new entity.

  • Remove value from array at path. See the Asset overview for a full list of properties.

    Parameters

    • path: any

      The path

    • value: any

      The value

    Returns boolean

    Whether the value was removed

  • Replaces any references to this asset with references to the new asset specified.

    Parameters

    • asset: Asset

      The new asset.

    • options: { history?: boolean } = {}
      • Optionalhistory?: boolean

        Whether to record a history action.

    Returns void

  • Sets value at path. See the Asset overview for a full list of properties.

    Parameters

    • path: string

      The path

    • value: any

      The value

    Returns boolean

    Whether the value was set

  • Unsets value at path. See the Asset overview for a full list of properties.

    Parameters

    • path: string

      The path

    Returns boolean

    Whether the value was unset

  • Gets the file URL for an asset file.

    Parameters

    • id: number

      The asset id

    • filename: string

      The desired filename

    Returns string

    The file URL