Options
All
  • Public
  • Public/Protected
  • All
Menu

The Clipboard aptitude provides access to the OS's clipboard.

Hierarchy

  • Clipboard

Index

Methods

  • listen(includeOliveHelpsEvents: boolean, callback: (clipboardText: string) => void): Promise<Cancellable>
  • Starts listening to changes to the clipboard.

    Parameters

    • includeOliveHelpsEvents: boolean

      if passed in true, callback will be called while olive helps window is in focus

    • callback: (clipboardText: string) => void

      A function that's called whenever the clipboard's contents change.

        • (clipboardText: string): void
        • Parameters

          • clipboardText: string

          Returns void

    Returns Promise<Cancellable>

  • listenWithOptions(filterOptions: FilterOptions, callback: (clipboardText: string) => void): Promise<Cancellable>
  • Parameters

    • filterOptions: FilterOptions
    • callback: (clipboardText: string) => void
        • (clipboardText: string): void
        • Parameters

          • clipboardText: string

          Returns void

    Returns Promise<Cancellable>

  • read(): Promise<string>
  • Returns Promise<string>

    A Promise resolving with the current contents of the clipboard.

  • write(text: string): Promise<void>
  • Writes the provided text into the clipboard.

    Parameters

    • text: string

      A string to write to clipboard

    Returns Promise<void>

Generated using TypeDoc