|
| 1 | +class CommandLineAction extends CommandLineParameterProvider { |
| 2 | + constructor(options: ICommandLineActionOptions); |
| 3 | + // (undocumented) |
| 4 | + public buildParser(actionsSubParser: argparse.SubParser): void; |
| 5 | + // (undocumented) |
| 6 | + public execute(): void; |
| 7 | + protected abstract onExecute(): void; |
| 8 | + // (undocumented) |
| 9 | + public options: ICommandLineActionOptions; |
| 10 | + // (undocumented) |
| 11 | + public processParsedData(data: ICommandLineParserData): void; |
| 12 | +} |
| 13 | + |
| 14 | +// (undocumented) |
| 15 | +class CommandLineFlagParameter extends CommandLineParameter<boolean> { |
| 16 | +} |
| 17 | + |
| 18 | +// (undocumented) |
| 19 | +class CommandLineIntegerParameter extends CommandLineParameter<number> { |
| 20 | +} |
| 21 | + |
| 22 | +// (undocumented) |
| 23 | +class CommandLineOptionParameter extends CommandLineParameter<string> { |
| 24 | +} |
| 25 | + |
| 26 | +// (undocumented) |
| 27 | +class CommandLineParameter<T> { |
| 28 | + constructor(key: string, converter: (data: string) => T); |
| 29 | + // (undocumented) |
| 30 | + public readonly key: string; |
| 31 | + // (undocumented) |
| 32 | + public setValue(data: ICommandLineParserData): void; |
| 33 | + // (undocumented) |
| 34 | + public readonly value: T; |
| 35 | +} |
| 36 | + |
| 37 | +class CommandLineParameterProvider { |
| 38 | + constructor(); |
| 39 | + // (undocumented) |
| 40 | + protected argumentParser: argparse.ArgumentParser; |
| 41 | + protected defineFlagParameter(options: ICommandLineFlagDefinition): CommandLineFlagParameter; |
| 42 | + protected defineIntegerParameter(options: ICommandLineIntegerDefinition): CommandLineIntegerParameter; |
| 43 | + // (undocumented) |
| 44 | + protected defineOptionParameter(options: ICommandLineOptionDefinition): CommandLineOptionParameter; |
| 45 | + protected defineStringListParameter(options: ICommandLineStringListDefinition): CommandLineStringListParameter; |
| 46 | + protected defineStringParameter(options: ICommandLineStringDefinition): CommandLineStringParameter; |
| 47 | + protected abstract onDefineParameters(): void; |
| 48 | + // (undocumented) |
| 49 | + protected processParsedData(data: ICommandLineParserData): void; |
| 50 | +} |
| 51 | + |
| 52 | +class CommandLineParser extends CommandLineParameterProvider { |
| 53 | + constructor(options: ICommandListParserOptions); |
| 54 | + public addAction(command: CommandLineAction): void; |
| 55 | + // (undocumented) |
| 56 | + protected chosenAction: CommandLineAction; |
| 57 | + public execute(args?: string[]): void; |
| 58 | + protected onExecute(): void; |
| 59 | +} |
| 60 | + |
| 61 | +// (undocumented) |
| 62 | +class CommandLineStringListParameter extends CommandLineParameter<string[]> { |
| 63 | +} |
| 64 | + |
| 65 | +// (undocumented) |
| 66 | +class CommandLineStringParameter extends CommandLineParameter<string> { |
| 67 | +} |
| 68 | + |
| 69 | +interface IBaseCommandLineDefinition { |
| 70 | + description: string; |
| 71 | + parameterLongName: string; |
| 72 | + parameterShortName?: string; |
| 73 | +} |
| 74 | + |
| 75 | +// (undocumented) |
| 76 | +interface ICommandLineActionOptions { |
| 77 | + actionVerb: string; |
| 78 | + documentation: string; |
| 79 | + summary: string; |
| 80 | +} |
| 81 | + |
| 82 | +interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition { |
| 83 | +} |
| 84 | + |
| 85 | +interface ICommandLineIntegerDefinition extends IKeyedCommandLineDefinition { |
| 86 | +} |
| 87 | + |
| 88 | +interface ICommandLineOptionDefinition extends IBaseCommandLineDefinition { |
| 89 | + options: string[]; |
| 90 | +} |
| 91 | + |
| 92 | +// (undocumented) |
| 93 | +interface ICommandLineParserData { |
| 94 | + // (undocumented) |
| 95 | + [ key: string ]: any; |
| 96 | + // (undocumented) |
| 97 | + action: string; |
| 98 | +} |
| 99 | + |
| 100 | +interface ICommandLineStringDefinition extends IKeyedCommandLineDefinition { |
| 101 | +} |
| 102 | + |
| 103 | +interface ICommandLineStringListDefinition extends IKeyedCommandLineDefinition { |
| 104 | +} |
| 105 | + |
| 106 | +// (undocumented) |
| 107 | +interface ICommandListParserOptions { |
| 108 | + // (undocumented) |
| 109 | + toolDescription: string; |
| 110 | + // (undocumented) |
| 111 | + toolFilename: string; |
| 112 | +} |
| 113 | + |
| 114 | +// (No packageDescription for this package) |
0 commit comments