@hot-updater/cli-tools 0.30.6 → 0.30.7

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.
package/dist/index.d.cts DELETED
@@ -1,924 +0,0 @@
1
- import { Readable } from "stream";
2
- import { ConfigInput, Platform, RequiredDeep } from "@hot-updater/plugin-core";
3
- import { Key as Key$1 } from "node:readline";
4
- import { Readable as Readable$1, Writable } from "node:stream";
5
-
6
- //#region \0rolldown/runtime.js
7
- //#endregion
8
- //#region src/BuildLogger.d.ts
9
- type LinePattern = string | RegExp;
10
- interface BuildLoggerConfig {
11
- logPrefix: string;
12
- /** Lines that should be surfaced in prompt output as important events. */
13
- importantLogPatterns: LinePattern[];
14
- /** Progress stages: stage index advances when corresponding output patterns are observed. */
15
- progressStages: LinePattern[][];
16
- }
17
- declare class BuildLogger {
18
- private readonly config;
19
- private state;
20
- private logWriter?;
21
- private readonly promptProgress;
22
- private readonly stageCount;
23
- constructor(config: BuildLoggerConfig);
24
- start(): Promise<void>;
25
- processStream(input: Readable): Promise<void>;
26
- private consumeProgressStream;
27
- private processProgressLine;
28
- stop(message?: string, success?: boolean): void;
29
- writeError(error: unknown): void;
30
- close(): Promise<void>;
31
- private updateProgress;
32
- private finishRemainingProgress;
33
- private shouldLogLine;
34
- private showLogFileLocation;
35
- }
36
- //#endregion
37
- //#region src/banner.d.ts
38
- declare const link: (url: string) => string;
39
- declare const banner: (version?: string) => string;
40
- declare const printBanner: (version?: string) => void;
41
- //#endregion
42
- //#region src/ConfigBuilder.d.ts
43
- type BuildType = "bare" | "rock" | "expo";
44
- type ImportInfo = {
45
- pkg: string;
46
- named?: string[];
47
- defaultOrNamespace?: string;
48
- sideEffect?: boolean;
49
- };
50
- type ProviderConfig = {
51
- imports: ImportInfo[];
52
- configString: string;
53
- };
54
- type ConfigBuilderScaffold = {
55
- imports: ImportInfo[];
56
- buildConfigString: string;
57
- storageConfigString: string;
58
- databaseConfigString: string;
59
- intermediateCode: string;
60
- text: string;
61
- };
62
- declare const renderImportStatements: (imports: ImportInfo[]) => string;
63
- interface IConfigBuilder {
64
- /** Sets the build type ('bare' or 'rock' or 'expo') and adds necessary build imports. */
65
- setBuildType(buildType: BuildType): this;
66
- /** Sets the storage configuration and adds its required imports. */
67
- setStorage(storageConfig: ProviderConfig): this;
68
- /** Sets the database configuration and adds its required imports. */
69
- setDatabase(databaseConfig: ProviderConfig): this;
70
- /** Sets the intermediate code block to be placed between imports and defineConfig. */
71
- setIntermediateCode(code: string): this;
72
- /** Assembles and returns the final configuration string. */
73
- getResult(): string;
74
- }
75
- declare class ConfigBuilder implements IConfigBuilder {
76
- private buildType;
77
- private storageInfo;
78
- private databaseInfo;
79
- private intermediateCode;
80
- private collectedImports;
81
- constructor();
82
- addImport(info: ImportInfo): this;
83
- private addImports;
84
- private getImportInfos;
85
- private generateBuildConfigString;
86
- setBuildType(buildType: BuildType): this;
87
- setStorage(storageConfig: ProviderConfig): this;
88
- setDatabase(databaseConfig: ProviderConfig): this;
89
- setIntermediateCode(code: string): this;
90
- getScaffold(): ConfigBuilderScaffold;
91
- getResult(): string;
92
- }
93
- //#endregion
94
- //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/types.d.ts
95
- type Formatter = (input: string | number | null | undefined) => string;
96
- interface Colors {
97
- isColorSupported: boolean;
98
- reset: Formatter;
99
- bold: Formatter;
100
- dim: Formatter;
101
- italic: Formatter;
102
- underline: Formatter;
103
- inverse: Formatter;
104
- hidden: Formatter;
105
- strikethrough: Formatter;
106
- black: Formatter;
107
- red: Formatter;
108
- green: Formatter;
109
- yellow: Formatter;
110
- blue: Formatter;
111
- magenta: Formatter;
112
- cyan: Formatter;
113
- white: Formatter;
114
- gray: Formatter;
115
- bgBlack: Formatter;
116
- bgRed: Formatter;
117
- bgGreen: Formatter;
118
- bgYellow: Formatter;
119
- bgBlue: Formatter;
120
- bgMagenta: Formatter;
121
- bgCyan: Formatter;
122
- bgWhite: Formatter;
123
- blackBright: Formatter;
124
- redBright: Formatter;
125
- greenBright: Formatter;
126
- yellowBright: Formatter;
127
- blueBright: Formatter;
128
- magentaBright: Formatter;
129
- cyanBright: Formatter;
130
- whiteBright: Formatter;
131
- bgBlackBright: Formatter;
132
- bgRedBright: Formatter;
133
- bgGreenBright: Formatter;
134
- bgYellowBright: Formatter;
135
- bgBlueBright: Formatter;
136
- bgMagentaBright: Formatter;
137
- bgCyanBright: Formatter;
138
- bgWhiteBright: Formatter;
139
- }
140
- //#endregion
141
- //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.d.ts
142
- declare const picocolors: Colors & {
143
- createColors: (enabled?: boolean) => Colors;
144
- };
145
- //#endregion
146
- //#region src/copyDirToTmp.d.ts
147
- declare const copyDirToTmp: (dir: string, childDirname?: string) => Promise<{
148
- tmpDir: string;
149
- removeTmpDir: () => Promise<void>;
150
- }>;
151
- //#endregion
152
- //#region src/createTarBr.d.ts
153
- declare const createTarBrTargetFiles: ({
154
- outfile,
155
- targetFiles
156
- }: {
157
- targetFiles: {
158
- path: string;
159
- name: string;
160
- }[];
161
- outfile: string;
162
- }) => Promise<string>;
163
- declare const createTarBr: ({
164
- outfile,
165
- targetDir,
166
- excludeExts
167
- }: {
168
- targetDir: string;
169
- outfile: string;
170
- excludeExts?: string[];
171
- }) => Promise<string>;
172
- //#endregion
173
- //#region src/createTarGz.d.ts
174
- declare const createTarGzTargetFiles: ({
175
- outfile,
176
- targetFiles
177
- }: {
178
- targetFiles: {
179
- path: string;
180
- name: string;
181
- }[];
182
- outfile: string;
183
- }) => Promise<string>;
184
- declare const createTarGz: ({
185
- outfile,
186
- targetDir,
187
- excludeExts
188
- }: {
189
- targetDir: string;
190
- outfile: string;
191
- excludeExts?: string[];
192
- }) => Promise<string>;
193
- //#endregion
194
- //#region src/createZip.d.ts
195
- declare const createZipTargetFiles: ({
196
- outfile,
197
- targetFiles
198
- }: {
199
- targetFiles: {
200
- path: string;
201
- name: string;
202
- }[];
203
- outfile: string;
204
- }) => Promise<string>;
205
- declare const createZip: ({
206
- outfile,
207
- targetDir,
208
- excludeExts
209
- }: {
210
- targetDir: string;
211
- outfile: string;
212
- excludeExts?: string[];
213
- }) => Promise<string>;
214
- //#endregion
215
- //#region src/crypto.d.ts
216
- declare const encryptJson: (jsonData: Record<string, any>, secretKey: string) => string;
217
- declare const decryptJson: <T>(encryptedData: string, secretKey: string) => T;
218
- //#endregion
219
- //#region src/cwd.d.ts
220
- declare const getCwd: () => string;
221
- //#endregion
222
- //#region src/ensureInstallPackages.d.ts
223
- declare const ensureInstallPackages: (packages: {
224
- dependencies?: string[];
225
- devDependencies?: string[];
226
- }, options?: {
227
- versionResolver?: (pkg: string) => string;
228
- }) => Promise<void>;
229
- //#endregion
230
- //#region src/getAndroidSdkPath.d.ts
231
- declare function getAndroidSdkPath(): string;
232
- //#endregion
233
- //#region src/getPackageManager.d.ts
234
- declare const getPackageManager: () => string;
235
- //#endregion
236
- //#region src/getReactNativeMetadatas.d.ts
237
- interface ReactNativeMetadata {
238
- packagePath: string;
239
- versionRaw: string;
240
- version: {
241
- major: number;
242
- minor: number;
243
- patch?: number;
244
- };
245
- }
246
- declare const getReactNativeMetadatas: (cwd?: string) => ReactNativeMetadata;
247
- //#endregion
248
- //#region src/hotUpdaterConfig.d.ts
249
- type ManagedHelperStrategy = "merge-object" | "preserve-existing" | "replace";
250
- type ManagedHelperStatement = {
251
- name: string;
252
- code: string;
253
- strategy: ManagedHelperStrategy;
254
- };
255
- type CreateHotUpdaterConfigScaffoldOptions = {
256
- build: BuildType;
257
- storage: ProviderConfig;
258
- database: ProviderConfig;
259
- extraImports?: ImportInfo[];
260
- helperStatements?: ManagedHelperStatement[];
261
- updateStrategy?: "appVersion" | "fingerprint";
262
- };
263
- type CreateHotUpdaterConfigScaffoldFromBuilderOptions = {
264
- helperStatements?: ManagedHelperStatement[];
265
- updateStrategy?: "appVersion" | "fingerprint";
266
- };
267
- type HotUpdaterConfigScaffold = {
268
- text: string;
269
- imports: ImportInfo[];
270
- build: {
271
- initializer: string;
272
- callee: string;
273
- };
274
- storage: {
275
- initializer: string;
276
- callee: string;
277
- };
278
- database: {
279
- initializer: string;
280
- callee: string;
281
- };
282
- helperStatements: ManagedHelperStatement[];
283
- updateStrategy: string;
284
- };
285
- type WriteHotUpdaterConfigResult = {
286
- status: "created" | "merged" | "skipped";
287
- path: string;
288
- reason?: string;
289
- };
290
- declare const createHotUpdaterConfigScaffold: ({
291
- build,
292
- storage,
293
- database,
294
- extraImports,
295
- helperStatements,
296
- updateStrategy
297
- }: CreateHotUpdaterConfigScaffoldOptions) => HotUpdaterConfigScaffold;
298
- declare const createHotUpdaterConfigScaffoldFromBuilder: (builder: ConfigBuilder, {
299
- helperStatements,
300
- updateStrategy
301
- }?: CreateHotUpdaterConfigScaffoldFromBuilderOptions) => HotUpdaterConfigScaffold;
302
- declare const writeHotUpdaterConfig: (scaffold: HotUpdaterConfigScaffold, filePath?: string) => Promise<WriteHotUpdaterConfigResult>;
303
- //#endregion
304
- //#region src/HotUpdateDirUtil.d.ts
305
- declare const HotUpdateDirUtil: {
306
- readonly dirName: ".hot-updater";
307
- readonly outputDirName: "output";
308
- readonly logDirName: "log";
309
- readonly outputGitignorePath: ".hot-updater/output";
310
- readonly logGitignorePath: ".hot-updater/log";
311
- readonly getDirPath: ({
312
- cwd
313
- }: {
314
- cwd: string;
315
- }) => string;
316
- readonly getDefaultOutputPath: ({
317
- cwd
318
- }: {
319
- cwd: string;
320
- }) => string;
321
- readonly getLogDirPath: ({
322
- cwd
323
- }: {
324
- cwd: string;
325
- }) => string;
326
- };
327
- //#endregion
328
- //#region src/LogWriter.d.ts
329
- type HotUpdaterLogWriter = {
330
- logFilePath: string | null;
331
- writeStream: (input: Readable) => Promise<void>;
332
- writeError: (error: unknown) => void;
333
- close: () => Promise<void>;
334
- };
335
- declare const stripAnsi: (value: string) => string;
336
- declare const createLogWriter: ({
337
- prefix,
338
- logFilePath
339
- }: {
340
- prefix: string;
341
- logFilePath?: string;
342
- }) => Promise<HotUpdaterLogWriter>;
343
- //#endregion
344
- //#region src/loadConfig.d.ts
345
- type HotUpdaterConfigOptions = {
346
- platform: Platform;
347
- channel: string;
348
- } | null;
349
- type ConfigResponse = RequiredDeep<ConfigInput>;
350
- declare const loadConfig: (options: HotUpdaterConfigOptions) => Promise<ConfigResponse>;
351
- //#endregion
352
- //#region src/log.d.ts
353
- declare const log: {
354
- normal: (message: string | number | null | undefined) => void;
355
- success: (message: string | number | null | undefined) => void;
356
- info: (message: string | number | null | undefined) => void;
357
- error: (message: string | number | null | undefined) => void;
358
- warn: (message: string | number | null | undefined) => void;
359
- debug: (message: string | number | null | undefined) => void;
360
- };
361
- //#endregion
362
- //#region src/makeEnv.d.ts
363
- type EnvVarValue = string | {
364
- comment: string;
365
- value: string;
366
- };
367
- declare const makeEnv: (newEnvVars: Record<string, EnvVarValue>, filePath?: string, options?: {
368
- preserveKeys?: string[];
369
- }) => Promise<string>;
370
- //#endregion
371
- //#region ../../node_modules/.pnpm/@clack+core@1.0.1/node_modules/@clack/core/dist/index.d.mts
372
- declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
373
- type Action = (typeof actions)[number];
374
- /** Global settings for Clack programs, stored in memory */
375
- interface InternalClackSettings {
376
- actions: Set<Action>;
377
- aliases: Map<string, Action>;
378
- messages: {
379
- cancel: string;
380
- error: string;
381
- };
382
- withGuide: boolean;
383
- }
384
- declare const settings: InternalClackSettings;
385
- interface ClackSettings {
386
- /**
387
- * Set custom global aliases for the default actions.
388
- * This will not overwrite existing aliases, it will only add new ones!
389
- *
390
- * @param aliases - An object that maps aliases to actions
391
- * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
392
- */
393
- aliases?: Record<string, Action>;
394
- /**
395
- * Custom messages for prompts
396
- */
397
- messages?: {
398
- /**
399
- * Custom message to display when a spinner is cancelled
400
- * @default "Canceled"
401
- */
402
- cancel?: string;
403
- /**
404
- * Custom message to display when a spinner encounters an error
405
- * @default "Something went wrong"
406
- */
407
- error?: string;
408
- };
409
- withGuide?: boolean;
410
- }
411
- declare function updateSettings(updates: ClackSettings): void;
412
- /**
413
- * The state of the prompt
414
- */
415
- type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
416
- /**
417
- * Typed event emitter for clack
418
- */
419
- interface ClackEvents<TValue> {
420
- initial: (value?: any) => void;
421
- active: (value?: any) => void;
422
- cancel: (value?: any) => void;
423
- submit: (value?: any) => void;
424
- error: (value?: any) => void;
425
- cursor: (key?: Action) => void;
426
- key: (key: string | undefined, info: Key$1) => void;
427
- value: (value?: TValue) => void;
428
- userInput: (value: string) => void;
429
- confirm: (value?: boolean) => void;
430
- finalize: () => void;
431
- beforePrompt: () => void;
432
- }
433
- interface PromptOptions<TValue, Self extends Prompt<TValue>> {
434
- render(this: Omit<Self, 'prompt'>): string | undefined;
435
- initialValue?: any;
436
- initialUserInput?: string;
437
- validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
438
- input?: Readable$1;
439
- output?: Writable;
440
- debug?: boolean;
441
- signal?: AbortSignal;
442
- }
443
- declare class Prompt<TValue> {
444
- protected input: Readable$1;
445
- protected output: Writable;
446
- private _abortSignal?;
447
- private rl;
448
- private opts;
449
- private _render;
450
- private _track;
451
- private _prevFrame;
452
- private _subscribers;
453
- protected _cursor: number;
454
- state: ClackState;
455
- error: string;
456
- value: TValue | undefined;
457
- userInput: string;
458
- constructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue?: boolean);
459
- /**
460
- * Unsubscribe all listeners
461
- */
462
- protected unsubscribe(): void;
463
- /**
464
- * Set a subscriber with opts
465
- * @param event - The event name
466
- */
467
- private setSubscriber;
468
- /**
469
- * Subscribe to an event
470
- * @param event - The event name
471
- * @param cb - The callback
472
- */
473
- on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
474
- /**
475
- * Subscribe to an event once
476
- * @param event - The event name
477
- * @param cb - The callback
478
- */
479
- once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
480
- /**
481
- * Emit an event with data
482
- * @param event - The event name
483
- * @param data - The data to pass to the callback
484
- */
485
- emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
486
- prompt(): Promise<symbol | TValue | undefined>;
487
- protected _isActionKey(char: string | undefined, _key: Key$1): boolean;
488
- protected _setValue(value: TValue | undefined): void;
489
- protected _setUserInput(value: string | undefined, write?: boolean): void;
490
- protected _clearUserInput(): void;
491
- private onKeypress;
492
- protected close(): void;
493
- private restoreCursor;
494
- private render;
495
- }
496
- interface OptionLike$1 {
497
- value: unknown;
498
- label?: string;
499
- disabled?: boolean;
500
- }
501
- type FilterFunction<T extends OptionLike$1> = (search: string, opt: T) => boolean;
502
- interface AutocompleteOptions$1<T extends OptionLike$1> extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {
503
- options: T[] | ((this: AutocompletePrompt<T>) => T[]);
504
- filter?: FilterFunction<T>;
505
- multiple?: boolean;
506
- }
507
- declare class AutocompletePrompt<T extends OptionLike$1> extends Prompt<T['value'] | T['value'][]> {
508
- #private;
509
- filteredOptions: T[];
510
- multiple: boolean;
511
- isNavigating: boolean;
512
- selectedValues: Array<T['value']>;
513
- focusedValue: T['value'] | undefined;
514
- get cursor(): number;
515
- get userInputWithCursor(): string;
516
- get options(): T[];
517
- constructor(opts: AutocompleteOptions$1<T>);
518
- protected _isActionKey(char: string | undefined, key: Key$1): boolean;
519
- deselectAll(): void;
520
- toggleSelected(value: T['value']): void;
521
- }
522
- declare function isCancel(value: unknown): value is symbol;
523
- declare namespace index_d_exports {
524
- export { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, ClackSettings, CommonOptions, ConfirmOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions, autocomplete, autocompleteMultiselect, box, cancel, confirm, group, groupMultiselect, intro, isCI, isCancel, isTTY, limitOptions, log$1 as log, multiselect, note, outro, password, path, progress, select, selectKey, settings, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr, updateSettings };
525
- }
526
- declare const unicode: boolean;
527
- declare const isCI: () => boolean;
528
- declare const isTTY: (output: Writable) => boolean;
529
- declare const unicodeOr: (c: string, fallback: string) => string;
530
- declare const S_STEP_ACTIVE: string;
531
- declare const S_STEP_CANCEL: string;
532
- declare const S_STEP_ERROR: string;
533
- declare const S_STEP_SUBMIT: string;
534
- declare const S_BAR_START: string;
535
- declare const S_BAR: string;
536
- declare const S_BAR_END: string;
537
- declare const S_BAR_START_RIGHT: string;
538
- declare const S_BAR_END_RIGHT: string;
539
- declare const S_RADIO_ACTIVE: string;
540
- declare const S_RADIO_INACTIVE: string;
541
- declare const S_CHECKBOX_ACTIVE: string;
542
- declare const S_CHECKBOX_SELECTED: string;
543
- declare const S_CHECKBOX_INACTIVE: string;
544
- declare const S_PASSWORD_MASK: string;
545
- declare const S_BAR_H: string;
546
- declare const S_CORNER_TOP_RIGHT: string;
547
- declare const S_CONNECT_LEFT: string;
548
- declare const S_CORNER_BOTTOM_RIGHT: string;
549
- declare const S_CORNER_BOTTOM_LEFT: string;
550
- declare const S_CORNER_TOP_LEFT: string;
551
- declare const S_INFO: string;
552
- declare const S_SUCCESS: string;
553
- declare const S_WARN: string;
554
- declare const S_ERROR: string;
555
- declare const symbol: (state: ClackState) => string;
556
- declare const symbolBar: (state: ClackState) => string;
557
- interface CommonOptions {
558
- input?: Readable$1;
559
- output?: Writable;
560
- signal?: AbortSignal;
561
- withGuide?: boolean;
562
- }
563
- type Primitive = Readonly<string | boolean | number>;
564
- type Option<Value> = Value extends Primitive ? {
565
- /**
566
- * Internal data for this option.
567
- */
568
- value: Value;
569
- /**
570
- * The optional, user-facing text for this option.
571
- *
572
- * By default, the `value` is converted to a string.
573
- */
574
- label?: string;
575
- /**
576
- * An optional hint to display to the user when
577
- * this option might be selected.
578
- *
579
- * By default, no `hint` is displayed.
580
- */
581
- hint?: string;
582
- /**
583
- * Whether this option is disabled.
584
- * Disabled options are visible but cannot be selected.
585
- *
586
- * By default, options are not disabled.
587
- */
588
- disabled?: boolean;
589
- } : {
590
- /**
591
- * Internal data for this option.
592
- */
593
- value: Value;
594
- /**
595
- * Required. The user-facing text for this option.
596
- */
597
- label: string;
598
- /**
599
- * An optional hint to display to the user when
600
- * this option might be selected.
601
- *
602
- * By default, no `hint` is displayed.
603
- */
604
- hint?: string;
605
- /**
606
- * Whether this option is disabled.
607
- * Disabled options are visible but cannot be selected.
608
- *
609
- * By default, options are not disabled.
610
- */
611
- disabled?: boolean;
612
- };
613
- interface SelectOptions<Value> extends CommonOptions {
614
- message: string;
615
- options: Option<Value>[];
616
- initialValue?: Value;
617
- maxItems?: number;
618
- }
619
- declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
620
- interface AutocompleteSharedOptions<Value> extends CommonOptions {
621
- /**
622
- * The message to display to the user.
623
- */
624
- message: string;
625
- /**
626
- * Available options for the autocomplete prompt.
627
- */
628
- options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
629
- /**
630
- * Maximum number of items to display at once.
631
- */
632
- maxItems?: number;
633
- /**
634
- * Placeholder text to display when no input is provided.
635
- */
636
- placeholder?: string;
637
- /**
638
- * Validates the value
639
- */
640
- validate?: (value: Value | Value[] | undefined) => string | Error | undefined;
641
- /**
642
- * Custom filter function to match options against search input.
643
- * If not provided, a default filter that matches label, hint, and value is used.
644
- */
645
- filter?: (search: string, option: Option<Value>) => boolean;
646
- }
647
- interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
648
- /**
649
- * The initial selected value.
650
- */
651
- initialValue?: Value;
652
- /**
653
- * The initial user input
654
- */
655
- initialUserInput?: string;
656
- }
657
- declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | symbol>;
658
- interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
659
- /**
660
- * The initial selected values
661
- */
662
- initialValues?: Value[];
663
- /**
664
- * If true, at least one option must be selected
665
- */
666
- required?: boolean;
667
- }
668
- /**
669
- * Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI
670
- */
671
- declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
672
- type BoxAlignment = 'left' | 'center' | 'right';
673
- interface BoxOptions extends CommonOptions {
674
- contentAlign?: BoxAlignment;
675
- titleAlign?: BoxAlignment;
676
- width?: number | 'auto';
677
- titlePadding?: number;
678
- contentPadding?: number;
679
- rounded?: boolean;
680
- formatBorder?: (text: string) => string;
681
- }
682
- declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
683
- interface ConfirmOptions extends CommonOptions {
684
- message: string;
685
- active?: string;
686
- inactive?: string;
687
- initialValue?: boolean;
688
- vertical?: boolean;
689
- }
690
- declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>;
691
- type Prettify<T> = { [P in keyof T]: T[P] } & {};
692
- type PromptGroupAwaitedReturn<T> = { [P in keyof T]: Exclude<Awaited<T[P]>, symbol> };
693
- interface PromptGroupOptions<T> {
694
- /**
695
- * Control how the group can be canceled
696
- * if one of the prompts is canceled.
697
- */
698
- onCancel?: (opts: {
699
- results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
700
- }) => void;
701
- }
702
- type PromptGroup<T> = { [P in keyof T]: (opts: {
703
- results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
704
- }) => undefined | Promise<T[P] | undefined> };
705
- /**
706
- * Define a group of prompts to be displayed
707
- * and return a results of objects within the group
708
- */
709
- declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
710
- interface GroupMultiSelectOptions<Value> extends CommonOptions {
711
- message: string;
712
- options: Record<string, Option<Value>[]>;
713
- initialValues?: Value[];
714
- required?: boolean;
715
- cursorAt?: Value;
716
- selectableGroups?: boolean;
717
- groupSpacing?: number;
718
- }
719
- declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
720
- interface LimitOptionsParams<TOption> extends CommonOptions {
721
- options: TOption[];
722
- maxItems: number | undefined;
723
- cursor: number;
724
- style: (option: TOption, active: boolean) => string;
725
- columnPadding?: number;
726
- rowPadding?: number;
727
- }
728
- declare const limitOptions: <TOption>(params: LimitOptionsParams<TOption>) => string[];
729
- interface LogMessageOptions extends CommonOptions {
730
- symbol?: string;
731
- spacing?: number;
732
- secondarySymbol?: string;
733
- }
734
- declare const log$1: {
735
- message: (message?: string | string[], {
736
- symbol,
737
- secondarySymbol,
738
- output,
739
- spacing,
740
- withGuide
741
- }?: LogMessageOptions) => void;
742
- info: (message: string, opts?: LogMessageOptions) => void;
743
- success: (message: string, opts?: LogMessageOptions) => void;
744
- step: (message: string, opts?: LogMessageOptions) => void;
745
- warn: (message: string, opts?: LogMessageOptions) => void; /** alias for `log.warn()`. */
746
- warning: (message: string, opts?: LogMessageOptions) => void;
747
- error: (message: string, opts?: LogMessageOptions) => void;
748
- };
749
- declare const cancel: (message?: string, opts?: CommonOptions) => void;
750
- declare const intro: (title?: string, opts?: CommonOptions) => void;
751
- declare const outro: (message?: string, opts?: CommonOptions) => void;
752
- interface MultiSelectOptions<Value> extends CommonOptions {
753
- message: string;
754
- options: Option<Value>[];
755
- initialValues?: Value[];
756
- maxItems?: number;
757
- required?: boolean;
758
- cursorAt?: Value;
759
- }
760
- declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
761
- type FormatFn = (line: string) => string;
762
- interface NoteOptions extends CommonOptions {
763
- format?: FormatFn;
764
- }
765
- declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
766
- interface PasswordOptions extends CommonOptions {
767
- message: string;
768
- mask?: string;
769
- validate?: (value: string | undefined) => string | Error | undefined;
770
- clearOnError?: boolean;
771
- }
772
- declare const password: (opts: PasswordOptions) => Promise<string | symbol>;
773
- interface PathOptions extends CommonOptions {
774
- root?: string;
775
- directory?: boolean;
776
- initialValue?: string;
777
- message: string;
778
- validate?: (value: string | undefined) => string | Error | undefined;
779
- }
780
- declare const path: (opts: PathOptions) => Promise<string | symbol>;
781
- interface SpinnerOptions extends CommonOptions {
782
- indicator?: 'dots' | 'timer';
783
- onCancel?: () => void;
784
- cancelMessage?: string;
785
- errorMessage?: string;
786
- frames?: string[];
787
- delay?: number;
788
- styleFrame?: (frame: string) => string;
789
- }
790
- interface SpinnerResult {
791
- start(msg?: string): void;
792
- stop(msg?: string): void;
793
- cancel(msg?: string): void;
794
- error(msg?: string): void;
795
- message(msg?: string): void;
796
- clear(): void;
797
- readonly isCancelled: boolean;
798
- }
799
- declare const spinner: ({
800
- indicator,
801
- onCancel,
802
- output,
803
- cancelMessage,
804
- errorMessage,
805
- frames,
806
- delay,
807
- signal,
808
- ...opts
809
- }?: SpinnerOptions) => SpinnerResult;
810
- interface ProgressOptions extends SpinnerOptions {
811
- style?: 'light' | 'heavy' | 'block';
812
- max?: number;
813
- size?: number;
814
- }
815
- interface ProgressResult extends SpinnerResult {
816
- advance(step?: number, msg?: string): void;
817
- }
818
- declare function progress({
819
- style,
820
- max: userMax,
821
- size: userSize,
822
- ...spinnerOptions
823
- }?: ProgressOptions): ProgressResult;
824
- interface SelectKeyOptions<Value extends string> extends CommonOptions {
825
- message: string;
826
- options: Option<Value>[];
827
- initialValue?: Value;
828
- caseSensitive?: boolean;
829
- }
830
- declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | symbol>;
831
- declare const stream: {
832
- message: (iterable: Iterable<string> | AsyncIterable<string>, {
833
- symbol
834
- }?: LogMessageOptions) => Promise<void>;
835
- info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
836
- success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
837
- step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
838
- warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>; /** alias for `log.warn()`. */
839
- warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
840
- error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
841
- };
842
- type Task = {
843
- /**
844
- * Task title
845
- */
846
- title: string;
847
- /**
848
- * Task function
849
- */
850
- task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
851
- /**
852
- * If enabled === false the task will be skipped
853
- */
854
- enabled?: boolean;
855
- };
856
- /**
857
- * Define a group of tasks to be executed
858
- */
859
- declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
860
- interface TaskLogOptions extends CommonOptions {
861
- title: string;
862
- limit?: number;
863
- spacing?: number;
864
- retainLog?: boolean;
865
- }
866
- interface TaskLogMessageOptions {
867
- raw?: boolean;
868
- }
869
- interface TaskLogCompletionOptions {
870
- showLog?: boolean;
871
- }
872
- /**
873
- * Renders a log which clears on success and remains on failure
874
- */
875
- declare const taskLog: (opts: TaskLogOptions) => {
876
- message(msg: string, mopts?: TaskLogMessageOptions): void;
877
- group(name: string): {
878
- message(msg: string, mopts?: TaskLogMessageOptions): void;
879
- error(message: string): void;
880
- success(message: string): void;
881
- };
882
- error(message: string, opts?: TaskLogCompletionOptions): void;
883
- success(message: string, opts?: TaskLogCompletionOptions): void;
884
- };
885
- interface TextOptions extends CommonOptions {
886
- message: string;
887
- placeholder?: string;
888
- defaultValue?: string;
889
- initialValue?: string;
890
- validate?: (value: string | undefined) => string | Error | undefined;
891
- }
892
- declare const text: (opts: TextOptions) => Promise<string | symbol>;
893
- //#endregion
894
- //#region src/prompts.d.ts
895
- type PromptProgress = ReturnType<typeof progress>;
896
- type PromptSpinner = ReturnType<typeof spinner>;
897
- //#endregion
898
- //#region src/resolvePackageVersion.d.ts
899
- declare const HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV = "HOT_UPDATER_SERVER_PACKAGE_VERSION";
900
- declare const resolvePackageVersion: (packageName: string, options?: {
901
- searchFrom?: string;
902
- }) => string;
903
- declare const resolveHotUpdaterServerVersion: (currentPackageName: string, options?: {
904
- searchFrom?: string;
905
- }) => string;
906
- //#endregion
907
- //#region src/transformEnv.d.ts
908
- declare const transformEnv: <T extends Record<string, string>>(filename: string, env: T) => string;
909
- //#endregion
910
- //#region src/transformTemplate.d.ts
911
- type ExtractPlaceholders<T extends string> = T extends `${infer _Start}%%${infer Key}%%${infer Rest}` ? Key | ExtractPlaceholders<Rest> : never;
912
- type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]: string };
913
- /**
914
- * Replaces placeholders in the format %%key%% in a template string with values from the values object.
915
- * Uses generic type T to automatically infer placeholder keys from the template string to ensure type safety.
916
- *
917
- * @example
918
- * const str = "Hello %%name%%, you are %%age%% years old."
919
- * const result = transformTemplate(str, { name: "John", age: "20" })
920
- * // Result: "Hello John, you are 20 years old."
921
- */
922
- declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
923
- //#endregion
924
- export { BuildLogger, BuildLoggerConfig, BuildType, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, ManagedHelperStatement, ManagedHelperStrategy, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, WriteHotUpdaterConfigResult, banner, picocolors as colors, copyDirToTmp, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createTarBr, createTarBrTargetFiles, createTarGz, createTarGzTargetFiles, createZip, createZipTargetFiles, decryptJson, encryptJson, ensureInstallPackages, getAndroidSdkPath, getCwd, getPackageManager, getReactNativeMetadatas, link, loadConfig, log, makeEnv, index_d_exports as p, printBanner, renderImportStatements, resolveHotUpdaterServerVersion, resolvePackageVersion, stripAnsi, transformEnv, transformTemplate, writeHotUpdaterConfig };