You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
676 B

1 month ago
  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;