create-rstack 1.7.21 → 1.8.1

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.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { Readable } from 'node:stream';
2
+ import { Writable } from 'node:stream';
3
+
1
4
  export declare type Argv = {
2
5
  help?: boolean;
3
6
  dir?: string;
@@ -17,6 +20,13 @@ export declare function checkCancel<T>(value: unknown): T;
17
20
  */
18
21
  export declare function collectAgentsFiles(agentsMdSearchDirs: string[]): string[];
19
22
 
23
+ declare interface CommonOptions {
24
+ input?: Readable;
25
+ output?: Writable;
26
+ signal?: AbortSignal;
27
+ withGuide?: boolean;
28
+ }
29
+
20
30
  /**
21
31
  * Copy files from one folder to another.
22
32
  * @param from Source folder
@@ -109,9 +119,9 @@ export declare function mergeAgentsFiles(agentsFiles: string[]): string;
109
119
  */
110
120
  export declare function mergePackageJson(targetPackage: string, extraPackage: string): void;
111
121
 
112
- export declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<symbol | Value[]>;
122
+ export declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
113
123
 
114
- declare interface MultiSelectOptions<Value> {
124
+ declare interface MultiSelectOptions<Value> extends CommonOptions {
115
125
  message: string;
116
126
  options: Option_2<Value>[];
117
127
  initialValues?: Value[];
@@ -138,6 +148,13 @@ declare type Option_2<Value> = Value extends Primitive ? {
138
148
  * By default, no `hint` is displayed.
139
149
  */
140
150
  hint?: string;
151
+ /**
152
+ * Whether this option is disabled.
153
+ * Disabled options are visible but cannot be selected.
154
+ *
155
+ * By default, options are not disabled.
156
+ */
157
+ disabled?: boolean;
141
158
  } : {
142
159
  /**
143
160
  * Internal data for this option.
@@ -154,13 +171,20 @@ declare type Option_2<Value> = Value extends Primitive ? {
154
171
  * By default, no `hint` is displayed.
155
172
  */
156
173
  hint?: string;
174
+ /**
175
+ * Whether this option is disabled.
176
+ * Disabled options are visible but cannot be selected.
177
+ *
178
+ * By default, options are not disabled.
179
+ */
180
+ disabled?: boolean;
157
181
  };
158
182
 
159
183
  declare type Primitive = Readonly<string | boolean | number>;
160
184
 
161
- export declare const select: <Value>(opts: SelectOptions<Value>) => Promise<symbol | Value>;
185
+ export declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
162
186
 
163
- declare interface SelectOptions<Value> {
187
+ declare interface SelectOptions<Value> extends CommonOptions {
164
188
  message: string;
165
189
  options: Option_2<Value>[];
166
190
  initialValue?: Value;
@@ -169,12 +193,12 @@ declare interface SelectOptions<Value> {
169
193
 
170
194
  export declare const text: (opts: TextOptions) => Promise<string | symbol>;
171
195
 
172
- declare interface TextOptions {
196
+ declare interface TextOptions extends CommonOptions {
173
197
  message: string;
174
198
  placeholder?: string;
175
199
  defaultValue?: string;
176
200
  initialValue?: string;
177
- validate?: (value: string) => string | Error | undefined;
201
+ validate?: (value: string | undefined) => string | Error | undefined;
178
202
  }
179
203
 
180
204
  export { }