index.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Separator, type Theme } from '@inquirer/core';
  2. import type { PartialDeep } from '@inquirer/type';
  3. type SelectTheme = {
  4. icon: {
  5. cursor: string;
  6. };
  7. style: {
  8. disabled: (text: string) => string;
  9. description: (text: string) => string;
  10. };
  11. helpMode: 'always' | 'never' | 'auto';
  12. indexMode: 'hidden' | 'number';
  13. };
  14. type Choice<Value> = {
  15. value: Value;
  16. name?: string;
  17. description?: string;
  18. short?: string;
  19. disabled?: boolean | string;
  20. type?: never;
  21. };
  22. declare const _default: <Value>(config: {
  23. message: string;
  24. choices: readonly (string | Separator)[] | readonly (Separator | Choice<Value>)[];
  25. pageSize?: number | undefined;
  26. loop?: boolean | undefined;
  27. default?: unknown;
  28. instructions?: {
  29. navigation: string;
  30. pager: string;
  31. } | undefined;
  32. theme?: PartialDeep<Theme<SelectTheme>> | undefined;
  33. }, context?: import("@inquirer/type").Context) => Promise<Value> & {
  34. cancel: () => void;
  35. };
  36. export default _default;
  37. export { Separator } from '@inquirer/core';