1- // @internal (undocumented)
1+ // @internal
22interface _ICommandLineParserData {
33 // (undocumented)
44 [ key : string ] : any ;
@@ -22,26 +22,51 @@ class CommandLineAction extends CommandLineParameterProvider {
2222
2323// @public
2424class CommandLineChoiceParameter extends CommandLineParameter < string > {
25+ // @internal
26+ constructor ( definition : ICommandLineChoiceDefinition ) ;
27+ readonly alternatives : ReadonlyArray < string > ;
28+ readonly defaultValue : string | undefined ;
29+ readonly kind : CommandLineParameterKind ;
2530}
2631
2732// @public
2833class CommandLineFlagParameter extends CommandLineParameter < boolean > {
34+ // @internal
35+ constructor ( definition : ICommandLineFlagDefinition ) ;
36+ readonly kind : CommandLineParameterKind ;
2937}
3038
3139// @public
32- class CommandLineIntegerParameter extends CommandLineParameter < number > {
40+ class CommandLineIntegerParameter extends CommandLineParameterWithArgument < number > {
41+ // @internal
42+ constructor ( definition : ICommandLineIntegerDefinition ) ;
43+ readonly kind : CommandLineParameterKind ;
3344}
3445
3546// @public
3647class CommandLineParameter < T > {
37- constructor ( key : string , converter ?: ( data : string ) => T ) ;
3848 // @internal
39- readonly _key : string ;
49+ constructor ( definition : IBaseCommandLineDefinition ) ;
4050 // @internal
41- _setValue ( data : ICommandLineParserData ) : void ;
51+ _parserKey : string ;
52+ // @internal
53+ _setValue ( data : any ) : void ;
54+ readonly description : string ;
55+ readonly kind : CommandLineParameterKind ;
56+ readonly longName : string ;
57+ readonly shortName : string | undefined ;
4258 readonly value : T ;
4359}
4460
61+ // @public
62+ enum CommandLineParameterKind {
63+ Choice = 0 ,
64+ Flag = 1 ,
65+ Integer = 2 ,
66+ String = 3 ,
67+ StringList = 4
68+ }
69+
4570// @public
4671class CommandLineParameterProvider {
4772 // @internal
@@ -55,6 +80,11 @@ class CommandLineParameterProvider {
5580 defineIntegerParameter ( definition : ICommandLineIntegerDefinition ) : CommandLineIntegerParameter ;
5681 defineStringListParameter ( definition : ICommandLineStringListDefinition ) : CommandLineStringListParameter ;
5782 defineStringParameter ( definition : ICommandLineStringDefinition ) : CommandLineStringParameter ;
83+ getChoiceParameter ( parameterLongName : string ) : CommandLineChoiceParameter ;
84+ getFlagParameter ( parameterLongName : string ) : CommandLineFlagParameter ;
85+ getIntegerParameter ( parameterLongName : string ) : CommandLineIntegerParameter ;
86+ getStringListParameter ( parameterLongName : string ) : CommandLineStringListParameter ;
87+ getStringParameter ( parameterLongName : string ) : CommandLineStringParameter ;
5888 protected abstract onDefineParameters ( ) : void ;
5989}
6090
@@ -69,11 +99,17 @@ class CommandLineParser extends CommandLineParameterProvider {
6999}
70100
71101// @public
72- class CommandLineStringListParameter extends CommandLineParameter < string [ ] > {
102+ class CommandLineStringListParameter extends CommandLineParameterWithArgument < string [ ] > {
103+ // @internal
104+ constructor ( definition : ICommandLineStringListDefinition ) ;
105+ readonly kind : CommandLineParameterKind ;
73106}
74107
75108// @public
76- class CommandLineStringParameter extends CommandLineParameter < string > {
109+ class CommandLineStringParameter extends CommandLineParameterWithArgument < string > {
110+ // @internal
111+ constructor ( definition : ICommandLineStringDefinition ) ;
112+ readonly kind : CommandLineParameterKind ;
77113}
78114
79115// @public (undocumented)
@@ -106,16 +142,16 @@ interface ICommandLineActionOptions {
106142
107143// @public
108144interface ICommandLineChoiceDefinition extends IBaseCommandLineDefinition {
145+ alternatives : string [ ] ;
109146 defaultValue ?: string ;
110- options : string [ ] ;
111147}
112148
113149// @public
114150interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition {
115151}
116152
117153// @public
118- interface ICommandLineIntegerDefinition extends IKeyedCommandLineDefinition {
154+ interface ICommandLineIntegerDefinition extends IBaseCommandLineDefinitionWithArgument {
119155}
120156
121157// @public
@@ -125,10 +161,10 @@ interface ICommandLineParserOptions {
125161}
126162
127163// @public
128- interface ICommandLineStringDefinition extends IKeyedCommandLineDefinition {
164+ interface ICommandLineStringDefinition extends IBaseCommandLineDefinitionWithArgument {
129165}
130166
131167// @public
132- interface ICommandLineStringListDefinition extends IKeyedCommandLineDefinition {
168+ interface ICommandLineStringListDefinition extends IBaseCommandLineDefinitionWithArgument {
133169}
134170
0 commit comments