1 | import { IConfig } from '@oclif/config';
|
2 | import * as Parser from '@oclif/parser';
|
3 | export declare type ICompletionContext = {
|
4 | args?: {
|
5 | [name: string]: string;
|
6 | };
|
7 | flags?: {
|
8 | [name: string]: string;
|
9 | };
|
10 | argv?: string[];
|
11 | config: IConfig;
|
12 | };
|
13 | export declare type ICompletion = {
|
14 | skipCache?: boolean;
|
15 | cacheDuration?: number;
|
16 | cacheKey?(ctx: ICompletionContext): Promise<string>;
|
17 | options(ctx: ICompletionContext): Promise<string[]>;
|
18 | };
|
19 | export declare type IOptionFlag<T> = Parser.flags.IOptionFlag<T> & {
|
20 | completion?: ICompletion;
|
21 | };
|
22 | export declare type IFlag<T> = Parser.flags.IBooleanFlag<T> | IOptionFlag<T>;
|
23 | export declare type Output = Parser.flags.Output;
|
24 | export declare type Input<T extends Output> = {
|
25 | [P in keyof T]: IFlag<T[P]>;
|
26 | };
|
27 | export declare type Definition<T> = {
|
28 | (options: {
|
29 | multiple: true;
|
30 | } & Partial<IOptionFlag<T[]>>): IOptionFlag<T[]>;
|
31 | (options: ({
|
32 | required: true;
|
33 | } | {
|
34 | default: Parser.flags.Default<T>;
|
35 | }) & Partial<IOptionFlag<T>>): IOptionFlag<T>;
|
36 | (options?: Partial<IOptionFlag<T>>): IOptionFlag<T | undefined>;
|
37 | };
|
38 | export declare function build<T>(defaults: {
|
39 | parse: IOptionFlag<T>['parse'];
|
40 | } & Partial<IOptionFlag<T>>): Definition<T>;
|
41 | export declare function build(defaults: Partial<IOptionFlag<string>>): Definition<string>;
|
42 | export declare function option<T>(options: {
|
43 | parse: IOptionFlag<T>['parse'];
|
44 | } & Partial<IOptionFlag<T>>): IOptionFlag<T | undefined>;
|
45 | declare const _enum: <T = string>(opts: Parser.flags.EnumFlagOptions<T>) => IOptionFlag<T>;
|
46 | export { _enum as enum };
|
47 | declare const stringFlag: Definition<string>;
|
48 | export { stringFlag as string };
|
49 | export { boolean, integer } from '@oclif/parser/lib/flags';
|
50 | export declare const version: (opts?: Partial<Parser.flags.IBooleanFlag<boolean>>) => Parser.flags.IBooleanFlag<void>;
|
51 | export declare const help: (opts?: Partial<Parser.flags.IBooleanFlag<boolean>>) => Parser.flags.IBooleanFlag<void>;
|