index.d.ts 622 B

12345678910111213141516171819202122232425262728293031323334
  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. @param text - The text to write to the clipboard.
  9. @example
  10. ```
  11. import * as clipboardy from 'clipboardy';
  12. clipboardy.writeSync('🦄');
  13. clipboardy.readSync();
  14. //=> '🦄'
  15. ```
  16. */
  17. export function writeSync(text: string): void;
  18. /**
  19. Read (paste) from the clipboard asynchronously.
  20. */
  21. export function read(): Promise<string>;
  22. /**
  23. Read (paste) from the clipboard synchronously.
  24. */
  25. export function readSync(): string;