Options
All
  • Public
  • Public/Protected
  • All
Menu

See Electron Documentation for clipboard for details

Example

'use strict'

module.exports = (pluginContext) => {
    const clipboard = pluginContext.clipboard;

    function startup() { ... }
    function search(query, res) { ... }

    function execute(id, payload, extra) {
        clipboard.readText().then((result) => {
            console.log('Text from clipboard: ' + result);
        });
    }

    return { startup, search, execute };
};

Methods

  • clear(type: string): void
  • Clear the clipboard of contents

    Parameters

    type:  string

    The clipboard type to clear

  • readHTML(type?: string): Promise<string>
  • Read the clipboard in HTML format

    Parameters

    type:  string

    The clipboard type to read

    Optional 

    Returns Promise<string>

  • readText(type?: string): Promise<string>
  • Read the clipboard in text format

    Parameters

    type:  string

    The clipboard type to read

    Optional 

    Returns Promise<string>

  • writeHTML(html: string, type?: string): void
  • Write to the clipboard in HTML format

    Parameters

    html:  string

    The html content to place on the clipboard

    type:  string

    The clipboard type to clear

    Optional 
  • writeText(text: string, type?: string): void
  • Write to the clipboard in text format

    Parameters

    text:  string

    The content to place on the clipboard

    type:  string

    The clipboard type to write

    Optional 

Generated using TypeDoc