index.d.ts 676 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. Write (copy) to the clipboard asynchronously.
  3. @param text - The text to write to the clipboard.
  4. */
  5. export function write(text: string): Promise<void>;
  6. /**
  7. Write (copy) to the clipboard synchronously.
  8. Doesn't work in browsers.
  9. @param text - The text to write to the clipboard.
  10. @example
  11. ```
  12. import * as clipboardy from 'clipboardy';
  13. clipboardy.writeSync('🦄');
  14. clipboardy.readSync();
  15. //=> '🦄'
  16. ```
  17. */
  18. export function writeSync(text: string): void;
  19. /**
  20. Read (paste) from the clipboard asynchronously.
  21. */
  22. export function read(): Promise<string>;
  23. /**
  24. Read (paste) from the clipboard synchronously.
  25. Doesn't work in browsers.
  26. */
  27. export function readSync(): string;