Skip to content

Latest commit

 

History

History
38 lines (22 loc) · 1.01 KB

Clipboard.md

File metadata and controls

38 lines (22 loc) · 1.01 KB

Clipboard namespace

Includes functions dealing with system clipboard.

Methods:

  • Clipboard.read()

    returns object containing clipboard data

  • Clipboard.readText()

    returns either string or undefined if clipboard does not contain textual data.

  • Clipboard.write(data):boolean

    Puts data into clipboard.

  • Clipboard.writeText(string):boolean

    Puts the string into clipboard.

  • Clipboard.has(type:string):boolean

    Checks if clipboard contains data of given type: "text" | "html" | "image" | "file" | "json" | "link".

Clipboard Data Object

Clipboard data object is a plain JS object that may contain following properties:

  • text: string - text;
  • html: string - html fragment;
  • json: value - arbitrary JSON data;
  • file: [path0,path1, ...] - list of file paths;
  • link: { caption: string, url: string} - link to some file / location;
  • image: Graphics.Image - image object;