|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. |
| 2 | +// See LICENSE in the project root for license information. |
| 3 | + |
| 4 | +/** |
| 5 | + * "baseCommand" from command-line.schema.json |
| 6 | + */ |
| 7 | +export interface IBaseCommandJson { |
| 8 | + commandKind: 'bulk' | 'global'; |
| 9 | + name: string; |
| 10 | + summary: string; |
| 11 | + description: string; |
| 12 | +} |
| 13 | + |
| 14 | +/** |
| 15 | + * "bulkCommand" from command-line.schema.json |
| 16 | + */ |
| 17 | +export interface IBulkCommandJson extends IBaseCommandJson { |
| 18 | + commandKind: 'bulk'; |
| 19 | + parallelized: boolean; |
| 20 | + ignoreMissingScript?: boolean; |
| 21 | +} |
| 22 | + |
| 23 | +/** |
| 24 | + * "globalCommand" from command-line.schema.json |
| 25 | + */ |
| 26 | +export interface IGlobalCommandJson extends IBaseCommandJson { |
| 27 | + commandKind: 'global'; |
| 28 | + scriptPath: string; |
| 29 | +} |
| 30 | + |
| 31 | +export type CommandJson = IBulkCommandJson | IGlobalCommandJson; |
| 32 | + |
| 33 | +/** |
| 34 | + * "baseParameter" from command-line.schema.json |
| 35 | + */ |
| 36 | +export interface IBaseParameterJson { |
| 37 | + parameterKind: 'flag' | 'choice'; |
| 38 | + longName: string; |
| 39 | + shortName?: string; |
| 40 | + description: string; |
| 41 | + associatedCommands: string[]; |
| 42 | +} |
| 43 | + |
| 44 | +/** |
| 45 | + * "flagParameter" from command-line.schema.json |
| 46 | + */ |
| 47 | +export interface IFlagParameterJson extends IBaseParameterJson { |
| 48 | + parameterKind: 'flag'; |
| 49 | +} |
| 50 | + |
| 51 | +/** |
| 52 | + * Part of "choiceParameter" from command-line.schema.json |
| 53 | + */ |
| 54 | +export interface IChoiceParameterAlternativeJson { |
| 55 | + name: string; |
| 56 | + description: string; |
| 57 | +} |
| 58 | + |
| 59 | +/** |
| 60 | + * "choiceParameter" from command-line.schema.json |
| 61 | + */ |
| 62 | +export interface IChoiceParameterJson extends IBaseParameterJson { |
| 63 | + parameterKind: 'choice'; |
| 64 | + alternatives: IChoiceParameterAlternativeJson[]; |
| 65 | + defaultValue?: string; |
| 66 | +} |
| 67 | + |
| 68 | +export type ParameterJson = IFlagParameterJson | IChoiceParameterJson; |
| 69 | + |
| 70 | +/** |
| 71 | + * Interfaces for the file format described by command-line.schema.json |
| 72 | + */ |
| 73 | +export interface ICommandLineJson { |
| 74 | + commands?: CommandJson[]; |
| 75 | + parameters?: ParameterJson[]; |
| 76 | +} |
0 commit comments