UNPKG

1.99 kBTypeScriptView Raw
1import { Range, TextDocument } from 'vscode-languageserver-types';
2import { FlagOption } from './flagOption';
3export declare class Flag {
4 private readonly range;
5 private readonly name;
6 private readonly nameRange;
7 private readonly value;
8 private readonly valueRange;
9 private readonly options;
10 constructor(document: TextDocument, range: Range, name: string, nameRange: Range, value: string | null, valueRange: Range | null);
11 private createFlagOption;
12 toString(): string;
13 /**
14 * Returns the range that encompasses this entire flag. This includes the
15 * -- prefix in the beginning to the last character of the flag's value (if
16 * it has been defined).
17 *
18 * @return the entire range of this flag
19 */
20 getRange(): Range;
21 /**
22 * Returns the name of this flag. The name does not include the -- prefix.
23 * Thus, for HEALTHCHECK's --interval flag, interval is the flag's name and
24 * not --interval.
25 *
26 * @return this flag's name
27 */
28 getName(): string;
29 /**
30 * Returns the range that encompasses the flag's name
31 *
32 * @return the range containing the flag's name
33 */
34 getNameRange(): Range;
35 /**
36 * Returns the value that has been set to this flag. May be null if the
37 * flag is invalid and has no value set like a --start-period. If the flag
38 * is instead a --start-period= with an equals sign then the flag's value
39 * is the empty string.
40 *
41 * @return this flag's value if it has been defined, null otherwise
42 */
43 getValue(): string | null;
44 /**
45 * Returns the range that encompasses this flag's value. If no value has
46 * been set then null will be returned.
47 *
48 * @return the range containing this flag's value, or null if the flag
49 * has no value defined
50 */
51 getValueRange(): Range | null;
52 getOption(name: string): FlagOption | null;
53 getOptions(): FlagOption[];
54 hasOptions(): boolean;
55}