index.d.ts 796 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /// <reference types="node"/>
  2. /**
  3. Show cursor.
  4. @param stream - Default: `process.stderr`.
  5. @example
  6. ```
  7. import * as cliCursor from 'cli-cursor';
  8. cliCursor.show();
  9. ```
  10. */
  11. export function show(stream?: NodeJS.WritableStream): void;
  12. /**
  13. Hide cursor.
  14. @param stream - Default: `process.stderr`.
  15. @example
  16. ```
  17. import * as cliCursor from 'cli-cursor';
  18. cliCursor.hide();
  19. ```
  20. */
  21. export function hide(stream?: NodeJS.WritableStream): void;
  22. /**
  23. Toggle cursor visibility.
  24. @param force - Is useful to show or hide the cursor based on a boolean.
  25. @param stream - Default: `process.stderr`.
  26. @example
  27. ```
  28. import * as cliCursor from 'cli-cursor';
  29. const unicornsAreAwesome = true;
  30. cliCursor.toggle(unicornsAreAwesome);
  31. ```
  32. */
  33. export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void;