@oclif/core 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/flags.d.ts
CHANGED
|
@@ -76,31 +76,31 @@ export declare const string: FlagDefinition<string, CustomOptions, {
|
|
|
76
76
|
}>;
|
|
77
77
|
export declare const version: (opts?: Partial<BooleanFlag<boolean>>) => BooleanFlag<void>;
|
|
78
78
|
export declare const help: (opts?: Partial<BooleanFlag<boolean>>) => BooleanFlag<void>;
|
|
79
|
-
type
|
|
80
|
-
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<
|
|
79
|
+
type ReadonlyElementOf<T extends ReadonlyArray<unknown>> = T[number];
|
|
80
|
+
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {
|
|
81
81
|
multiple: true;
|
|
82
82
|
options: T;
|
|
83
83
|
} & ({
|
|
84
|
-
default: OptionFlag<
|
|
84
|
+
default: OptionFlag<ReadonlyElementOf<T>[], P>['default'] | undefined;
|
|
85
85
|
} | {
|
|
86
86
|
required: true;
|
|
87
87
|
})): FlagDefinition<(typeof defaults.options)[number], P, {
|
|
88
88
|
multiple: true;
|
|
89
89
|
requiredOrDefaulted: true;
|
|
90
90
|
}>;
|
|
91
|
-
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<
|
|
91
|
+
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {
|
|
92
92
|
multiple?: false | undefined;
|
|
93
93
|
options: T;
|
|
94
94
|
} & ({
|
|
95
|
-
default: OptionFlag<
|
|
95
|
+
default: OptionFlag<ReadonlyElementOf<T>, P>['default'];
|
|
96
96
|
} | {
|
|
97
97
|
required: true;
|
|
98
98
|
})): FlagDefinition<(typeof defaults.options)[number], P, {
|
|
99
99
|
multiple: false;
|
|
100
100
|
requiredOrDefaulted: true;
|
|
101
101
|
}>;
|
|
102
|
-
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<
|
|
103
|
-
default?: OptionFlag<
|
|
102
|
+
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>, P>> & {
|
|
103
|
+
default?: OptionFlag<ReadonlyElementOf<T>, P>['default'] | undefined;
|
|
104
104
|
multiple?: false | undefined;
|
|
105
105
|
options: T;
|
|
106
106
|
required?: false | undefined;
|
|
@@ -108,8 +108,8 @@ export declare function option<T extends readonly string[], P extends CustomOpti
|
|
|
108
108
|
multiple: false;
|
|
109
109
|
requiredOrDefaulted: false;
|
|
110
110
|
}>;
|
|
111
|
-
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<
|
|
112
|
-
default?: OptionFlag<
|
|
111
|
+
export declare function option<T extends readonly string[], P extends CustomOptions>(defaults: Partial<OptionFlag<ReadonlyElementOf<T>[], P>> & {
|
|
112
|
+
default?: OptionFlag<ReadonlyElementOf<T>[], P>['default'] | undefined;
|
|
113
113
|
multiple: true;
|
|
114
114
|
options: T;
|
|
115
115
|
required?: false | undefined;
|
|
@@ -210,7 +210,8 @@ export type OptionFlagProps = FlagProps & {
|
|
|
210
210
|
export type FlagParserContext = Command & {
|
|
211
211
|
token: FlagToken;
|
|
212
212
|
};
|
|
213
|
-
|
|
213
|
+
type NonNullableElementOf<T> = [NonNullable<T>] extends [Array<infer U>] ? U : T;
|
|
214
|
+
export type FlagParser<T, I extends string | boolean, P = CustomOptions> = (input: I, context: FlagParserContext, opts: P & OptionFlag<T, P>) => Promise<NonNullableElementOf<T> | undefined>;
|
|
214
215
|
export type ArgParserContext = Command & {
|
|
215
216
|
token: ArgToken;
|
|
216
217
|
};
|
|
@@ -40,6 +40,11 @@ export declare namespace PJSON {
|
|
|
40
40
|
identifier?: string;
|
|
41
41
|
sign?: string;
|
|
42
42
|
};
|
|
43
|
+
windows?: {
|
|
44
|
+
homepage?: string;
|
|
45
|
+
keypath?: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
};
|
|
43
48
|
plugins?: string[];
|
|
44
49
|
repositoryPrefix?: string;
|
|
45
50
|
schema?: number;
|
|
@@ -69,6 +74,7 @@ export declare namespace PJSON {
|
|
|
69
74
|
interface S3 {
|
|
70
75
|
acl?: string;
|
|
71
76
|
bucket?: string;
|
|
77
|
+
folder?: string;
|
|
72
78
|
gz?: boolean;
|
|
73
79
|
host?: string;
|
|
74
80
|
templates: {
|