mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
Use ReadonlyArray for choices.
This commit is contained in:
Vendored
+2
-2
@@ -370,7 +370,7 @@ declare namespace yargs {
|
||||
O extends { number: true } ? number :
|
||||
O extends { string: true } ? string :
|
||||
O extends { normalize: true } ? string :
|
||||
O extends { choices: Array<infer C> } ? C :
|
||||
O extends { choices: ReadonlyArray<infer C> } ? C :
|
||||
O extends { coerce: (arg: any) => infer T } ? T :
|
||||
any;
|
||||
|
||||
@@ -389,7 +389,7 @@ declare namespace yargs {
|
||||
type SyncCompletionFunction = (current: string, argv: any) => string[];
|
||||
type AsyncCompletionFunction = (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void;
|
||||
type MiddlewareFunction<T> = (args: Arguments<T>) => void;
|
||||
type Choices = Array<string | true | undefined>;
|
||||
type Choices = ReadonlyArray<string | true | undefined>;
|
||||
type PositionalOptionsType = "boolean" | "number" | "string";
|
||||
}
|
||||
|
||||
|
||||
@@ -668,7 +668,7 @@ function Argv$scriptName() {
|
||||
}
|
||||
|
||||
type Color = "red" | "blue" | "green";
|
||||
const colors: Color[] = ["red", "blue", "green"];
|
||||
const colors: ReadonlyArray<Color> = ["red", "blue", "green"];
|
||||
|
||||
function Argv$inferOptionTypes() {
|
||||
// $ExpectType { [x: string]: any; a: (string | number)[] | undefined; b: boolean | undefined; c: number; n: number | undefined; s: string | undefined; _: string[]; $0: string; }
|
||||
|
||||
Reference in New Issue
Block a user