Skip to content

Commit 87e3190

Browse files
committed
clarify definitions
1 parent 3446200 commit 87e3190

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cli/util/options.d.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
* @license Apache-2.0
44
*/
55

6+
/** A set of options. */
7+
export interface OptionSet {
8+
[key: string]: number | string
9+
}
10+
611
/** Command line option description. */
712
export interface OptionDescription {
813
/** Textual description. */
914
description?: string | string[],
1015
/** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */
1116
type?: "b" | "i" | "f" | "s" | "I" | "F" | "S",
1217
/** Substituted options, if any. */
13-
value?: { [key: string]: number | string },
18+
value?: OptionSet,
1419
/** Short alias, if any. */
1520
alias?: string
1621
/** The default value, if any. */
@@ -27,7 +32,7 @@ interface Config {
2732
/** Parsing result. */
2833
interface Result {
2934
/** Parsed options. */
30-
options: { [key: string]: number | string },
35+
options: OptionSet,
3136
/** Unknown options. */
3237
unknown: string[],
3338
/** Normal arguments. */
@@ -53,7 +58,7 @@ interface HelpOptions {
5358
export function help(config: Config, options?: HelpOptions): string;
5459

5560
/** Populates default values on a parsed options result. */
56-
export function addDefaults(config: Config, options: { [key: string]: number | string });
61+
export function addDefaults(config: Config, options: OptionSet): OptionSet;
5762

5863
/** Merges two sets of options into one, preferring the newer set. */
59-
export function merge(config: Config, currentOptions: { [key: string]: number | string }, parentOptions: { [key: string]: number | string });
64+
export function merge(config: Config, currentOptions: OptionSet, parentOptions: OptionSet): OptionSet;

0 commit comments

Comments
 (0)