AttachmentAPI

Interface AttachmentAPI

With the AttachmentAPI you can access additional data attached to a node.

interface AttachmentAPI {
    createAttachment(dataType?: AttachmentType): number;
    fetchAttachmentData<T = any>(attachmentID?: number): Promise<T>;
    getAttachmentData<T = any>(attachmentID?: number): T;
    getAttachmentDataURI(attachmentID?: number): string;
    removeAttachment(attachmentID?: number, safe?: boolean): RemoveState;
    setAttachmentData<T = any>(attachmentID?: number, data?: T): void;
    setAttachmentDataURI(attachmentID?: number, dataURI?: string): void;
}

Hierarchy (View Summary)

Methods

  • Creates a new attachment.

    Parameters

    Returns number

    The attachment id.

  • Fetches & returns the attachment data.

    Type Parameters

    • T = any

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    Returns Promise<T>

    The attached data.

  • Returns the attachment data.

    Type Parameters

    • T = any

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    Returns T

    The attached data

    getAttachmentData is deprecated, please use fetchAttachmentData instead.

  • Returns the attachment data URI.

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    Returns string

  • Removes the Attachment from the scene and all related Snapshots.

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    • Optionalsafe: boolean

      Performs a safe remove which interrupt the removal process if the Attachment is part of one or more Snapshots.

    Returns RemoveState

  • Sets the attachment data.

    Type Parameters

    • T = any

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    • Optionaldata: T

      The new attachment data.

    Returns void

  • Sets the attachment data URI.

    Parameters

    • OptionalattachmentID: number

      Specifies the attachment object.

    • OptionaldataURI: string

      The attachment data URI.

    Returns void


Did you find this page useful? Please give it a rating:
Thank you for rating this page!
Any issues or feedback?
What kind of problem would you like to report?
Please tell us more about what's wrong: