index.d.ts 986 B

123456789101112131415161718192021222324252627282930313233
  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. theme?: PartialDeep<Theme<SelectTheme>> | undefined;
  29. }, context?: import("@inquirer/type").Context) => Promise<Value> & {
  30. cancel: () => void;
  31. };
  32. export default _default;
  33. export { Separator } from '@inquirer/core';