SAS logoSAS® Mobile Investigator API
    Preparing search index...

    Interface PageAttachmentsApi

    interface PageAttachmentsApi {
        add(attachments: (Blob | File)[]): FileChange;
        deleteByUuids(attachmentUuids: string[]): FileChange;
        getAddingCount(): number;
        getAll(): SmiPageFile[];
        getByUuid(attachmentUuid: string): SmiPageFile | undefined;
        getDeletingCount(): number;
        onChange(callback: (change: FileChange) => void): () => void;
    }
    Index

    Methods

    • Adds all the attachments in the supplied array, and uploads them if possible.

      Parameters

      • attachments: (Blob | File)[]

        An array of attachments to upload.

      Returns FileChange

      The details of the file change.

    • Deletes all the attachments associated with the current page that match the UUIDs in the supplied array.

      Parameters

      • attachmentUuids: string[]

        An array of attachment UUIDs to delete.

      Returns FileChange

      A file change detail object containing an array of all the changes.

    • Returns the number of pending adds for attachments.

      Returns number

      The number of pending adds for attachments.

    • Gets all attachments associated with the current page.

      Returns SmiPageFile[]

      An array of page files.

    • Gets an attachment associated with the current page that matches the supplied UUID.

      Parameters

      • attachmentUuid: string

        The UUID of the attachment.

      Returns SmiPageFile | undefined

      Returns either a page file, or undefined.

    • Returns the number of pending deletes for attachments.

      Returns number

      The number of pending deletes for attachments.

    • The supplied callback fires when any file in the "Attachment" category changes

      Parameters

      • callback: (change: FileChange) => void

        The callback function.

      Returns () => void

      A function to remove the listener for attachments changes.