index.d.ts 902 B

12345678910111213141516171819202122232425
  1. import { Separator, type Theme } from '@inquirer/core';
  2. import type { PartialDeep } from '@inquirer/type';
  3. type Key = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
  4. type Choice<Value> = {
  5. key: Key;
  6. value: Value;
  7. } | {
  8. key: Key;
  9. name: string;
  10. value: Value;
  11. };
  12. declare const _default: <Value>(config: {
  13. message: string;
  14. choices: readonly {
  15. key: Key;
  16. name: string;
  17. }[] | readonly (Separator | Choice<Value>)[];
  18. default?: (Key | "h") | undefined;
  19. expanded?: boolean | undefined;
  20. theme?: PartialDeep<Theme> | undefined;
  21. }, context?: import("@inquirer/type").Context) => Promise<Value> & {
  22. cancel: () => void;
  23. };
  24. export default _default;
  25. export { Separator } from '@inquirer/core';