@plop-next/core 0.1.0

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.
@@ -0,0 +1,1087 @@
1
+ interface SeparatorLike {
2
+ type: "separator";
3
+ separator: string;
4
+ }
5
+ /**
6
+ * Prompt choices separator compatible with @inquirer/core.
7
+ * Use this in plopfiles to avoid importing Separator from inquirer directly.
8
+ */
9
+ declare class Separator implements SeparatorLike {
10
+ readonly type: "separator";
11
+ readonly separator: string;
12
+ constructor(separator?: string);
13
+ static isSeparator(choice: unknown): choice is SeparatorLike;
14
+ }
15
+
16
+ type Prettify<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};
19
+ /**
20
+ * Union type representing the possible statuses of a prompt.
21
+ */
22
+ type Status = "loading" | "idle" | "done" | (string & {});
23
+ /**
24
+ * A keybinding entry associating one or more key sequences to a named action.
25
+ */
26
+ type Keybinding = {
27
+ key: string | string[];
28
+ action: string;
29
+ description?: string;
30
+ };
31
+ declare const BUILT_IN_PROMPT_TYPES: readonly ["input", "select", "generator-select", "list", "checkbox", "confirm", "search", "password", "expand", "editor", "number", "rawlist"];
32
+ type PromptThemeType = (typeof BUILT_IN_PROMPT_TYPES)[number];
33
+ type NormalizedChoice<Value> = {
34
+ value: Value;
35
+ name: string;
36
+ checkedName: string;
37
+ description?: string;
38
+ short: string;
39
+ disabled: boolean | string;
40
+ checked: boolean;
41
+ };
42
+ type DefaultTheme = {
43
+ icon?: string | {
44
+ /** Idle state icon (used by prefix-like contexts). */
45
+ idle?: string;
46
+ /** Done state icon (used by prefix-like contexts). */
47
+ done?: string;
48
+ /** Cursor icon, used by select/list/checkbox to mark the focused item. */
49
+ cursor?: string;
50
+ /** Checked icon, used by checkbox for selected items. */
51
+ checked?: string;
52
+ /** Unchecked icon, used by checkbox for unselected items. */
53
+ unchecked?: string;
54
+ /** Checked icon shown for a disabled-but-checked item in checkbox prompts. */
55
+ disabledChecked?: string;
56
+ /** Unchecked icon shown for a disabled-but-unchecked item in checkbox prompts. */
57
+ disabledUnchecked?: string;
58
+ };
59
+ /**
60
+ * Prefix shown before the prompt message.
61
+ */
62
+ prefix?: string | Prettify<Omit<Record<Status, string>, "loading">>;
63
+ /**
64
+ * Spinner shown while prompt status is "loading".
65
+ */
66
+ spinner?: {
67
+ interval?: number;
68
+ frames?: string[];
69
+ };
70
+ /**
71
+ * Functions used to style prompt segments.
72
+ */
73
+ style?: {
74
+ answer?: (text: string) => string;
75
+ message?: (text: string, status: Status) => string;
76
+ error?: (text: string) => string;
77
+ defaultAnswer?: (text: string) => string;
78
+ help?: (text: string) => string;
79
+ highlight?: (text: string) => string;
80
+ description?: (text: string) => string;
81
+ disabled?: (text: string) => string;
82
+ /** Styles a disabled choice label (checkbox). */
83
+ disabledChoice?: (text: string) => string;
84
+ /** Styles the active search term in a search prompt. */
85
+ searchTerm?: (text: string) => string;
86
+ /**
87
+ * Renders the summary of selected choices for a checkbox prompt.
88
+ * Receives the selected choices and the full list (including Separators).
89
+ */
90
+ renderSelectedChoices?: <T>(selectedChoices: ReadonlyArray<NormalizedChoice<T>>, allChoices: ReadonlyArray<NormalizedChoice<T> | Separator>) => string;
91
+ /**
92
+ * Formats the keyboard shortcuts tip shown below a prompt.
93
+ * - `input` passes `string[]`
94
+ * - `select` / `list` / `checkbox` pass `[key: string, action: string][]` (paires)
95
+ * Can return `undefined` to hide the tip entirely.
96
+ */
97
+ keysHelpTip?: (keys: [key: string, action: string][]) => string | undefined;
98
+ key?: (text: string) => string;
99
+ /**
100
+ * Static text displayed as a masked placeholder in password prompts
101
+ * when no mask character is set.
102
+ */
103
+ maskedText?: string;
104
+ /** Message shown while waiting for the user to open the editor (editor prompts). */
105
+ waitingMessage?: (enterKey: string) => string;
106
+ };
107
+ validationFailureMode?: "keep" | "clear";
108
+ indexMode?: "hidden" | "number";
109
+ /** Internationalisation strings used by individual prompt types. */
110
+ i18n?: {
111
+ /** Message shown when the user tries to interact with a disabled option. */
112
+ disabledError?: string;
113
+ };
114
+ /**
115
+ * Custom keybindings appended to the default set of a prompt.
116
+ * Each entry maps one or more key sequences to a named action.
117
+ */
118
+ keybindings?: ReadonlyArray<Keybinding>;
119
+ /**
120
+ * plop-next specific CLI style helpers.
121
+ */
122
+ plopNext?: {
123
+ menuTitle?: (text: string) => string;
124
+ welcome?: (text: string) => string;
125
+ generatorMenu?: {
126
+ title?: (text: string) => string;
127
+ description?: (text: string) => string;
128
+ };
129
+ actionLog?: {
130
+ success?: (text: string) => string;
131
+ error?: (text: string) => string;
132
+ warning?: (text: string) => string;
133
+ skipped?: (text: string) => string;
134
+ info?: (text: string) => string;
135
+ };
136
+ errors?: {
137
+ prefix?: {
138
+ error?: string;
139
+ warning?: string;
140
+ };
141
+ error?: (text: string) => string;
142
+ warning?: (text: string) => string;
143
+ };
144
+ };
145
+ };
146
+ type Theme<Extension extends object = object> = Prettify<Extension & DefaultTheme>;
147
+ /**
148
+ * Shorthand aliases accepted in theme configs.
149
+ * They are normalized to style/i18n at runtime.
150
+ */
151
+ type ThemeAliases = {
152
+ waitingMessage?: (enterKey: string) => string;
153
+ maskedText?: string;
154
+ disabledError?: string;
155
+ };
156
+ /**
157
+ * One theme scope (global or prompt-specific).
158
+ */
159
+ type PromptThemeScope = Prettify<Partial<Theme> & ThemeAliases>;
160
+ /**
161
+ * Public theme input accepted by setTheme/core config.
162
+ * Allows global fields and per-prompt overrides at the same level.
163
+ */
164
+ type ThemeConfig = Prettify<PromptThemeScope & Partial<Record<PromptThemeType, PromptThemeScope>>>;
165
+ declare const defaultTheme: DefaultTheme;
166
+ /**
167
+ * Type-specific theme overrides for each @inquirer/prompts prompt type.
168
+ * These are merged after the global defaultTheme.
169
+ */
170
+ declare const PROMPT_TYPE_THEMES: Partial<Record<PromptThemeType, PromptThemeScope>>;
171
+
172
+ /** Flat or nested map of translation strings. */
173
+ type LocaleTexts = Record<string, unknown>;
174
+ /** Generic object map used for dynamic/interoperability paths. */
175
+ type UnknownRecord = Record<string, unknown>;
176
+ /** BCP-47 locale tag, e.g. "en", "fr", "es". */
177
+ type LocaleTag = string;
178
+ /**
179
+ * Flat map of read-only help/usage strings for the CLI `--help` display.
180
+ * Keys match the entries declared in `CORE_DEFAULT_TEXTS.help`.
181
+ */
182
+ type HelpTexts = Readonly<Record<string, string>>;
183
+ /**
184
+ * Rule that declares how a specific field inside a custom prompt type should be
185
+ * translated by the i18n system.
186
+ *
187
+ * @example
188
+ * // Translate a top-level field directly:
189
+ * { translateField: "helpHint" }
190
+ * // → key: `{gen}.{promptName}.helpHint`
191
+ *
192
+ * @example
193
+ * // Translate `title` in each `columns` item, identified by `value`:
194
+ * { path: "columns", translateField: "title", idField: "value" }
195
+ * // → key: `{gen}.{promptName}.columns.{item.value}`
196
+ *
197
+ * @example
198
+ * // Same with explicit array wildcard '#' (equivalent form):
199
+ * { path: "columns.#", translateField: "title", idField: "value" }
200
+ *
201
+ * @example
202
+ * // Deeply nested arrays (groups → items):
203
+ * { path: "groups.#.items.#", translateField: "label", idField: "id" }
204
+ * // → key: `{gen}.{promptName}.groups.{i}.items.{item.id}`
205
+ */
206
+ interface TranslatableFieldRule {
207
+ /**
208
+ * Dot-path to the container holding the field to translate.
209
+ * Use `#` to mark array-iteration points.
210
+ *
211
+ * - Omit entirely for direct top-level fields on the prompt object.
212
+ * - If provided without `#` **and** `idField` is set, an implicit `#` is
213
+ * appended: the last segment resolves to an array keyed by `idField`.
214
+ * - Multiple `#` are supported for arbitrarily nested arrays; `idField`
215
+ * always applies to the **last** `#`.
216
+ */
217
+ path?: string;
218
+ /**
219
+ * The field whose string value should be translated.
220
+ *
221
+ * This field is used to read/write the display value inside the prompt config,
222
+ * but it is NOT appended to the generated i18n key.
223
+ */
224
+ translateField: string;
225
+ /**
226
+ * Field used to build the i18n key for the **last** array in the path.
227
+ * When set, `String(item[idField])` replaces the numeric index in the key,
228
+ * making translations stable across item reordering.
229
+ */
230
+ idField?: string;
231
+ }
232
+
233
+ /** Raw @inquirer style object. */
234
+ type InquirerStyleObject = Partial<Theme["style"]> & Record<string, unknown>;
235
+ /** Single theme object for both @inquirer and plop-next defaults/overrides. */
236
+ type PlopNextTheme = ThemeConfig;
237
+
238
+ /** Public generator item displayed in the CLI list. */
239
+ interface GeneratorListItem {
240
+ name: string;
241
+ description?: string;
242
+ }
243
+ /** Public generator menu item displayed by the runner (generator or separator). */
244
+ type GeneratorMenuItem = GeneratorListItem | SeparatorLike;
245
+ /**
246
+ * Generic validate callback — T is the answer value type for the prompt.
247
+ * Supports sync and async validation, returns true on success or an error string.
248
+ */
249
+ type ValidateFn<T = unknown> = (value: T, answers?: Record<string, any>) => boolean | string | Promise<boolean | string>;
250
+ /** Select/list choice item. */
251
+ type SelectChoiceItem = string | SeparatorLike | {
252
+ value: unknown;
253
+ name?: string;
254
+ description?: string;
255
+ short?: string;
256
+ disabled?: boolean | string;
257
+ };
258
+ /** Rawlist choice item. */
259
+ type RawListChoiceItem = string | SeparatorLike | {
260
+ value: unknown;
261
+ name?: string;
262
+ short?: string;
263
+ key?: string;
264
+ description?: string;
265
+ };
266
+ /** Expand choice item. */
267
+ type ExpandChoiceItem = SeparatorLike | {
268
+ key: string;
269
+ name?: string;
270
+ value?: unknown;
271
+ };
272
+ type SelectChoicesOrFn = SelectChoiceItem[] | ((answers: Record<string, any>) => SelectChoiceItem[] | Promise<SelectChoiceItem[]>);
273
+ type RawListChoicesOrFn = RawListChoiceItem[] | ((answers: Record<string, any>) => RawListChoiceItem[] | Promise<RawListChoiceItem[]>);
274
+ type ExpandChoicesOrFn = ExpandChoiceItem[] | ((answers: Record<string, any>) => ExpandChoiceItem[] | Promise<ExpandChoiceItem[]>);
275
+ /** Search choice item. */
276
+ type SearchChoiceItem = string | SeparatorLike | {
277
+ value: unknown;
278
+ name?: string;
279
+ description?: string;
280
+ short?: string;
281
+ disabled?: boolean | string;
282
+ };
283
+ type SearchSourceFn = (term: string | undefined, opt: SearchSourceContext, answers?: Record<string, unknown>) => ReadonlyArray<SearchChoiceItem> | Promise<ReadonlyArray<SearchChoiceItem>>;
284
+ interface SearchSourceContext {
285
+ signal: AbortSignal;
286
+ }
287
+ interface PromptTransformContext {
288
+ isFinal: boolean;
289
+ }
290
+ /** Checkbox choice item. */
291
+ type CheckboxChoiceItem = string | SeparatorLike | {
292
+ value: unknown;
293
+ name?: string;
294
+ checkedName?: string;
295
+ description?: string;
296
+ short?: string;
297
+ checked?: boolean;
298
+ disabled?: boolean | string;
299
+ };
300
+ /** Selected checkbox item as received by inquirer validate callback. */
301
+ type CheckboxSelectedChoice = {
302
+ value: unknown;
303
+ name: string;
304
+ checkedName: string;
305
+ description?: string;
306
+ short: string;
307
+ checked: boolean;
308
+ disabled: boolean | string;
309
+ };
310
+ /** Checkbox global shortcuts. */
311
+ type CheckboxShortcuts = {
312
+ all?: string | null;
313
+ invert?: string | null;
314
+ };
315
+ type CheckboxChoicesOrFn = CheckboxChoiceItem[] | ((answers: Record<string, any>) => CheckboxChoiceItem[] | Promise<CheckboxChoiceItem[]>);
316
+ /**
317
+ * Base prompt configuration shared across all prompt types.
318
+ * These are plop-next specific fields, separate from @inquirer/prompts fields.
319
+ */
320
+ interface PlopPromptBase {
321
+ /** Prompt type: 'input', 'number', 'confirm', 'list', 'select', 'checkbox', etc. */
322
+ type: string;
323
+ /** Answer key in the answers hash. Should contain no spaces. */
324
+ name: string;
325
+ /**
326
+ * Reserved for future plop-next theming API.
327
+ * Intentionally blocked for now.
328
+ */
329
+ /** Input message or callback to generate dynamic message. */
330
+ message?: string | ((answers: Record<string, any>) => string);
331
+ /** Default value if no answer provided. */
332
+ default?: unknown | ((answers: Record<string, unknown>) => unknown | Promise<unknown>);
333
+ /** Filter the user input before storing in answers. */
334
+ filter?: (value: unknown, answers?: Record<string, unknown>) => unknown;
335
+ /** Show or hide prompt based on condition or callback. */
336
+ when?: boolean | ((answers: Record<string, any>) => boolean);
337
+ /** Force prompt even if answer already exists. */
338
+ askAnswered?: boolean;
339
+ }
340
+ /** Text input prompt. */
341
+ interface PlopPromptInput extends PlopPromptBase {
342
+ type: "input";
343
+ /** Transform/format the raw value for display (visual only, does not affect stored value). */
344
+ transformer?: (value: string, context: PromptTransformContext) => string;
345
+ /** RegExp pattern the input must match. */
346
+ pattern?: RegExp;
347
+ /** Error message shown when pattern is not matched. */
348
+ patternError?: string;
349
+ /** Prefill behavior: 'tab' fills on Tab, 'editable' pre-fills the input field. */
350
+ prefill?: "tab" | "editable";
351
+ /** Reject empty input. */
352
+ required?: boolean;
353
+ /** Validate the text value before accepting. */
354
+ validate?: ValidateFn<string>;
355
+ }
356
+ /** Numeric input prompt. */
357
+ interface PlopPromptNumber extends PlopPromptBase {
358
+ type: "number";
359
+ default?: number;
360
+ min?: number;
361
+ max?: number;
362
+ step?: number | "any";
363
+ required?: boolean;
364
+ /** Validate the numeric value before accepting. */
365
+ validate?: ValidateFn<number | undefined>;
366
+ }
367
+ /** Boolean confirmation prompt (yes / no). */
368
+ interface PlopPromptConfirm extends PlopPromptBase {
369
+ type: "confirm";
370
+ default?: boolean;
371
+ /** Transform the displayed value (visual only). */
372
+ transformer?: (value: boolean) => string;
373
+ }
374
+ /** Single-choice prompt (select one item from a list). */
375
+ interface PlopPromptSelect extends PlopPromptBase {
376
+ type: "list" | "select";
377
+ choices: SelectChoicesOrFn;
378
+ pageSize?: number;
379
+ loop?: boolean;
380
+ }
381
+ /** Rawlist prompt (single choice with indexed shortcuts). */
382
+ interface PlopPromptRawList extends PlopPromptBase {
383
+ type: "rawlist";
384
+ choices: RawListChoicesOrFn;
385
+ loop?: boolean;
386
+ }
387
+ /** Expand prompt (single choice with explicit key shortcuts). */
388
+ interface PlopPromptExpand extends PlopPromptBase {
389
+ type: "expand";
390
+ choices: ExpandChoicesOrFn;
391
+ expanded?: boolean;
392
+ }
393
+ /** Search-based single-choice prompt (dynamic source function). */
394
+ interface PlopPromptSearch extends PlopPromptBase {
395
+ type: "search";
396
+ /** Async function that returns filtered choices based on current input. */
397
+ source: SearchSourceFn;
398
+ pageSize?: number;
399
+ /** Validate the selected value before accepting. */
400
+ validate?: (value: unknown, answers?: Record<string, unknown>) => boolean | string | Promise<boolean | string>;
401
+ }
402
+ /** Multi-choice checkbox prompt. */
403
+ interface PlopPromptCheckbox extends PlopPromptBase {
404
+ type: "checkbox";
405
+ choices: CheckboxChoicesOrFn;
406
+ pageSize?: number;
407
+ loop?: boolean;
408
+ /** Reject empty selection. */
409
+ required?: boolean;
410
+ shortcuts?: CheckboxShortcuts;
411
+ /** Validate the selected values array before accepting. */
412
+ validate?: (choices: readonly CheckboxSelectedChoice[], answers?: Record<string, unknown>) => boolean | string | Promise<boolean | string>;
413
+ }
414
+ /** Multi-line editor prompt (opens the user's $EDITOR). */
415
+ interface PlopPromptEditor extends PlopPromptBase {
416
+ type: "editor";
417
+ default?: string;
418
+ /** File extension for the temp file shown in the editor (e.g. ".md"). */
419
+ postfix?: string;
420
+ /** Open editor immediately without waiting for Enter. */
421
+ waitForUserInput?: boolean;
422
+ /** Low-level temp file options forwarded to @inquirer/external-editor. */
423
+ file?: Record<string, unknown>;
424
+ /** Validate the final text content before accepting. */
425
+ validate?: ValidateFn<string>;
426
+ }
427
+ /** Masked password input. */
428
+ interface PlopPromptPassword extends PlopPromptBase {
429
+ type: "password";
430
+ /** true uses "*", string uses a custom mask character/string, false keeps input transparent. */
431
+ mask?: boolean | string;
432
+ /** Validate the entered password before accepting. */
433
+ validate?: ValidateFn<string>;
434
+ }
435
+ /** Union of all built-in prompt types plus a generic fallback for custom/unknown types. */
436
+ type PlopPrompt = PlopPromptInput | PlopPromptNumber | PlopPromptConfirm | PlopPromptSelect | PlopPromptRawList | PlopPromptExpand | PlopPromptSearch | PlopPromptCheckbox | PlopPromptEditor | PlopPromptPassword | PlopPromptBase;
437
+ type ActionType = "add" | "modify" | "append" | string;
438
+ type TransformFn = (input: string, data: Record<string, unknown>) => string | Promise<string>;
439
+ type SkipFn = (answers: Record<string, any>, action: ActionConfig) => boolean | string | Promise<boolean | string>;
440
+ interface ActionConfig {
441
+ type: ActionType;
442
+ path?: string;
443
+ template?: string;
444
+ templateFile?: string;
445
+ pattern?: RegExp | string;
446
+ transform?: TransformFn;
447
+ skip?: SkipFn;
448
+ skipIfExists?: boolean;
449
+ force?: boolean;
450
+ unique?: boolean;
451
+ separator?: string;
452
+ destination?: string;
453
+ base?: string;
454
+ templateFiles?: string | string[];
455
+ stripExtensions?: string[];
456
+ globOptions?: Record<string, unknown>;
457
+ verbose?: boolean;
458
+ abortOnFail?: boolean;
459
+ data?: Record<string, unknown>;
460
+ [key: string]: unknown;
461
+ }
462
+ type CustomActionFunction = (answers: Record<string, any>, config: ActionConfig, plopNext: unknown) => string | Promise<string>;
463
+ type Action = ActionConfig | CustomActionFunction | string;
464
+ type DynamicActionsFn = (answers: Record<string, any>) => Action[] | Promise<Action[]>;
465
+ type ActionsConfig = Action[] | DynamicActionsFn;
466
+ type HandlebarsHelper = (...args: unknown[]) => unknown;
467
+ /**
468
+ * Legacy custom prompt renderer signature.
469
+ *
470
+ * Kept intentionally permissive because third-party prompt packages can expose
471
+ * stricter config generics and optional extra params (e.g. context).
472
+ */
473
+ type PromptRenderer = (...args: any[]) => unknown | Promise<unknown>;
474
+ interface ActionExecutionOptions {
475
+ dest?: string;
476
+ force?: boolean;
477
+ }
478
+ interface ActionStepResult {
479
+ type: string;
480
+ status: "success" | "error";
481
+ message: string;
482
+ path?: string;
483
+ }
484
+ interface ActionExecutionResult {
485
+ steps: ActionStepResult[];
486
+ failed: boolean;
487
+ }
488
+ type DefaultIncludeConfig = Record<string, unknown>;
489
+ interface GeneratorConfig {
490
+ description?: string;
491
+ prompts: PlopPrompt[];
492
+ actions: ActionsConfig;
493
+ }
494
+ interface PlopNextEnv {
495
+ cwd: string;
496
+ configPath: string | null;
497
+ modulePath: string | null;
498
+ config?: unknown;
499
+ }
500
+
501
+ /**
502
+ * Config passed to a PromptHandler's ask() method.
503
+ * Contains all prompt fields except the plop-next-only keys
504
+ * (type, name, filter, when, askAnswered) which the runner strips before dispatch.
505
+ */
506
+ interface PromptHandlerConfig {
507
+ /** Answer key — included so handlers can forward it if needed. */
508
+ name: string;
509
+ /** Internal use: resolved by core.setTheme({ ... }). */
510
+ theme?: PromptThemeConfig;
511
+ message?: unknown;
512
+ default?: unknown;
513
+ validate?: unknown;
514
+ [key: string]: unknown;
515
+ }
516
+ /** Raw config shape expected by @inquirer prompt functions. */
517
+ type InquirerPromptFn = (config: UnknownRecord) => Promise<unknown>;
518
+ /** Theme payload forwarded to @inquirer prompt functions. */
519
+ type PromptThemeConfig = UnknownRecord;
520
+ /**
521
+ * Contract for a specialised prompt handler.
522
+ *
523
+ * Each handler encapsulates the rendering logic for one or more prompt types
524
+ * (e.g. the select handler covers "list", "select").
525
+ * Handlers are registered into PlopNextCore via `registerPrompt(handler)` and
526
+ * are therefore available to any runtime that uses the core (CLI, test helpers,
527
+ * custom runners, etc.).
528
+ *
529
+ * @example
530
+ * // Register a custom date-picker handler
531
+ * core.registerPrompt({
532
+ * types: ["datepicker"],
533
+ * async ask(_type, config) {
534
+ * return myDatePickerLib({ message: String(config.message ?? "") });
535
+ * },
536
+ * });
537
+ */
538
+ interface PromptHandler {
539
+ /**
540
+ * Prompt type identifiers this handler supports.
541
+ * The first entry is used as the canonical name in error messages.
542
+ */
543
+ readonly types: ReadonlyArray<string>;
544
+ /**
545
+ * Execute the prompt and return the user's answer.
546
+ * @param type The exact type string that was requested.
547
+ * @param config All prompt fields minus the plop-next-only keys.
548
+ */
549
+ ask(type: string, config: PromptHandlerConfig): Promise<unknown>;
550
+ }
551
+
552
+ /**
553
+ * Extraction spec for one theme field.
554
+ *
555
+ * - `true` → include the field as-is (scalar or full object)
556
+ * - `string[]` → field is an object; include only these sub-fields
557
+ */
558
+ type PromptThemeFieldSpec = true | string[];
559
+ /**
560
+ * Flat selector declaration — no wrapper objects.
561
+ *
562
+ * Each key (except the reserved `baseSelector`) maps to an extraction spec:
563
+ * - `fieldName: true` → copy the top-level field value as-is
564
+ * - `fieldName: string[]` → field is an object; copy only the listed sub-keys
565
+ *
566
+ * @example
567
+ * // Built-in select selector:
568
+ * {
569
+ * prefix: true,
570
+ * spinner: true,
571
+ * indexMode: true,
572
+ * style: ["answer", "message", "description", "keysHelpTip"],
573
+ * icon: ["cursor"],
574
+ * }
575
+ */
576
+ type PromptThemeSelector = {
577
+ /** Inherit all entries from another registered selector, then apply overrides. */
578
+ baseSelector?: string;
579
+ [field: string]: PromptThemeFieldSpec | string | undefined;
580
+ };
581
+ /**
582
+ * Options for declaring which theme fields a custom prompt should receive.
583
+ *
584
+ * The `selector` key is the only reserved entry; all other keys follow the
585
+ * same flat extraction syntax as `PromptThemeSelector`.
586
+ *
587
+ * @example
588
+ * plop.registerPrompt("table-multiple", handler, {
589
+ * selector: "select", // inherit select's fields
590
+ * icon: ["cursor", "checked"], // extend icon with extra sub-fields
591
+ * });
592
+ */
593
+ type PromptThemeSelectorOptions = {
594
+ /** Inherit from an existing built-in selector (e.g. "select"). */
595
+ selector?: string;
596
+ [field: string]: PromptThemeFieldSpec | string | undefined;
597
+ };
598
+ declare function createPromptThemeSelector(options: PromptThemeSelectorOptions): PromptThemeSelector;
599
+
600
+ /**
601
+ * Configuration for error behavior and reporting.
602
+ */
603
+ interface ErrorConfig {
604
+ /** Whether this is a warning (non-fatal) or an error (fatal). */
605
+ isWarning: boolean;
606
+ /** Whether handling this issue should terminate the process. */
607
+ shouldExit: boolean;
608
+ /** Exit code to return when this error is handled. */
609
+ exitCode: number;
610
+ /** Whether to display the stack trace in output (depends on verbosity). */
611
+ showStackTrace: boolean;
612
+ /** Whether to allow logging this error to a file. */
613
+ allowLogFile: boolean;
614
+ }
615
+ interface ErrorTranslation {
616
+ key: string;
617
+ args?: unknown[];
618
+ fallback: string;
619
+ }
620
+ type ForcedLangFallbackReason = "i18n-missing" | "locale-not-found";
621
+ /**
622
+ * Base error class for plop-next errors.
623
+ * All caught errors must extend this class for proper handling and logging.
624
+ */
625
+ declare class PlopError extends Error {
626
+ readonly code: string;
627
+ readonly isOperational: boolean;
628
+ readonly config: ErrorConfig;
629
+ readonly translation?: ErrorTranslation;
630
+ constructor(code: string, message: string, config: ErrorConfig, translation?: ErrorTranslation);
631
+ }
632
+ /**
633
+ * Generator not found error.
634
+ */
635
+ declare class GeneratorNotFoundError extends PlopError {
636
+ constructor(generatorName: string);
637
+ }
638
+ /**
639
+ * No generators registered error.
640
+ */
641
+ declare class NoGeneratorsError extends PlopError {
642
+ constructor();
643
+ }
644
+ /**
645
+ * Invalid prompt configuration error.
646
+ */
647
+ declare class InvalidPromptError extends PlopError {
648
+ constructor(promptName: string, reason: string);
649
+ }
650
+ /**
651
+ * Bypass value parsing error.
652
+ */
653
+ declare class BypassParseError extends PlopError {
654
+ constructor(promptName: string, promptType: string, value: string, reason?: string);
655
+ }
656
+ /**
657
+ * Plopfile loading error.
658
+ */
659
+ declare class PlopfileLoadError extends PlopError {
660
+ readonly requireError?: Error;
661
+ readonly importError?: Error;
662
+ constructor(filePath: string, requireError?: Error, importError?: Error);
663
+ }
664
+ /**
665
+ * Invalid plopfile export error.
666
+ */
667
+ declare class PlopfileExportError extends PlopError {
668
+ constructor(message?: string);
669
+ }
670
+ /**
671
+ * User cancelled the prompt (e.g., Ctrl+C).
672
+ * This is not really an error, but treated as one for control flow.
673
+ */
674
+ declare class UserCancelledError extends PlopError {
675
+ constructor();
676
+ }
677
+ /**
678
+ * No plopfile found in current working directory.
679
+ */
680
+ declare class PlopfileNotFoundWarning extends PlopError {
681
+ constructor(message?: string);
682
+ }
683
+ /**
684
+ * Forced locale fallback warning.
685
+ * Emitted when `--lang` is provided but cannot be applied.
686
+ */
687
+ declare class ForcedLangFallbackWarning extends PlopError {
688
+ readonly locale: string;
689
+ readonly reason: ForcedLangFallbackReason;
690
+ constructor(locale: string, reason: ForcedLangFallbackReason);
691
+ }
692
+ /**
693
+ * Non-fatal warning emitted when an i18n source file is ignored.
694
+ */
695
+ declare class I18nSourceWarning extends PlopError {
696
+ constructor(message: string);
697
+ }
698
+
699
+ interface UseI18nOptions {
700
+ /** Force a specific locale tag, e.g. "fr". */
701
+ force?: LocaleTag;
702
+ /**
703
+ * Use auto-detection (OS locale) when `force` is not provided.
704
+ * Defaults to true when calling useI18n().
705
+ */
706
+ auto?: boolean;
707
+ }
708
+ interface RegisterLocaleOptions {
709
+ /** If true, this locale becomes active immediately. */
710
+ activate?: boolean;
711
+ }
712
+ interface I18nAdapter {
713
+ t(key: string, args?: unknown[], fallback?: string): string;
714
+ preparePrompts(generatorName: string, prompts: PlopPrompt[]): PlopPrompt[];
715
+ getWelcomeMessage?(): string | null;
716
+ use?(options: UseI18nOptions): void;
717
+ isEnabled?(): boolean;
718
+ hasLocale?(locale: LocaleTag): boolean;
719
+ registerLocale?(locale: LocaleTag, messages: LocaleTexts | string, options?: RegisterLocaleOptions): void;
720
+ registerLocales?(locales: Record<string, LocaleTexts> | LocaleTexts | string, options?: RegisterLocaleOptions): void;
721
+ registerTexts?(localeOrTexts: LocaleTag | Record<string, LocaleTexts> | LocaleTexts | string, maybeTexts?: LocaleTexts | string): void;
722
+ registerText?(locale: LocaleTag, path: string, text: unknown): void;
723
+ setLocale?(locale: LocaleTag): void;
724
+ getLocale?(): LocaleTag;
725
+ registerTranslatableFields?(promptType: string, rules: TranslatableFieldRule[]): void;
726
+ }
727
+ interface RegisterPromptOptions {
728
+ /** Theme selector/extraction config for this custom prompt type. */
729
+ theme?: PromptThemeSelector;
730
+ /** Translatable field rules for this custom prompt type. */
731
+ translatableFields?: TranslatableFieldRule[];
732
+ }
733
+ declare class PlopNextCore {
734
+ private readonly generators;
735
+ private readonly generatorEntries;
736
+ private readonly actionTypes;
737
+ /** Legacy custom prompt renderers (registered via addPrompt / setPrompt). */
738
+ private readonly promptTypes;
739
+ /** Typed prompt handlers registered via registerPrompt(handler). */
740
+ private readonly promptHandlerRegistry;
741
+ private readonly promptThemeSelectorRegistry;
742
+ private i18nAdapter?;
743
+ private readonly translatableFieldRules;
744
+ private showWelcomeMessageFlag;
745
+ private showTitleFlag;
746
+ private generatorPageSize;
747
+ private plopfilePath?;
748
+ private destBasePath;
749
+ private defaultInclude;
750
+ private theme;
751
+ private pkgCachePath?;
752
+ private pkgCache?;
753
+ private warningReporter?;
754
+ constructor();
755
+ /**
756
+ * Register a named generator.
757
+ *
758
+ * @example
759
+ * plopNext.registerGenerator("component", { prompts: [...], actions: [...] });
760
+ */
761
+ registerGenerator(name: string, config: GeneratorConfig): this;
762
+ addSeparator(text?: string): this;
763
+ setGenerator(name: string, config: GeneratorConfig): this;
764
+ registerHelper(name: string, helper: HandlebarsHelper): this;
765
+ setHelper(name: string, helper: HandlebarsHelper): this;
766
+ registerPartial(name: string, partial: string): this;
767
+ setPartial(name: string, partial: string): this;
768
+ registerActionType(name: string, actionType: CustomActionFunction): this;
769
+ setActionType(name: string, actionType: CustomActionFunction): this;
770
+ registerPrompt(name: string, prompt: PromptRenderer): this;
771
+ registerPrompt(name: string, prompt: PromptRenderer, options: RegisterPromptOptions): this;
772
+ registerPrompt(handler: PromptHandler): this;
773
+ setPrompt(name: string, prompt: PromptRenderer): this;
774
+ getPrompt(name: string): PromptRenderer | undefined;
775
+ getPromptList(): string[];
776
+ /** List the type strings that have a registered PromptHandler. */
777
+ getPromptHandlerTypes(): string[];
778
+ /**
779
+ * Dispatch a prompt to the appropriate handler.
780
+ *
781
+ * Resolution order:
782
+ * 1. Legacy PromptRenderer registered via `addPrompt()` / `setPrompt()` — highest priority.
783
+ * 2. PromptHandler registered via `registerPrompt(handler)` for the exact type.
784
+ * 3. PromptHandler registered for "input" as fallback.
785
+ *
786
+ * @param type Prompt type string (e.g. "input", "list", "datepicker").
787
+ * @param config All prompt fields minus plop-next-only keys (type/name/filter/when/askAnswered).
788
+ */
789
+ askPrompt(type: string, config: PromptHandlerConfig): Promise<unknown>;
790
+ setTheme(theme: PlopNextTheme | string): this;
791
+ getTheme(): PlopNextTheme;
792
+ private resolveThemeInput;
793
+ private parseThemeJsonFile;
794
+ private parseThemeModuleFile;
795
+ getActionType(name: string): CustomActionFunction | undefined;
796
+ getActionTypeList(): string[];
797
+ getHelper(name: string): HandlebarsHelper | undefined;
798
+ getHelperList(): string[];
799
+ getPartial(name: string): string | undefined;
800
+ getPartialList(): string[];
801
+ showWelcomeMessage(show?: boolean): this;
802
+ getWelcomeMessage(): string | null;
803
+ isWelcomeMessageShown(): boolean;
804
+ showTitle(show?: boolean): this;
805
+ isTitleShown(): boolean;
806
+ /**
807
+ * Set page size used by the generator selection prompt.
808
+ * Defaults to 7.
809
+ */
810
+ setGeneratorPageSize(pageSize: number): this;
811
+ /**
812
+ * Get page size used by the generator selection prompt.
813
+ */
814
+ getGeneratorPageSize(): number;
815
+ setI18nAdapter(adapter: I18nAdapter): this;
816
+ setWarningReporter(reporter: ((warning: PlopError) => void) | undefined): this;
817
+ reportWarning(warning: PlopError): this;
818
+ clearI18nAdapter(): this;
819
+ setPlopfilePath(path: string): this;
820
+ getPlopfilePath(): string | undefined;
821
+ setDestBasePath(path: string): this;
822
+ getDestBasePath(): string;
823
+ setDefaultInclude(include: DefaultIncludeConfig): this;
824
+ getDefaultInclude(): DefaultIncludeConfig;
825
+ renderString(template: string, data: Record<string, unknown>): string;
826
+ getGenerator(name: string): GeneratorConfig | undefined;
827
+ getGeneratorList(): GeneratorMenuItem[];
828
+ /**
829
+ * Enable i18n support.
830
+ *
831
+ * - `force`: always use this locale.
832
+ * - `auto` (default): detect locale from process environment,
833
+ * then fall back to English.
834
+ */
835
+ useI18n(options?: UseI18nOptions): this;
836
+ isI18nEnabled(): boolean;
837
+ /**
838
+ * Resolve the display text for a prompt field.
839
+ *
840
+ * When i18n is **disabled**: returns `defaultMessage` as-is.
841
+ * When i18n is **enabled**: looks up `<generatorName>.<promptName>.<field>`
842
+ * in the active locale, falls back to English, then to `defaultMessage`.
843
+ *
844
+ * @param generatorName Generator key, e.g. "component"
845
+ * @param promptName Prompt name, e.g. "name"
846
+ * @param field Field name, e.g. "message"
847
+ * @param defaultMessage Raw string or function defined inside setGenerator
848
+ */
849
+ resolveText(generatorName: string, promptName: string, field: string, defaultMessage?: string | ((...args: unknown[]) => string), args?: unknown[]): string | ((...args: unknown[]) => string) | undefined;
850
+ /**
851
+ * Resolve a built-in core UI text (e.g. "cli.welcome").
852
+ */
853
+ t(key: string, args?: unknown[], fallback?: string): string;
854
+ /**
855
+ * Add or override messages for an existing locale.
856
+ * Available whether or not i18n plugin is loaded.
857
+ */
858
+ addTexts(locale: LocaleTag, texts: LocaleTexts): this;
859
+ registerText(locale: LocaleTag, path: string, text: unknown): this;
860
+ registerLocale(locale: LocaleTag, messages: LocaleTexts | string, options?: RegisterLocaleOptions): this;
861
+ registerLocales(locales: Record<string, LocaleTexts> | LocaleTexts | string, options?: RegisterLocaleOptions): this;
862
+ registerTexts(locale: LocaleTag, texts: LocaleTexts | string): this;
863
+ registerTexts(localesOrTexts: Record<string, LocaleTexts> | LocaleTexts | string): this;
864
+ setLocale(locale: LocaleTag): this;
865
+ getLocale(): LocaleTag;
866
+ hasLocale(locale: LocaleTag): boolean;
867
+ executeActions(actions: Action[], answers: Record<string, unknown>, options?: ActionExecutionOptions): Promise<ActionExecutionResult>;
868
+ resolveActions(actions: ActionsConfig, answers: Record<string, unknown>): Promise<Action[]>;
869
+ getActionTypeDisplay(type: string, showTypeNames?: boolean): string;
870
+ formatActionTargetForDisplay(value: string): string;
871
+ private registerBuiltInHelpers;
872
+ private readPackageProperty;
873
+ private loadPackageJsonNearPlopfile;
874
+ private getPathValue;
875
+ /**
876
+ * Returns prepared prompts for a generator: prompt `message` fields are
877
+ * transformed by plugins (like i18n) before they are rendered by Inquirer.
878
+ */
879
+ preparePrompts(generatorName: string, prompts: PlopPrompt[]): PlopPrompt[];
880
+ private resolvePromptTheme;
881
+ /**
882
+ * Resolve the full theme for a specific prompt type.
883
+ * Merges in order: defaultTheme → type defaults → user global theme → user type theme.
884
+ */
885
+ private resolvePromptTypeTheme;
886
+ private resolveTheme;
887
+ private cloneTheme;
888
+ private resolveNormalizedGlobalTheme;
889
+ private resolveUserPromptTypeTheme;
890
+ private normalizeThemeScope;
891
+ private mergeThemeLayers;
892
+ private looksLikeThemeSource;
893
+ private looksLikeI18nSource;
894
+ private isLocaleLikeKey;
895
+ private isRecord;
896
+ private isPromptThemeTypeKey;
897
+ private unwrapModuleDefault;
898
+ private cloneUnknown;
899
+ /**
900
+ * Merge icon values when applying one layer over another.
901
+ */
902
+ private mergeIconLayers;
903
+ }
904
+
905
+ interface ActionRunnerOptions {
906
+ /** Base directory for generated files. Relative action paths are resolved against this. */
907
+ dest?: string;
908
+ /** When true, overwrite existing files instead of throwing. */
909
+ force?: boolean;
910
+ }
911
+ interface ActionRunResult {
912
+ type: string;
913
+ message: string;
914
+ /** Interpolated path template, useful for UI output. */
915
+ path?: string;
916
+ /** Absolute path used for filesystem operations. */
917
+ absolutePath?: string;
918
+ }
919
+ /**
920
+ * Built-in action handlers (business logic): add, modify, append.
921
+ */
922
+ declare class ActionRunner {
923
+ private readonly core;
924
+ private readonly opts;
925
+ constructor(core: PlopNextCore, opts?: ActionRunnerOptions);
926
+ run(type: string, config: ActionConfig, answers: Record<string, unknown>): Promise<ActionRunResult>;
927
+ private runAdd;
928
+ private runAddMany;
929
+ private runModify;
930
+ private runAppend;
931
+ private resolveTemplate;
932
+ private toAbsolute;
933
+ private resolveTemplateFilePath;
934
+ private interpolate;
935
+ private applyTransform;
936
+ }
937
+
938
+ interface PromptAskOptions {
939
+ allowTheme?: boolean;
940
+ }
941
+ /**
942
+ * Registry that maps prompt type strings to their PromptHandler.
943
+ *
944
+ * Embedded in PlopNextCore — handlers are registered there via
945
+ * `core.registerPrompt(handler)`.
946
+ *
947
+ * Resolution order when PlopNextCore.askPrompt() is called:
948
+ * 1. User-registered PromptRenderer (legacy `addPrompt` / `setPrompt` API) — highest priority.
949
+ * 2. Registered PromptHandler matching the exact type string.
950
+ * 3. Registered PromptHandler for "input" as fallback.
951
+ */
952
+ declare class PromptHandlerRegistry {
953
+ private readonly map;
954
+ /**
955
+ * Register a handler for all its declared types.
956
+ * If a type is already registered, the new handler replaces the previous one,
957
+ * allowing built-in handlers to be overridden by plugins or users.
958
+ */
959
+ register(handler: PromptHandler): this;
960
+ /** Return the handler for the given type, or undefined if none is registered. */
961
+ get(type: string): PromptHandler | undefined;
962
+ /** True if a handler is registered for the given type. */
963
+ has(type: string): boolean;
964
+ /** List of all registered type strings. */
965
+ getRegisteredTypes(): string[];
966
+ /**
967
+ * Dispatch a prompt to the right handler.
968
+ *
969
+ * @param type The prompt type string.
970
+ * @param config Prompt fields without plop-next-only keys.
971
+ * @returns The user's answer.
972
+ * @throws If no handler is registered for the type and no "input" fallback exists.
973
+ */
974
+ ask(type: string, config: PromptHandlerConfig, options?: PromptAskOptions): Promise<unknown>;
975
+ }
976
+
977
+ /** Register all built-in @inquirer prompt handlers into a registry instance. */
978
+ declare function registerBuiltInPromptHandlers(registry: PromptHandlerRegistry): void;
979
+
980
+ /**
981
+ * Core-owned default UI texts used by plop-next.
982
+ * This file is intentionally locale-agnostic from a folder/filename perspective.
983
+ */
984
+ declare const CORE_DEFAULT_TEXTS: LocaleTexts;
985
+ /**
986
+ * Backward-compatible alias.
987
+ * Prefer `CORE_DEFAULT_TEXTS`.
988
+ */
989
+ declare const CORE_DEFAULT_TEXTS_EN: LocaleTexts;
990
+ /**
991
+ * Typed accessor for the built-in English help texts.
992
+ * Use this in the CLI to render `--help` output.
993
+ */
994
+ declare const CORE_DEFAULT_HELP_TEXTS: HelpTexts;
995
+
996
+ /** Register a legacy custom prompt renderer by name. */
997
+ declare function registerCustomPrompt(promptTypes: Map<string, PromptRenderer>, name: string, prompt?: PromptRenderer): void;
998
+ /** Return a previously registered custom prompt renderer. */
999
+ declare function getCustomPrompt(promptTypes: Map<string, PromptRenderer>, name: string): PromptRenderer | undefined;
1000
+ /** List custom prompt renderer type names. */
1001
+ declare function listCustomPromptTypes(promptTypes: Map<string, PromptRenderer>): string[];
1002
+ /** Execute a legacy custom prompt renderer with plop-next internal keys stripped. */
1003
+ declare function askCustomPrompt(prompt: PromptRenderer, config: PromptHandlerConfig): Promise<unknown>;
1004
+
1005
+ type ErrorTranslator = (key: string, args?: unknown[], fallback?: string) => string;
1006
+ type ErrorVerbosity = "simple" | "verbose" | "debug";
1007
+ interface ErrorHandlerOptions {
1008
+ /**
1009
+ * Level of error output detail.
1010
+ * - "simple" (default): Single-line explanation.
1011
+ * - "verbose": Error code + message + context.
1012
+ * - "debug": Includes full stack trace and diagnostic info.
1013
+ */
1014
+ verbosity?: ErrorVerbosity;
1015
+ /**
1016
+ * Optional file path to log all errors to.
1017
+ * File will be created/appended to if provided.
1018
+ */
1019
+ logFile?: string;
1020
+ /**
1021
+ * Whether to use ANSI color in console output.
1022
+ * Defaults to true.
1023
+ */
1024
+ useColors?: boolean;
1025
+ /**
1026
+ * Error/warning console theming overrides.
1027
+ */
1028
+ theme?: {
1029
+ prefix?: {
1030
+ error?: string;
1031
+ warning?: string;
1032
+ };
1033
+ error?: (text: string) => string;
1034
+ warning?: (text: string) => string;
1035
+ };
1036
+ }
1037
+ interface ErrorHandleResult {
1038
+ exitCode: number;
1039
+ shouldExit: boolean;
1040
+ }
1041
+ /**
1042
+ * Handles errors with configurable verbosity and optional file logging.
1043
+ */
1044
+ declare class ErrorHandler {
1045
+ private verbosity;
1046
+ private logFile?;
1047
+ private useColors;
1048
+ private errorPrefix;
1049
+ private warningPrefix;
1050
+ private errorStyle;
1051
+ private warningStyle;
1052
+ private translator?;
1053
+ constructor(options?: ErrorHandlerOptions);
1054
+ /**
1055
+ * Handle and output an error.
1056
+ * Returns exit behavior and code.
1057
+ */
1058
+ handle(error: unknown): ErrorHandleResult;
1059
+ private isPlopError;
1060
+ private formatError;
1061
+ private formatSimple;
1062
+ private formatVerbose;
1063
+ private formatDebug;
1064
+ private formatUnhandledError;
1065
+ private resolveMessage;
1066
+ private logToConsole;
1067
+ private logToFile;
1068
+ setVerbosity(verbosity: ErrorVerbosity): void;
1069
+ setLogFile(logFile: string | undefined): void;
1070
+ setTheme(theme: PlopNextTheme | undefined): void;
1071
+ setTranslator(translator: ErrorTranslator | undefined): void;
1072
+ private applyTheme;
1073
+ }
1074
+
1075
+ declare function createSelectHandler(fn?: InquirerPromptFn): PromptHandler;
1076
+
1077
+ declare function createConfirmHandler(fn?: InquirerPromptFn): PromptHandler;
1078
+
1079
+ declare function createCheckboxHandler(fn?: InquirerPromptFn): PromptHandler;
1080
+
1081
+ declare function createSearchHandler(fn?: InquirerPromptFn): PromptHandler;
1082
+
1083
+ declare function createEditorHandler(fn?: InquirerPromptFn): PromptHandler;
1084
+
1085
+ declare function createPasswordHandler(fn?: InquirerPromptFn): PromptHandler;
1086
+
1087
+ export { type Action, type ActionConfig, type ActionExecutionOptions, type ActionExecutionResult, type ActionRunResult, ActionRunner, type ActionRunnerOptions, type ActionStepResult, type ActionType, type ActionsConfig, BypassParseError, CORE_DEFAULT_HELP_TEXTS, CORE_DEFAULT_TEXTS, CORE_DEFAULT_TEXTS_EN, type CustomActionFunction, type DefaultIncludeConfig, type DefaultTheme, type ErrorConfig, type ErrorHandleResult, ErrorHandler, type ErrorHandlerOptions, type ErrorTranslator, type ErrorVerbosity, type ForcedLangFallbackReason, ForcedLangFallbackWarning, type GeneratorConfig, type GeneratorListItem, type GeneratorMenuItem, GeneratorNotFoundError, type HandlebarsHelper, type HelpTexts, type I18nAdapter, I18nSourceWarning, type InquirerPromptFn, type InquirerStyleObject, InvalidPromptError, type Keybinding, type LocaleTag, type LocaleTexts, NoGeneratorsError, PROMPT_TYPE_THEMES, PlopError, PlopNextCore, type PlopNextEnv, type PlopNextTheme, type PlopPrompt, type PlopPromptBase, PlopfileExportError, PlopfileLoadError, PlopfileNotFoundWarning, type PromptHandler, type PromptHandlerConfig, PromptHandlerRegistry, type PromptRenderer, type PromptThemeFieldSpec, type PromptThemeSelector, type PromptThemeSelectorOptions, type RegisterLocaleOptions, type RegisterPromptOptions, Separator, type SeparatorLike, type Status, type Theme, type TranslatableFieldRule, type UnknownRecord, type UseI18nOptions, UserCancelledError, askCustomPrompt, createCheckboxHandler, createConfirmHandler, createEditorHandler, createPasswordHandler, createPromptThemeSelector, createSearchHandler, createSelectHandler, defaultTheme, getCustomPrompt, listCustomPromptTypes, registerBuiltInPromptHandlers, registerCustomPrompt };