@reliverse/rempts-core 1.6.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +398 -102
  2. package/dist/cli.d.ts +32 -0
  3. package/dist/cli.js +731 -0
  4. package/dist/config-loader.d.ts +42 -0
  5. package/dist/config-loader.js +20 -0
  6. package/dist/config.d.ts +99 -0
  7. package/dist/config.js +188 -0
  8. package/dist/file-loader.d.ts +43 -0
  9. package/dist/file-loader.js +199 -0
  10. package/dist/global-flags.d.ts +36 -0
  11. package/dist/global-flags.js +36 -0
  12. package/dist/mod.d.ts +13 -0
  13. package/dist/mod.js +19 -0
  14. package/dist/parser.d.ts +6 -0
  15. package/dist/parser.js +137 -0
  16. package/dist/plugin/context.d.ts +13 -0
  17. package/dist/plugin/context.js +53 -0
  18. package/dist/plugin/create.d.ts +92 -0
  19. package/dist/plugin/create.js +61 -0
  20. package/dist/plugin/loader.d.ts +12 -0
  21. package/dist/plugin/loader.js +65 -0
  22. package/dist/plugin/manager.d.ts +53 -0
  23. package/dist/plugin/manager.js +135 -0
  24. package/dist/plugin/mod.d.ts +10 -0
  25. package/dist/plugin/mod.js +27 -0
  26. package/dist/plugin/store.d.ts +45 -0
  27. package/dist/plugin/store.js +60 -0
  28. package/dist/plugin/testing.d.ts +38 -0
  29. package/dist/plugin/testing.js +175 -0
  30. package/dist/plugin/types.d.ts +146 -0
  31. package/dist/tui/registry.d.ts +8 -0
  32. package/dist/tui/registry.js +10 -0
  33. package/dist/tui/types.d.ts +58 -0
  34. package/dist/tui/types.js +10 -0
  35. package/dist/types.d.ts +178 -0
  36. package/dist/types.js +25 -0
  37. package/dist/utils/logger.d.ts +10 -0
  38. package/dist/utils/logger.js +27 -0
  39. package/dist/utils/merge.d.ts +13 -0
  40. package/dist/utils/merge.js +25 -0
  41. package/dist/utils/mod.d.ts +6 -0
  42. package/dist/utils/mod.js +2 -0
  43. package/dist/utils/type-helpers.d.ts +41 -0
  44. package/dist/utils/type-helpers.js +0 -0
  45. package/dist/validation.d.ts +30 -0
  46. package/dist/validation.js +121 -0
  47. package/package.json +47 -44
  48. package/src/cli.ts +1049 -0
  49. package/src/config-loader.ts +71 -0
  50. package/src/config.ts +270 -0
  51. package/src/file-loader.ts +346 -0
  52. package/src/global-flags.ts +50 -0
  53. package/src/mod.ts +74 -0
  54. package/src/parser.ts +212 -0
  55. package/src/plugin/context.ts +88 -0
  56. package/src/plugin/create.ts +174 -0
  57. package/src/plugin/loader.ts +111 -0
  58. package/src/plugin/manager.ts +244 -0
  59. package/src/plugin/mod.ts +51 -0
  60. package/src/plugin/store.ts +124 -0
  61. package/src/plugin/testing.ts +236 -0
  62. package/src/plugin/types.ts +206 -0
  63. package/src/tui/registry.ts +22 -0
  64. package/src/tui/types.ts +79 -0
  65. package/src/types.ts +285 -0
  66. package/src/utils/logger.ts +43 -0
  67. package/src/utils/merge.ts +54 -0
  68. package/src/utils/mod.ts +7 -0
  69. package/src/utils/type-helpers.ts +151 -0
  70. package/src/validation.ts +177 -0
  71. package/LICENSE +0 -21
  72. package/bin/core-impl/anykey/anykey-mod.d.ts +0 -12
  73. package/bin/core-impl/anykey/anykey-mod.js +0 -125
  74. package/bin/core-impl/date/date.d.ts +0 -2
  75. package/bin/core-impl/date/date.js +0 -236
  76. package/bin/core-impl/editor/editor-mod.d.ts +0 -25
  77. package/bin/core-impl/editor/editor-mod.js +0 -896
  78. package/bin/core-impl/figures/figures-mod.d.ts +0 -233
  79. package/bin/core-impl/figures/figures-mod.js +0 -286
  80. package/bin/core-impl/figures/figures.test.d.ts +0 -1
  81. package/bin/core-impl/figures/figures.test.js +0 -474
  82. package/bin/core-impl/input/confirm-prompt.d.ts +0 -5
  83. package/bin/core-impl/input/confirm-prompt.js +0 -173
  84. package/bin/core-impl/input/input-prompt.d.ts +0 -16
  85. package/bin/core-impl/input/input-prompt.js +0 -370
  86. package/bin/core-impl/launcher/_parser.d.ts +0 -2
  87. package/bin/core-impl/launcher/_parser.js +0 -122
  88. package/bin/core-impl/launcher/_utils.d.ts +0 -8
  89. package/bin/core-impl/launcher/_utils.js +0 -29
  90. package/bin/core-impl/launcher/args.d.ts +0 -3
  91. package/bin/core-impl/launcher/args.js +0 -89
  92. package/bin/core-impl/launcher/command.d.ts +0 -8
  93. package/bin/core-impl/launcher/command.js +0 -68
  94. package/bin/core-impl/launcher/launcher-mod.d.ts +0 -8
  95. package/bin/core-impl/launcher/launcher-mod.js +0 -34
  96. package/bin/core-impl/launcher/usage.d.ts +0 -3
  97. package/bin/core-impl/launcher/usage.js +0 -104
  98. package/bin/core-impl/msg-fmt/colors.d.ts +0 -30
  99. package/bin/core-impl/msg-fmt/colors.js +0 -42
  100. package/bin/core-impl/msg-fmt/logger.d.ts +0 -17
  101. package/bin/core-impl/msg-fmt/logger.js +0 -106
  102. package/bin/core-impl/msg-fmt/mapping.d.ts +0 -3
  103. package/bin/core-impl/msg-fmt/mapping.js +0 -49
  104. package/bin/core-impl/msg-fmt/messages.d.ts +0 -35
  105. package/bin/core-impl/msg-fmt/messages.js +0 -314
  106. package/bin/core-impl/msg-fmt/terminal.d.ts +0 -15
  107. package/bin/core-impl/msg-fmt/terminal.js +0 -59
  108. package/bin/core-impl/msg-fmt/variants.d.ts +0 -11
  109. package/bin/core-impl/msg-fmt/variants.js +0 -52
  110. package/bin/core-impl/next-steps/next-steps.d.ts +0 -14
  111. package/bin/core-impl/next-steps/next-steps.js +0 -24
  112. package/bin/core-impl/number/number-mod.d.ts +0 -28
  113. package/bin/core-impl/number/number-mod.js +0 -197
  114. package/bin/core-impl/results/results.d.ts +0 -7
  115. package/bin/core-impl/results/results.js +0 -27
  116. package/bin/core-impl/select/multiselect-prompt.d.ts +0 -2
  117. package/bin/core-impl/select/multiselect-prompt.js +0 -341
  118. package/bin/core-impl/select/nummultiselect-prompt.d.ts +0 -6
  119. package/bin/core-impl/select/nummultiselect-prompt.js +0 -105
  120. package/bin/core-impl/select/numselect-prompt.d.ts +0 -7
  121. package/bin/core-impl/select/numselect-prompt.js +0 -115
  122. package/bin/core-impl/select/select-prompt.d.ts +0 -33
  123. package/bin/core-impl/select/select-prompt.js +0 -302
  124. package/bin/core-impl/select/toggle-prompt.d.ts +0 -5
  125. package/bin/core-impl/select/toggle-prompt.js +0 -208
  126. package/bin/core-impl/st-end/end.d.ts +0 -2
  127. package/bin/core-impl/st-end/end.js +0 -42
  128. package/bin/core-impl/st-end/start.d.ts +0 -17
  129. package/bin/core-impl/st-end/start.js +0 -66
  130. package/bin/core-impl/task/progress.d.ts +0 -2
  131. package/bin/core-impl/task/progress.js +0 -57
  132. package/bin/core-impl/task/spinner.d.ts +0 -15
  133. package/bin/core-impl/task/spinner.js +0 -110
  134. package/bin/core-impl/utils/colorize.d.ts +0 -2
  135. package/bin/core-impl/utils/colorize.js +0 -134
  136. package/bin/core-impl/utils/errors.d.ts +0 -1
  137. package/bin/core-impl/utils/errors.js +0 -15
  138. package/bin/core-impl/utils/prevent.d.ts +0 -10
  139. package/bin/core-impl/utils/prevent.js +0 -69
  140. package/bin/core-impl/utils/prompt-end.d.ts +0 -8
  141. package/bin/core-impl/utils/prompt-end.js +0 -33
  142. package/bin/core-impl/utils/stream-text.d.ts +0 -18
  143. package/bin/core-impl/utils/stream-text.js +0 -136
  144. package/bin/core-impl/utils/system.d.ts +0 -6
  145. package/bin/core-impl/utils/system.js +0 -7
  146. package/bin/core-impl/utils/validate.d.ts +0 -22
  147. package/bin/core-impl/utils/validate.js +0 -17
  148. package/bin/core-impl/visual/animate/animate.d.ts +0 -14
  149. package/bin/core-impl/visual/animate/animate.js +0 -64
  150. package/bin/core-impl/visual/ascii-art/ascii-art.d.ts +0 -6
  151. package/bin/core-impl/visual/ascii-art/ascii-art.js +0 -12
  152. package/bin/core-types.d.ts +0 -434
  153. package/bin/main.d.ts +0 -41
  154. package/bin/main.js +0 -96
  155. /package/{bin/core-types.js → dist/plugin/types.js} +0 -0
@@ -1,434 +0,0 @@
1
- export type MsgType = "M_NULL" | "M_INFO_NULL" | "M_START" | "M_MIDDLE" | "M_GENERAL" | "M_GENERAL_NULL" | "M_INFO" | "M_ERROR" | "M_ERROR_NULL" | "M_END" | "M_NEWLINE" | "M_BAR";
2
- export type TypographyName = "bold" | "strikethrough" | "underline" | "italic" | "none";
3
- export type BorderColorName = "reset" | "inverse" | "dim" | "black" | "red" | "redBright" | "green" | "greenBright" | "yellow" | "yellowBright" | "blue" | "blueBright" | "magenta" | "magentaBright" | "cyan" | "cyanBright" | "bgCyan" | "bgCyanBright" | "white" | "gray";
4
- export type ColorName = BorderColorName | "gradientGradient" | "rainbowGradient" | "cristalGradient" | "mindGradient" | "passionGradient" | "viceGradient" | "retroGradient" | "none";
5
- export type AnimationName = "rainbow" | "pulse" | "glitch" | "radar" | "neon" | "karaoke";
6
- export type VariantName = "doubleBox" | "none";
7
- export type MsgConfig = {
8
- symbol: string;
9
- prefix?: string;
10
- color?: (text: string) => string;
11
- newLineBefore?: boolean;
12
- newLineAfter?: boolean;
13
- suffix?: string;
14
- };
15
- export type PromptOptions = {
16
- schema?: any;
17
- title?: string;
18
- titleColor?: ColorName;
19
- titleTypography?: TypographyName;
20
- titleVariant?: VariantName;
21
- titleAnimation?: AnimationName;
22
- titleAnimationDelay?: number;
23
- content?: string;
24
- contentColor?: ColorName;
25
- contentTypography?: TypographyName;
26
- contentVariant?: VariantName;
27
- hint?: string;
28
- placeholder?: string;
29
- validate?: (value: any) => boolean | string | Promise<boolean | string>;
30
- defaultColor?: ColorName;
31
- defaultTypography?: TypographyName;
32
- choices?: ChoiceOptions[];
33
- variantOptions?: {
34
- box?: {
35
- limit?: number;
36
- };
37
- };
38
- action?: () => Promise<void>;
39
- border?: boolean;
40
- borderColor?: BorderColorName;
41
- additionalLinesToDelete?: number;
42
- hintPlaceholderColor?: ColorName;
43
- hints?: string[];
44
- required?: boolean;
45
- initial?: any[];
46
- endTitle?: string;
47
- endTitleColor?: ColorName;
48
- horizontalLine?: boolean;
49
- horizontalLineLength?: number;
50
- symbol?: string;
51
- customSymbol?: string;
52
- };
53
- export type ChoiceRequiredOptions = {
54
- id: string;
55
- title: string;
56
- };
57
- export type ChoiceOptionalOptions = {
58
- description?: string;
59
- titleTypography?: TypographyName;
60
- action?: () => Promise<void>;
61
- };
62
- export type ChoiceOptions = ChoiceRequiredOptions & ChoiceOptionalOptions;
63
- export type SelectOption<T> = {
64
- value: T;
65
- label: string;
66
- hint?: string;
67
- disabled?: boolean;
68
- };
69
- /**
70
- * Standard terminal colors supported by most terminals
71
- */
72
- export type StandardColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray";
73
- /**
74
- * All possible output colors including special colors
75
- */
76
- export type OutputColor = StandardColor | "dim";
77
- export type EditorExitResult = {
78
- saved: boolean;
79
- content: string | null;
80
- filename: string | null;
81
- };
82
- export type ArgType = "boolean" | "string" | "number" | "enum" | "positional" | undefined;
83
- export type _ArgDef<T extends ArgType, VT extends boolean | number | string> = {
84
- type?: T;
85
- description?: string;
86
- valueHint?: string;
87
- alias?: string | string[];
88
- default?: VT;
89
- required?: boolean;
90
- options?: (string | number)[];
91
- };
92
- export type BooleanArgDef = Omit<_ArgDef<"boolean", boolean>, "options"> & {
93
- negativeDescription?: string;
94
- };
95
- export type StringArgDef = Omit<_ArgDef<"string", string>, "options">;
96
- export type NumberArgDef = Omit<_ArgDef<"number", number>, "options">;
97
- export type EnumArgDef = _ArgDef<"enum", string>;
98
- export type PositionalArgDef = Omit<_ArgDef<"positional", string>, "alias" | "options">;
99
- export type ArgDef = BooleanArgDef | StringArgDef | NumberArgDef | PositionalArgDef | EnumArgDef;
100
- export type ArgsDef = Record<string, ArgDef>;
101
- export type Arg = ArgDef & {
102
- name: string;
103
- alias: string[];
104
- };
105
- export type Dict<T> = Record<string, T>;
106
- export type Arrayable<T> = T | T[];
107
- export type Default = Dict<any>;
108
- export type ParserOptions = {
109
- boolean?: Arrayable<string>;
110
- string?: Arrayable<string>;
111
- alias?: Dict<Arrayable<string>>;
112
- default?: Dict<any>;
113
- unknown?(flag: string): void;
114
- };
115
- export type ParserArgv<T = Default> = T & {
116
- _: string[];
117
- };
118
- type ResolveParsedArgType<T extends ArgDef, VT> = T extends {
119
- default?: any;
120
- required?: boolean;
121
- } ? T["default"] extends NonNullable<VT> ? VT : T["required"] extends true ? VT : VT | undefined : VT | undefined;
122
- type ParsedPositionalArg<T extends ArgDef> = T extends {
123
- type: "positional";
124
- } ? ResolveParsedArgType<T, string> : never;
125
- type ParsedStringArg<T extends ArgDef> = T extends {
126
- type: "string";
127
- } ? ResolveParsedArgType<T, string> : never;
128
- type ParsedNumberArg<T extends ArgDef> = T extends {
129
- type: "number";
130
- } ? ResolveParsedArgType<T, number> : never;
131
- type ParsedBooleanArg<T extends ArgDef> = T extends {
132
- type: "boolean";
133
- } ? ResolveParsedArgType<T, boolean> : never;
134
- type ParsedEnumArg<T extends ArgDef> = T extends {
135
- type: "enum";
136
- options: infer U;
137
- } ? U extends any[] ? ResolveParsedArgType<T, U[number]> : never : never;
138
- type RawArgs = {
139
- _: string[];
140
- };
141
- type ParsedArg<T extends ArgDef> = T["type"] extends "positional" ? ParsedPositionalArg<T> : T["type"] extends "boolean" ? ParsedBooleanArg<T> : T["type"] extends "string" ? ParsedStringArg<T> : T["type"] extends "number" ? ParsedNumberArg<T> : T["type"] extends "enum" ? ParsedEnumArg<T> : never;
142
- export type ParsedArgs<T extends ArgsDef = ArgsDef> = RawArgs & {
143
- [K in keyof T]: ParsedArg<T[K]>;
144
- } & {
145
- [K in keyof T as T[K] extends {
146
- alias: string;
147
- } ? T[K]["alias"] : never]: ParsedArg<T[K]>;
148
- } & {
149
- [K in keyof T as T[K] extends {
150
- alias: string[];
151
- } ? T[K]["alias"][number] : never]: ParsedArg<T[K]>;
152
- } & Record<string, string | number | boolean | string[]>;
153
- export type RunCommandOptions = {
154
- rawArgs: string[];
155
- data?: any;
156
- showUsage?: boolean;
157
- };
158
- export type CommandMeta = {
159
- name?: string;
160
- version?: string;
161
- description?: string;
162
- hidden?: boolean;
163
- };
164
- export type SubCommandsDef = Record<string, Resolvable<CommandDef<any>>>;
165
- export type CommandDef<T extends ArgsDef = ArgsDef> = {
166
- meta?: Resolvable<CommandMeta>;
167
- args?: Resolvable<T>;
168
- subCommands?: Resolvable<SubCommandsDef>;
169
- setup?: (context: CommandContext<T>) => any | Promise<any>;
170
- cleanup?: (context: CommandContext<T>) => any | Promise<any>;
171
- run?: (context: CommandContext<T>) => any | Promise<any>;
172
- };
173
- export type CommandContext<T extends ArgsDef = ArgsDef> = {
174
- rawArgs: string[];
175
- args: ParsedArgs<T>;
176
- cmd: CommandDef<T>;
177
- subCommand?: CommandDef<T>;
178
- data?: any;
179
- };
180
- export type Awaitable<T> = () => T | Promise<T>;
181
- export type Resolvable<T> = T | Promise<T> | (() => T) | (() => Promise<T>);
182
- export type MessageKind = "log" | "info" | "warn" | "error" | "success";
183
- export type VerboseKind = `${MessageKind}-verbose`;
184
- export type AllKinds = MessageKind | VerboseKind;
185
- export type MessageConfig = {
186
- type: "M_INFO" | "M_ERROR";
187
- titleColor?: "retroGradient" | "viceGradient" | "yellowBright";
188
- titleTypography?: "bold";
189
- contentColor?: "dim";
190
- contentTypography?: "italic";
191
- };
192
- export type StreamOptions = {
193
- delay?: number;
194
- useSpinner?: boolean;
195
- spinnerFrames?: string[];
196
- spinnerDelay?: number;
197
- };
198
- export type ProgressBarOptions = {
199
- total: number;
200
- width?: number;
201
- completeChar?: string;
202
- incompleteChar?: string;
203
- format?: string;
204
- colorize?: boolean;
205
- increment?: number;
206
- desiredTotalTime?: number;
207
- };
208
- export type ProgressBar = {
209
- update: (value: number) => Promise<void>;
210
- increment: (amount?: number) => Promise<void>;
211
- render: () => Promise<void>;
212
- };
213
- /**
214
- * Union type for available prompt types.
215
- */
216
- export type PromptType = "input" | "inputmasked" | "select" | "multiselect" | "nummultiselect" | "numselect" | "toggle" | "confirm" | "spinner" | "progressbar" | "results" | "nextsteps" | "animatedtext" | "date" | "end";
217
- export type ConfirmPromptOptions = {
218
- title: string;
219
- defaultValue?: boolean;
220
- content?: string;
221
- titleColor?: ColorName;
222
- titleTypography?: TypographyName;
223
- titleVariant?: VariantName;
224
- contentColor?: ColorName;
225
- contentTypography?: TypographyName;
226
- contentVariant?: VariantName;
227
- borderColor?: BorderColorName;
228
- hintPlaceholderColor?: ColorName;
229
- variantOptions?: any;
230
- action?: () => Promise<void>;
231
- displayInstructions?: boolean;
232
- debug?: boolean;
233
- endTitle?: string;
234
- endTitleColor?: ColorName;
235
- border?: boolean;
236
- terminalWidth?: number;
237
- };
238
- export type StreamTextOptions = {
239
- /**
240
- * Text to stream
241
- */
242
- text: string;
243
- /**
244
- * Delay between each character in milliseconds
245
- * @default 50
246
- */
247
- delay?: number;
248
- /**
249
- * Whether to show cursor while streaming
250
- * @default false
251
- */
252
- showCursor?: boolean;
253
- /**
254
- * Color to use for the text
255
- * @default undefined (no color)
256
- */
257
- color?: ColorName;
258
- /**
259
- * Whether to add a newline at the end
260
- * @default true
261
- */
262
- newline?: boolean;
263
- /**
264
- * Whether to clear the line before streaming
265
- * @default false
266
- */
267
- clearLine?: boolean;
268
- /**
269
- * Callback function to update the spinner text
270
- */
271
- onProgress?: (currentText: string) => void;
272
- };
273
- export type PreventWrongTerminalSizeOptions = {
274
- isDev?: boolean;
275
- shouldExit?: boolean;
276
- minWidth?: number;
277
- minHeight?: number;
278
- sizeErrorDescription?: string;
279
- };
280
- /**
281
- * InputPromptOptions
282
- *
283
- * Extended options for handling user input prompts, including validation
284
- * and UI styling. Inherits from PromptOptions.
285
- */
286
- export type InputPromptOptions = {
287
- border?: boolean;
288
- borderColor?: BorderColorName;
289
- content?: string;
290
- contentColor?: ColorName;
291
- contentTypography?: TypographyName;
292
- contentVariant?: VariantName;
293
- customSymbol?: string;
294
- defaultValue?: string;
295
- endTitle?: string;
296
- endTitleColor?: ColorName;
297
- hardcoded?: {
298
- userInput?: string;
299
- errorMessage?: string;
300
- showPlaceholder?: boolean;
301
- };
302
- hint?: string;
303
- hintPlaceholderColor?: ColorName;
304
- mode?: "plain" | "password";
305
- mask?: string;
306
- placeholder?: string;
307
- schema?: any;
308
- shouldStream?: boolean;
309
- streamDelay?: number;
310
- symbol?: SymbolName;
311
- symbolColor?: ColorName;
312
- title: string;
313
- titleColor?: ColorName;
314
- titleTypography?: TypographyName;
315
- titleVariant?: VariantName;
316
- validate?: (value: string) => string | boolean | undefined | Promise<string | boolean | undefined>;
317
- variantOptions?: unknown;
318
- } & PromptOptions;
319
- export type RenderParams = {
320
- border: boolean;
321
- borderColor?: BorderColorName;
322
- content?: string;
323
- contentColor?: ColorName;
324
- contentTypography?: TypographyName;
325
- contentVariant?: VariantName;
326
- customSymbol?: string;
327
- errorMessage: string;
328
- hint?: string;
329
- hintPlaceholderColor?: ColorName;
330
- mask?: string;
331
- placeholder?: string;
332
- symbol?: SymbolName;
333
- symbolColor?: ColorName;
334
- title: string;
335
- titleColor?: ColorName;
336
- titleTypography?: TypographyName;
337
- titleVariant?: VariantName;
338
- userInput: string;
339
- isRerender?: boolean;
340
- };
341
- /**
342
- * Known symbol names that will have IntelliSense support
343
- */
344
- export type SymbolName = "pointer" | "start" | "middle" | "end" | "line" | "corner_top_right" | "step_active" | "step_error" | "info" | "success";
345
- export type Symbols = Record<SymbolName, string>;
346
- export type FmtMsgOptions = {
347
- type: MsgType;
348
- title?: string;
349
- titleAfterAnim?: string;
350
- content?: string | undefined;
351
- titleColor?: ColorName;
352
- titleTypography?: TypographyName;
353
- titleVariant?: VariantName;
354
- contentColor?: ColorName;
355
- contentTypography?: TypographyName;
356
- contentVariant?: VariantName;
357
- hint?: string;
358
- hintPlaceholderColor?: ColorName;
359
- hintTypography?: TypographyName;
360
- border?: boolean;
361
- borderColor?: ColorName;
362
- dontRemoveBar?: boolean;
363
- variantOptions?: {
364
- box?: {
365
- limit?: number;
366
- };
367
- };
368
- errorMessage?: string;
369
- addNewLineBefore?: boolean;
370
- addNewLineAfter?: boolean;
371
- placeholder?: string;
372
- horizontalLine?: boolean;
373
- horizontalLineLength?: number;
374
- terminalWidth?: number;
375
- instructions?: string;
376
- wrapTitle?: boolean;
377
- wrapContent?: boolean;
378
- symbol?: SymbolName;
379
- customSymbol?: string;
380
- symbolColor?: ColorName;
381
- noNewLine?: boolean;
382
- };
383
- export type TogglePromptParams<T extends string> = {
384
- title: string;
385
- content?: string;
386
- options?: [T, T];
387
- defaultValue?: T;
388
- borderColor?: BorderColorName;
389
- titleColor?: ColorName;
390
- titleTypography?: TypographyName;
391
- titleVariant?: VariantName;
392
- contentColor?: ColorName;
393
- contentTypography?: TypographyName;
394
- border?: boolean;
395
- endTitle?: string;
396
- endTitleColor?: ColorName;
397
- displayInstructions?: boolean;
398
- debug?: boolean;
399
- };
400
- export type SeparatorOption = {
401
- separator: true;
402
- width?: number;
403
- symbol?: SymbolName;
404
- };
405
- export type MultiselectPromptParams<T extends string> = {
406
- title: string;
407
- content?: string;
408
- options: (SelectOption<T> | SeparatorOption)[];
409
- defaultValue?: T[];
410
- borderColor?: BorderColorName;
411
- titleColor?: ColorName;
412
- titleTypography?: TypographyName;
413
- titleVariant?: VariantName;
414
- contentColor?: ColorName;
415
- contentTypography?: TypographyName;
416
- border?: boolean;
417
- endTitle?: string;
418
- endTitleColor?: ColorName;
419
- debug?: boolean;
420
- terminalWidth?: number;
421
- displayInstructions?: boolean;
422
- minSelect?: number;
423
- maxSelect?: number;
424
- selectAll?: boolean;
425
- };
426
- export type DatePromptOptions = PromptOptions & {
427
- dateFormat: string;
428
- dateKind: "birthday" | "other";
429
- defaultValue?: string;
430
- endTitle?: string;
431
- endTitleColor?: ColorName;
432
- border?: boolean;
433
- };
434
- export {};
package/bin/main.d.ts DELETED
@@ -1,41 +0,0 @@
1
- export { anykeyPrompt } from "./core-impl/anykey/anykey-mod.js";
2
- export { datePrompt } from "./core-impl/date/date.js";
3
- export { startEditor } from "./core-impl/editor/editor-mod.js";
4
- export { mainSymbols, fallbackSymbols, } from "./core-impl/figures/figures-mod.js";
5
- export { confirmPrompt } from "./core-impl/input/confirm-prompt.js";
6
- export { inputPrompt } from "./core-impl/input/input-prompt.js";
7
- export { parseArgs, resolveArgs } from "./core-impl/launcher/args.js";
8
- export { defineCommand, runCommand, resolveSubCommand, } from "./core-impl/launcher/command.js";
9
- export type { RunMainOptions } from "./core-impl/launcher/launcher-mod.js";
10
- export { runMain, createMain } from "./core-impl/launcher/launcher-mod.js";
11
- export { showUsage, renderUsage } from "./core-impl/launcher/usage.js";
12
- export { parseRawArgs } from "./core-impl/launcher/_parser.js";
13
- export { toArray, formatLineColumns, resolveValue, CLIError, } from "./core-impl/launcher/_utils.js";
14
- export { toBaseColor, toSolidColor } from "./core-impl/msg-fmt/colors.js";
15
- export { relinkaByRemptsDeprecated, relinkaAsyncByRemptsDeprecated, throwError, } from "./core-impl/msg-fmt/logger.js";
16
- export { colorMap, typographyMap } from "./core-impl/msg-fmt/mapping.js";
17
- export { symbols, bar, fmt, msg, msgUndo, msgUndoAll, printLineBar, } from "./core-impl/msg-fmt/messages.js";
18
- export { getTerminalHeight, getExactTerminalWidth, getTerminalWidth, breakLines, removeCursor, restoreCursor, deleteLastLine, deleteLastLines, countLines, } from "./core-impl/msg-fmt/terminal.js";
19
- export { variantMap, isValidVariant, applyVariant, } from "./core-impl/msg-fmt/variants.js";
20
- export { nextStepsPrompt } from "./core-impl/next-steps/next-steps.js";
21
- export { numberPrompt } from "./core-impl/number/number-mod.js";
22
- export type { ResultsType } from "./core-impl/results/results.js";
23
- export { resultPrompt } from "./core-impl/results/results.js";
24
- export { multiselectPrompt } from "./core-impl/select/multiselect-prompt.js";
25
- export { numMultiSelectPrompt } from "./core-impl/select/nummultiselect-prompt.js";
26
- export { numSelectPrompt } from "./core-impl/select/numselect-prompt.js";
27
- export { selectPrompt } from "./core-impl/select/select-prompt.js";
28
- export { togglePrompt } from "./core-impl/select/toggle-prompt.js";
29
- export { endPrompt } from "./core-impl/st-end/end.js";
30
- export { startPrompt } from "./core-impl/st-end/start.js";
31
- export { progressTaskPrompt } from "./core-impl/task/progress.js";
32
- export { spinnerTaskPrompt } from "./core-impl/task/spinner.js";
33
- export { colorize } from "./core-impl/utils/colorize.js";
34
- export { errorHandler } from "./core-impl/utils/errors.js";
35
- export { preventUnsupportedTTY, preventWindowsHomeDirRoot, preventWrongTerminalSize, } from "./core-impl/utils/prevent.js";
36
- export { completePrompt, renderEndLine, renderEndLineInput, } from "./core-impl/utils/prompt-end.js";
37
- export { streamText, streamTextBox, streamTextWithSpinner, } from "./core-impl/utils/stream-text.js";
38
- export { pm, reliversePrompts } from "./core-impl/utils/system.js";
39
- export { isTerminalInteractive, isValidName, normalizeName, } from "./core-impl/utils/validate.js";
40
- export { animationMap, animateText, } from "./core-impl/visual/animate/animate.js";
41
- export { createAsciiArt } from "./core-impl/visual/ascii-art/ascii-art.js";
package/bin/main.js DELETED
@@ -1,96 +0,0 @@
1
- export { anykeyPrompt } from "./core-impl/anykey/anykey-mod.js";
2
- export { datePrompt } from "./core-impl/date/date.js";
3
- export { startEditor } from "./core-impl/editor/editor-mod.js";
4
- export {
5
- mainSymbols,
6
- fallbackSymbols
7
- } from "./core-impl/figures/figures-mod.js";
8
- export { confirmPrompt } from "./core-impl/input/confirm-prompt.js";
9
- export { inputPrompt } from "./core-impl/input/input-prompt.js";
10
- export { parseArgs, resolveArgs } from "./core-impl/launcher/args.js";
11
- export {
12
- defineCommand,
13
- runCommand,
14
- resolveSubCommand
15
- } from "./core-impl/launcher/command.js";
16
- export { runMain, createMain } from "./core-impl/launcher/launcher-mod.js";
17
- export { showUsage, renderUsage } from "./core-impl/launcher/usage.js";
18
- export { parseRawArgs } from "./core-impl/launcher/_parser.js";
19
- export {
20
- toArray,
21
- formatLineColumns,
22
- resolveValue,
23
- CLIError
24
- } from "./core-impl/launcher/_utils.js";
25
- export { toBaseColor, toSolidColor } from "./core-impl/msg-fmt/colors.js";
26
- export {
27
- relinkaByRemptsDeprecated,
28
- relinkaAsyncByRemptsDeprecated,
29
- throwError
30
- } from "./core-impl/msg-fmt/logger.js";
31
- export { colorMap, typographyMap } from "./core-impl/msg-fmt/mapping.js";
32
- export {
33
- symbols,
34
- bar,
35
- fmt,
36
- msg,
37
- msgUndo,
38
- msgUndoAll,
39
- printLineBar
40
- } from "./core-impl/msg-fmt/messages.js";
41
- export {
42
- getTerminalHeight,
43
- getExactTerminalWidth,
44
- getTerminalWidth,
45
- breakLines,
46
- removeCursor,
47
- restoreCursor,
48
- deleteLastLine,
49
- deleteLastLines,
50
- countLines
51
- } from "./core-impl/msg-fmt/terminal.js";
52
- export {
53
- variantMap,
54
- isValidVariant,
55
- applyVariant
56
- } from "./core-impl/msg-fmt/variants.js";
57
- export { nextStepsPrompt } from "./core-impl/next-steps/next-steps.js";
58
- export { numberPrompt } from "./core-impl/number/number-mod.js";
59
- export { resultPrompt } from "./core-impl/results/results.js";
60
- export { multiselectPrompt } from "./core-impl/select/multiselect-prompt.js";
61
- export { numMultiSelectPrompt } from "./core-impl/select/nummultiselect-prompt.js";
62
- export { numSelectPrompt } from "./core-impl/select/numselect-prompt.js";
63
- export { selectPrompt } from "./core-impl/select/select-prompt.js";
64
- export { togglePrompt } from "./core-impl/select/toggle-prompt.js";
65
- export { endPrompt } from "./core-impl/st-end/end.js";
66
- export { startPrompt } from "./core-impl/st-end/start.js";
67
- export { progressTaskPrompt } from "./core-impl/task/progress.js";
68
- export { spinnerTaskPrompt } from "./core-impl/task/spinner.js";
69
- export { colorize } from "./core-impl/utils/colorize.js";
70
- export { errorHandler } from "./core-impl/utils/errors.js";
71
- export {
72
- preventUnsupportedTTY,
73
- preventWindowsHomeDirRoot,
74
- preventWrongTerminalSize
75
- } from "./core-impl/utils/prevent.js";
76
- export {
77
- completePrompt,
78
- renderEndLine,
79
- renderEndLineInput
80
- } from "./core-impl/utils/prompt-end.js";
81
- export {
82
- streamText,
83
- streamTextBox,
84
- streamTextWithSpinner
85
- } from "./core-impl/utils/stream-text.js";
86
- export { pm, reliversePrompts } from "./core-impl/utils/system.js";
87
- export {
88
- isTerminalInteractive,
89
- isValidName,
90
- normalizeName
91
- } from "./core-impl/utils/validate.js";
92
- export {
93
- animationMap,
94
- animateText
95
- } from "./core-impl/visual/animate/animate.js";
96
- export { createAsciiArt } from "./core-impl/visual/ascii-art/ascii-art.js";
File without changes