SheetXL - v0.3.20
    Preparing search index...

    Class InternalClipboard

    The Internal clipboard is a replacement for the native clipboard api. This should be used for several reasons:

    1. Guarantees that the intra-application clipboard actions will work even if system clipboard is unavailable.

      • This can be because the browser doesn't support it (e.g. Firefox)
      • The user has restricted native clipboard access
    2. Polyfill for onclipboardchange event.

    3. Implements ReferenceableClipboard. These are items that add a paste callback to the clipboard to allow for items to only be copied when the paste operation is performed.

    InternalClipboard will attempt to sync with the native clipboard unless sync is false.

    • If a mimetype is text/html/image then value will be copied to the clipboard.
    • TODO - If native copy/paste events are fired wrap them.
    • TODO - Once private web mimeTypes are widely supported we can use them rather than embedding into html
    • TODO - Allow for service worker to copy across tabs and sessions.

    Implements

    Index

    Constructors

    Methods

    • Events types supported: copy, cut, paste, nativeSyncWarning, and (clipboardchange as a polyfill)

      Parameters

      • type: string

        A known string type.

      • callback: EventListenerOrEventListenerObject

        A Callback.

      • Optionaloptions: boolean | AddEventListenerOptions

        Listener options.

      Returns void

      AddEventListenerOptions.signal is not supported. useCapture is not supported.

    • Simple method for clearing the clipboard.

      Parameters

      • Optionalnative: boolean

        By default this will only clear the reference. Set to true to clear the native clipboard items if available.

      Returns void

    • Returns void

    • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • Returns Promise<ClipboardItems>

    • Returns Promise<string>

    • Removes the event listener in target's event listener list with the same type, callback, and options.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Parameters

      • data: ClipboardItems

      Returns Promise<void>

    • Parameters

      • data: string

      Returns Promise<void>