@clack/prompts
Advanced tools
Comparing version 0.2.2 to 0.3.0
# @clack/prompts | ||
## 0.3.0 | ||
### Minor Changes | ||
- 493c592: Improve types for select/multiselect prompts. Numbers and booleans are now supported as the `value` option. | ||
- 15558e3: Improved Windows/non-unicode support | ||
### Patch Changes | ||
- ca77da1: Fix multiselect initial value logic | ||
- Updated dependencies [ca77da1] | ||
- Updated dependencies [8aed606] | ||
- @clack/core@0.1.4 | ||
## 0.2.2 | ||
@@ -4,0 +18,0 @@ |
@@ -17,3 +17,4 @@ export { isCancel } from '@clack/core'; | ||
declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>; | ||
interface Option<Value extends Readonly<string>> { | ||
type Primitive = Readonly<string | boolean | number>; | ||
interface Option<Value extends Primitive> { | ||
value: Value; | ||
@@ -23,3 +24,3 @@ label?: string; | ||
} | ||
interface SelectOptions<Options extends Option<Value>[], Value extends Readonly<string>> { | ||
interface SelectOptions<Options extends Option<Value>[], Value extends Primitive> { | ||
message: string; | ||
@@ -29,4 +30,10 @@ options: Options; | ||
} | ||
declare const select: <Options extends Option<Value>[], Value extends string>(opts: SelectOptions<Options, Value>) => Promise<symbol | Options[number]["value"]>; | ||
declare const multiselect: <Options extends Option<Value>[], Value extends string>(opts: SelectOptions<Options, Value>) => Promise<symbol | Options[number]["value"][]>; | ||
interface MultiSelectOptions<Options extends Option<Value>[], Value extends Primitive> { | ||
message: string; | ||
options: Options; | ||
initialValue?: Options[number]['value'][]; | ||
cursorAt?: Options[number]["value"]; | ||
} | ||
declare const select: <Options extends Option<Value>[], Value extends Primitive>(opts: SelectOptions<Options, Value>) => Promise<symbol | Options[number]["value"]>; | ||
declare const multiselect: <Options extends Option<Value>[], Value extends Primitive>(opts: MultiSelectOptions<Options, Value>) => Promise<symbol | Options[number]["value"][]>; | ||
declare const note: (message?: string, title?: string) => void; | ||
@@ -41,2 +48,2 @@ declare const cancel: (message?: string) => void; | ||
export { ConfirmOptions, SelectOptions, TextOptions, cancel, confirm, intro, multiselect, note, outro, select, spinner, text }; | ||
export { ConfirmOptions, MultiSelectOptions, SelectOptions, TextOptions, cancel, confirm, intro, multiselect, note, outro, select, spinner, text }; |
{ | ||
"name": "@clack/prompts", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"type": "module", | ||
@@ -52,3 +52,3 @@ "main": "./dist/index.cjs", | ||
"dependencies": { | ||
"@clack/core": "^0.1.3", | ||
"@clack/core": "^0.1.4", | ||
"picocolors": "^1.0.0", | ||
@@ -58,5 +58,9 @@ "sisteransi": "^1.0.5" | ||
"devDependencies": { | ||
"unbuild": "^1.1.1" | ||
"unbuild": "^1.1.1", | ||
"is-unicode-supported": "^1.3.0" | ||
}, | ||
"bundledDependencies": [ | ||
"is-unicode-supported" | ||
], | ||
"scripts": {} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27705
12
183
2
2
10
Updated@clack/core@^0.1.4