@wooksjs/event-cli 0.5.20 → 0.6.0
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/LICENSE +21 -0
- package/dist/index.cjs +269 -258
- package/dist/index.d.ts +5 -384
- package/dist/index.mjs +236 -247
- package/package.json +13 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as wooks from 'wooks';
|
|
2
|
+
import { TWooksHandler, TWooksOptions, WooksAdapterBase, Wooks } from 'wooks';
|
|
3
3
|
import * as _prostojs_cli_help from '@prostojs/cli-help';
|
|
4
4
|
import { CliHelpRenderer, TCliHelpOptions, TCliEntry } from '@prostojs/cli-help';
|
|
5
5
|
import { TConsoleBase } from '@prostojs/logger';
|
|
6
6
|
import * as _wooksjs_event_core from '@wooksjs/event-core';
|
|
7
7
|
import { TEventOptions, TEmpty } from '@wooksjs/event-core';
|
|
8
8
|
import minimist from 'minimist';
|
|
9
|
-
import {
|
|
9
|
+
import { TProstoRouterPathHandle } from '@prostojs/router';
|
|
10
10
|
|
|
11
11
|
interface TCliEventData {
|
|
12
12
|
argv: string[];
|
|
@@ -21,12 +21,6 @@ interface TCliContextStore {
|
|
|
21
21
|
}
|
|
22
22
|
interface TCliHelpCustom {
|
|
23
23
|
handler: TWooksHandler<any>;
|
|
24
|
-
/**
|
|
25
|
-
* ### Callback for registered path
|
|
26
|
-
*
|
|
27
|
-
* @param path registered path
|
|
28
|
-
* @param aliasType 0 - direct command, 1 - direct alias, 2 - computed alias
|
|
29
|
-
*/
|
|
30
24
|
cb?: <T>(path: string, aliasType: number, route?: TProstoRouterPathHandle<T>) => void;
|
|
31
25
|
}
|
|
32
26
|
type TCliHelpRenderer = CliHelpRenderer<TCliHelpCustom>;
|
|
@@ -52,402 +46,29 @@ declare class WooksCli extends WooksAdapterBase {
|
|
|
52
46
|
protected logger: TConsoleBase;
|
|
53
47
|
protected cliHelp: TCliHelpRenderer;
|
|
54
48
|
constructor(opts?: TWooksCliOptions | undefined, wooks?: Wooks | WooksAdapterBase);
|
|
55
|
-
|
|
56
|
-
* ### Register CLI Command
|
|
57
|
-
* Command path segments may be separated by / or space.
|
|
58
|
-
*
|
|
59
|
-
* For example the folowing path are interpreted the same:
|
|
60
|
-
* - "command test use:dev :name"
|
|
61
|
-
* - "command/test/use:dev/:name"
|
|
62
|
-
*
|
|
63
|
-
* Where name will become an argument
|
|
64
|
-
*
|
|
65
|
-
* ```js
|
|
66
|
-
* // example without options
|
|
67
|
-
* app.cli('command/:arg', () => 'arg = ' + useRouteParams().params.arg )
|
|
68
|
-
*
|
|
69
|
-
* // example with options
|
|
70
|
-
* app.cli('command/:arg', {
|
|
71
|
-
* description: 'Description of the command',
|
|
72
|
-
* options: [{ keys: ['project', 'p'], description: 'Description of the option', value: 'myProject' }],
|
|
73
|
-
* args: { arg: 'Description of the arg' },
|
|
74
|
-
* aliases: ['cmd'], // alias "cmd/:arg" will be registered
|
|
75
|
-
* examples: [{
|
|
76
|
-
* description: 'Example of usage with someProject',
|
|
77
|
-
* cmd: 'argValue -p=someProject',
|
|
78
|
-
* // will result in help display:
|
|
79
|
-
* // "# Example of usage with someProject\n" +
|
|
80
|
-
* // "$ myCli command argValue -p=someProject\n"
|
|
81
|
-
* }],
|
|
82
|
-
* handler: () => 'arg = ' + useRouteParams().params.arg
|
|
83
|
-
* })
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* @param path command path
|
|
87
|
-
* @param _options handler or options
|
|
88
|
-
*
|
|
89
|
-
* @returns
|
|
90
|
-
*/
|
|
91
|
-
cli<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, _options: TWooksCliEntry<ResType> | TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
49
|
+
cli<ResType = unknown, ParamsType = Record<string, string | string[]>>(path: string, _options: TWooksCliEntry<ResType> | TWooksHandler<ResType>): wooks.TProstoRouterPathHandle<ParamsType>;
|
|
92
50
|
protected alreadyComputedAliases: boolean;
|
|
93
51
|
protected computeAliases(): void;
|
|
94
|
-
/**
|
|
95
|
-
* ## run
|
|
96
|
-
* ### Start command processing
|
|
97
|
-
* Triggers command processing
|
|
98
|
-
*
|
|
99
|
-
* By default takes `process.argv.slice(2)` as a command
|
|
100
|
-
*
|
|
101
|
-
* It's possible to replace the command by passing an argument
|
|
102
|
-
*
|
|
103
|
-
* @param _argv optionally overwrite `process.argv.slice(2)` with your `argv` array
|
|
104
|
-
*/
|
|
105
52
|
run(_argv?: string[], _opts?: minimist.Opts): Promise<unknown>;
|
|
106
53
|
protected onError(e: Error): void;
|
|
107
|
-
/**
|
|
108
|
-
* Triggers `unknown command` processing and callbacks
|
|
109
|
-
* @param pathParams `string[]` containing command
|
|
110
|
-
*/
|
|
111
54
|
onUnknownCommand(pathParams: string[]): void;
|
|
112
55
|
protected error(e: string | Error): void;
|
|
113
56
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Factory for WooksCli App
|
|
116
|
-
* @param opts TWooksCliOptions
|
|
117
|
-
* @param wooks Wooks | WooksAdapterBase
|
|
118
|
-
* @returns WooksCli
|
|
119
|
-
*/
|
|
120
57
|
declare function createCliApp(opts?: TWooksCliOptions, wooks?: Wooks | WooksAdapterBase): WooksCli;
|
|
121
58
|
|
|
122
|
-
/**
|
|
123
|
-
* ## useCliHelp
|
|
124
|
-
* ### Composable
|
|
125
|
-
* ```js
|
|
126
|
-
* // example of printing cli instructions
|
|
127
|
-
* const { print } = useCliHelp()
|
|
128
|
-
* // print with colors
|
|
129
|
-
* print(true)
|
|
130
|
-
* // print with no colors
|
|
131
|
-
* // print(false)
|
|
132
|
-
* ```
|
|
133
|
-
* @returns
|
|
134
|
-
*/
|
|
135
59
|
declare function useCliHelp(): {
|
|
136
60
|
getCliHelp: () => TCliHelpRenderer;
|
|
137
61
|
getEntry: () => _prostojs_cli_help.TCliEntry<TCliHelpCustom>;
|
|
138
62
|
render: (width?: number, withColors?: boolean) => string[];
|
|
139
63
|
print: (withColors?: boolean) => void;
|
|
140
64
|
};
|
|
141
|
-
/**
|
|
142
|
-
* ## useAutoHelp
|
|
143
|
-
* ### Composable
|
|
144
|
-
*
|
|
145
|
-
* Prints help if `--help` option provided.
|
|
146
|
-
*
|
|
147
|
-
* ```js
|
|
148
|
-
* // example of use: print help and exit
|
|
149
|
-
* app.cli('test', () => {
|
|
150
|
-
* useAutoHelp() && process.exit(0)
|
|
151
|
-
* return 'hit test command'
|
|
152
|
-
* })
|
|
153
|
-
*
|
|
154
|
-
* // add option -h to print help, no colors
|
|
155
|
-
* app.cli('test/nocolors', () => {
|
|
156
|
-
* useAutoHelp(['help', 'h'], false) && process.exit(0)
|
|
157
|
-
* return 'hit test nocolors command'
|
|
158
|
-
* })
|
|
159
|
-
* ```
|
|
160
|
-
* @param keys default `['help']` - list of options to trigger help render
|
|
161
|
-
* @param colors default `true`, prints with colors when true
|
|
162
|
-
* @returns true when --help was provided. Otherwise returns false
|
|
163
|
-
*/
|
|
164
65
|
declare function useAutoHelp(keys?: string[], colors?: boolean): true | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* ##useCommandLookupHelp
|
|
167
|
-
* ### Composable
|
|
168
|
-
*
|
|
169
|
-
* Tries to find valid command based on provided command.
|
|
170
|
-
*
|
|
171
|
-
* If manages to find a valid command, throws an error
|
|
172
|
-
* suggesting a list of valid commands
|
|
173
|
-
*
|
|
174
|
-
* Best to use in `onUnknownCommand` callback:
|
|
175
|
-
*
|
|
176
|
-
* ```js
|
|
177
|
-
* const app = createCliApp({
|
|
178
|
-
* onUnknownCommand: (path, raiseError) => {
|
|
179
|
-
* // will throw an error suggesting a list
|
|
180
|
-
* // of valid commands if could find some
|
|
181
|
-
* useCommandLookupHelp()
|
|
182
|
-
* // fallback to a regular error handler
|
|
183
|
-
* raiseError()
|
|
184
|
-
* },
|
|
185
|
-
* })
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @param lookupDepth depth of search in backwards
|
|
189
|
-
* @example
|
|
190
|
-
*
|
|
191
|
-
* For provided command `run test:drive dir`
|
|
192
|
-
* - lookup1: `run test:drive dir` (deep = 0)
|
|
193
|
-
* - lookup2: `run test:drive` (deep = 1)
|
|
194
|
-
* - lookup3: `run test` (deep = 2)
|
|
195
|
-
* - lookup4: `run` (deep = 3)
|
|
196
|
-
* ...
|
|
197
|
-
*/
|
|
198
66
|
declare function useCommandLookupHelp(lookupDepth?: number): void;
|
|
199
67
|
|
|
200
|
-
/**
|
|
201
|
-
* Get CLI Options
|
|
202
|
-
*
|
|
203
|
-
* @returns an object with CLI options
|
|
204
|
-
*/
|
|
205
68
|
declare function useCliOptions(): Record<string, string | boolean>;
|
|
206
|
-
/**
|
|
207
|
-
* Getter for Cli Option value
|
|
208
|
-
*
|
|
209
|
-
* @param name name of the option
|
|
210
|
-
* @returns value of a CLI option
|
|
211
|
-
*/
|
|
212
69
|
declare function useCliOption(name: string): string | boolean;
|
|
213
70
|
|
|
214
71
|
declare function createCliContext(data: Omit<TCliEventData, 'type'>, options: TEventOptions): <T>(cb: (...a: any[]) => T) => T;
|
|
215
|
-
|
|
216
|
-
* Wrapper on top of useEventContext that provides
|
|
217
|
-
* proper context types for CLI event
|
|
218
|
-
* @returns set of hooks { getCtx, restoreCtx, clearCtx, hookStore, getStore, setStore }
|
|
219
|
-
*/
|
|
220
|
-
declare function useCliContext<T extends TEmpty>(): {
|
|
221
|
-
getCtx: () => TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>;
|
|
222
|
-
store: <K extends "flags" | keyof _wooksjs_event_core.TGenericContextStore<TCliEventData> | keyof T>(key: K) => {
|
|
223
|
-
value: (TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K];
|
|
224
|
-
hook: <K2 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2) => {
|
|
225
|
-
value: Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2];
|
|
226
|
-
isDefined: boolean;
|
|
227
|
-
};
|
|
228
|
-
init: <K2_1 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_1, getter: () => Required<Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1]) => Required<Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>[K2_1];
|
|
229
|
-
set: <K2_2 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_2, v: Required<(TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2]) => Required<(TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K]>[K2_2];
|
|
230
|
-
get: <K2_3 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_3) => Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K][K2_3] | undefined;
|
|
231
|
-
has: <K2_4 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_4) => boolean;
|
|
232
|
-
del: <K2_5 extends keyof Required<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>[K]>(key2: K2_5) => void;
|
|
233
|
-
entries: () => [string, unknown][];
|
|
234
|
-
clear: () => void;
|
|
235
|
-
};
|
|
236
|
-
getStore: <K_1 extends "flags" | keyof _wooksjs_event_core.TGenericContextStore<TCliEventData> | keyof T>(key: K_1) => (TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K_1];
|
|
237
|
-
setStore: <K_2 extends "flags" | keyof _wooksjs_event_core.TGenericContextStore<TCliEventData> | keyof T>(key: K_2, v: (TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>)[K_2]) => void;
|
|
238
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
239
|
-
hasParentCtx: () => boolean;
|
|
240
|
-
getParentCtx: <T2 = TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>() => {
|
|
241
|
-
getCtx: () => T2;
|
|
242
|
-
store: <K_3 extends keyof T2>(key: K_3) => {
|
|
243
|
-
value: T2[K_3];
|
|
244
|
-
hook: <K2_6 extends keyof Required<T2>[K_3]>(key2: K2_6) => {
|
|
245
|
-
value: Required<T2>[K_3][K2_6];
|
|
246
|
-
isDefined: boolean;
|
|
247
|
-
};
|
|
248
|
-
init: <K2_7 extends keyof Required<T2>[K_3]>(key2: K2_7, getter: () => Required<Required<T2>[K_3]>[K2_7]) => Required<Required<T2>[K_3]>[K2_7];
|
|
249
|
-
set: <K2_8 extends keyof Required<T2>[K_3]>(key2: K2_8, v: Required<T2[K_3]>[K2_8]) => Required<T2[K_3]>[K2_8];
|
|
250
|
-
get: <K2_9 extends keyof Required<T2>[K_3]>(key2: K2_9) => Required<T2>[K_3][K2_9] | undefined;
|
|
251
|
-
has: <K2_10 extends keyof Required<T2>[K_3]>(key2: K2_10) => boolean;
|
|
252
|
-
del: <K2_11 extends keyof Required<T2>[K_3]>(key2: K2_11) => void;
|
|
253
|
-
entries: () => [string, unknown][];
|
|
254
|
-
clear: () => void;
|
|
255
|
-
};
|
|
256
|
-
getStore: <K_4 extends keyof T2>(key: K_4) => T2[K_4];
|
|
257
|
-
setStore: <K_5 extends keyof T2>(key: K_5, v: T2[K_5]) => void;
|
|
258
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
259
|
-
hasParentCtx: () => boolean;
|
|
260
|
-
getParentCtx: <T2_1 = T2>() => {
|
|
261
|
-
getCtx: () => T2_1;
|
|
262
|
-
store: <K_6 extends keyof T2_1>(key: K_6) => {
|
|
263
|
-
value: T2_1[K_6];
|
|
264
|
-
hook: <K2_12 extends keyof Required<T2_1>[K_6]>(key2: K2_12) => {
|
|
265
|
-
value: Required<T2_1>[K_6][K2_12];
|
|
266
|
-
isDefined: boolean;
|
|
267
|
-
};
|
|
268
|
-
init: <K2_13 extends keyof Required<T2_1>[K_6]>(key2: K2_13, getter: () => Required<Required<T2_1>[K_6]>[K2_13]) => Required<Required<T2_1>[K_6]>[K2_13];
|
|
269
|
-
set: <K2_14 extends keyof Required<T2_1>[K_6]>(key2: K2_14, v: Required<T2_1[K_6]>[K2_14]) => Required<T2_1[K_6]>[K2_14];
|
|
270
|
-
get: <K2_15 extends keyof Required<T2_1>[K_6]>(key2: K2_15) => Required<T2_1>[K_6][K2_15] | undefined;
|
|
271
|
-
has: <K2_16 extends keyof Required<T2_1>[K_6]>(key2: K2_16) => boolean;
|
|
272
|
-
del: <K2_17 extends keyof Required<T2_1>[K_6]>(key2: K2_17) => void;
|
|
273
|
-
entries: () => [string, unknown][];
|
|
274
|
-
clear: () => void;
|
|
275
|
-
};
|
|
276
|
-
getStore: <K_7 extends keyof T2_1>(key: K_7) => T2_1[K_7];
|
|
277
|
-
setStore: <K_8 extends keyof T2_1>(key: K_8, v: T2_1[K_8]) => void;
|
|
278
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
279
|
-
hasParentCtx: () => boolean;
|
|
280
|
-
getParentCtx: <T2_2 = T2_1>() => {
|
|
281
|
-
getCtx: () => T2_2;
|
|
282
|
-
store: <K_9 extends keyof T2_2>(key: K_9) => {
|
|
283
|
-
value: T2_2[K_9];
|
|
284
|
-
hook: <K2_18 extends keyof Required<T2_2>[K_9]>(key2: K2_18) => {
|
|
285
|
-
value: Required<T2_2>[K_9][K2_18];
|
|
286
|
-
isDefined: boolean;
|
|
287
|
-
};
|
|
288
|
-
init: <K2_19 extends keyof Required<T2_2>[K_9]>(key2: K2_19, getter: () => Required<Required<T2_2>[K_9]>[K2_19]) => Required<Required<T2_2>[K_9]>[K2_19];
|
|
289
|
-
set: <K2_20 extends keyof Required<T2_2>[K_9]>(key2: K2_20, v: Required<T2_2[K_9]>[K2_20]) => Required<T2_2[K_9]>[K2_20];
|
|
290
|
-
get: <K2_21 extends keyof Required<T2_2>[K_9]>(key2: K2_21) => Required<T2_2>[K_9][K2_21] | undefined;
|
|
291
|
-
has: <K2_22 extends keyof Required<T2_2>[K_9]>(key2: K2_22) => boolean;
|
|
292
|
-
del: <K2_23 extends keyof Required<T2_2>[K_9]>(key2: K2_23) => void;
|
|
293
|
-
entries: () => [string, unknown][];
|
|
294
|
-
clear: () => void;
|
|
295
|
-
};
|
|
296
|
-
getStore: <K_10 extends keyof T2_2>(key: K_10) => T2_2[K_10];
|
|
297
|
-
setStore: <K_11 extends keyof T2_2>(key: K_11, v: T2_2[K_11]) => void;
|
|
298
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
299
|
-
hasParentCtx: () => boolean;
|
|
300
|
-
getParentCtx: <T2_3 = T2_2>() => {
|
|
301
|
-
getCtx: () => T2_3;
|
|
302
|
-
store: <K_12 extends keyof T2_3>(key: K_12) => {
|
|
303
|
-
value: T2_3[K_12];
|
|
304
|
-
hook: <K2_24 extends keyof Required<T2_3>[K_12]>(key2: K2_24) => {
|
|
305
|
-
value: Required<T2_3>[K_12][K2_24];
|
|
306
|
-
isDefined: boolean;
|
|
307
|
-
};
|
|
308
|
-
init: <K2_25 extends keyof Required<T2_3>[K_12]>(key2: K2_25, getter: () => Required<Required<T2_3>[K_12]>[K2_25]) => Required<Required<T2_3>[K_12]>[K2_25];
|
|
309
|
-
set: <K2_26 extends keyof Required<T2_3>[K_12]>(key2: K2_26, v: Required<T2_3[K_12]>[K2_26]) => Required<T2_3[K_12]>[K2_26];
|
|
310
|
-
get: <K2_27 extends keyof Required<T2_3>[K_12]>(key2: K2_27) => Required<T2_3>[K_12][K2_27] | undefined;
|
|
311
|
-
has: <K2_28 extends keyof Required<T2_3>[K_12]>(key2: K2_28) => boolean;
|
|
312
|
-
del: <K2_29 extends keyof Required<T2_3>[K_12]>(key2: K2_29) => void;
|
|
313
|
-
entries: () => [string, unknown][];
|
|
314
|
-
clear: () => void;
|
|
315
|
-
};
|
|
316
|
-
getStore: <K_13 extends keyof T2_3>(key: K_13) => T2_3[K_13];
|
|
317
|
-
setStore: <K_14 extends keyof T2_3>(key: K_14, v: T2_3[K_14]) => void;
|
|
318
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
319
|
-
hasParentCtx: () => boolean;
|
|
320
|
-
getParentCtx: <T2_4 = T2_3>() => {
|
|
321
|
-
getCtx: () => T2_4;
|
|
322
|
-
store: <K_15 extends keyof T2_4>(key: K_15) => {
|
|
323
|
-
value: T2_4[K_15];
|
|
324
|
-
hook: <K2_30 extends keyof Required<T2_4>[K_15]>(key2: K2_30) => {
|
|
325
|
-
value: Required<T2_4>[K_15][K2_30];
|
|
326
|
-
isDefined: boolean;
|
|
327
|
-
};
|
|
328
|
-
init: <K2_31 extends keyof Required<T2_4>[K_15]>(key2: K2_31, getter: () => Required<Required<T2_4>[K_15]>[K2_31]) => Required<Required<T2_4>[K_15]>[K2_31];
|
|
329
|
-
set: <K2_32 extends keyof Required<T2_4>[K_15]>(key2: K2_32, v: Required<T2_4[K_15]>[K2_32]) => Required<T2_4[K_15]>[K2_32];
|
|
330
|
-
get: <K2_33 extends keyof Required<T2_4>[K_15]>(key2: K2_33) => Required<T2_4>[K_15][K2_33] | undefined;
|
|
331
|
-
has: <K2_34 extends keyof Required<T2_4>[K_15]>(key2: K2_34) => boolean;
|
|
332
|
-
del: <K2_35 extends keyof Required<T2_4>[K_15]>(key2: K2_35) => void;
|
|
333
|
-
entries: () => [string, unknown][];
|
|
334
|
-
clear: () => void;
|
|
335
|
-
};
|
|
336
|
-
getStore: <K_16 extends keyof T2_4>(key: K_16) => T2_4[K_16];
|
|
337
|
-
setStore: <K_17 extends keyof T2_4>(key: K_17, v: T2_4[K_17]) => void;
|
|
338
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
339
|
-
hasParentCtx: () => boolean;
|
|
340
|
-
getParentCtx: <T2_5 = T2_4>() => {
|
|
341
|
-
getCtx: () => T2_5;
|
|
342
|
-
store: <K_18 extends keyof T2_5>(key: K_18) => {
|
|
343
|
-
value: T2_5[K_18];
|
|
344
|
-
hook: <K2_36 extends keyof Required<T2_5>[K_18]>(key2: K2_36) => {
|
|
345
|
-
value: Required<T2_5>[K_18][K2_36];
|
|
346
|
-
isDefined: boolean;
|
|
347
|
-
};
|
|
348
|
-
init: <K2_37 extends keyof Required<T2_5>[K_18]>(key2: K2_37, getter: () => Required<Required<T2_5>[K_18]>[K2_37]) => Required<Required<T2_5>[K_18]>[K2_37];
|
|
349
|
-
set: <K2_38 extends keyof Required<T2_5>[K_18]>(key2: K2_38, v: Required<T2_5[K_18]>[K2_38]) => Required<T2_5[K_18]>[K2_38];
|
|
350
|
-
get: <K2_39 extends keyof Required<T2_5>[K_18]>(key2: K2_39) => Required<T2_5>[K_18][K2_39] | undefined;
|
|
351
|
-
has: <K2_40 extends keyof Required<T2_5>[K_18]>(key2: K2_40) => boolean;
|
|
352
|
-
del: <K2_41 extends keyof Required<T2_5>[K_18]>(key2: K2_41) => void;
|
|
353
|
-
entries: () => [string, unknown][];
|
|
354
|
-
clear: () => void;
|
|
355
|
-
};
|
|
356
|
-
getStore: <K_19 extends keyof T2_5>(key: K_19) => T2_5[K_19];
|
|
357
|
-
setStore: <K_20 extends keyof T2_5>(key: K_20, v: T2_5[K_20]) => void;
|
|
358
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
359
|
-
hasParentCtx: () => boolean;
|
|
360
|
-
getParentCtx: <T2_6 = T2_5>() => {
|
|
361
|
-
getCtx: () => T2_6;
|
|
362
|
-
store: <K_21 extends keyof T2_6>(key: K_21) => {
|
|
363
|
-
value: T2_6[K_21];
|
|
364
|
-
hook: <K2_42 extends keyof Required<T2_6>[K_21]>(key2: K2_42) => {
|
|
365
|
-
value: Required<T2_6>[K_21][K2_42];
|
|
366
|
-
isDefined: boolean;
|
|
367
|
-
};
|
|
368
|
-
init: <K2_43 extends keyof Required<T2_6>[K_21]>(key2: K2_43, getter: () => Required<Required<T2_6>[K_21]>[K2_43]) => Required<Required<T2_6>[K_21]>[K2_43];
|
|
369
|
-
set: <K2_44 extends keyof Required<T2_6>[K_21]>(key2: K2_44, v: Required<T2_6[K_21]>[K2_44]) => Required<T2_6[K_21]>[K2_44];
|
|
370
|
-
get: <K2_45 extends keyof Required<T2_6>[K_21]>(key2: K2_45) => Required<T2_6>[K_21][K2_45] | undefined;
|
|
371
|
-
has: <K2_46 extends keyof Required<T2_6>[K_21]>(key2: K2_46) => boolean;
|
|
372
|
-
del: <K2_47 extends keyof Required<T2_6>[K_21]>(key2: K2_47) => void;
|
|
373
|
-
entries: () => [string, unknown][];
|
|
374
|
-
clear: () => void;
|
|
375
|
-
};
|
|
376
|
-
getStore: <K_22 extends keyof T2_6>(key: K_22) => T2_6[K_22];
|
|
377
|
-
setStore: <K_23 extends keyof T2_6>(key: K_23, v: T2_6[K_23]) => void;
|
|
378
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
379
|
-
hasParentCtx: () => boolean;
|
|
380
|
-
getParentCtx: <T2_7 = T2_6>() => {
|
|
381
|
-
getCtx: () => T2_7;
|
|
382
|
-
store: <K_24 extends keyof T2_7>(key: K_24) => {
|
|
383
|
-
value: T2_7[K_24];
|
|
384
|
-
hook: <K2_48 extends keyof Required<T2_7>[K_24]>(key2: K2_48) => {
|
|
385
|
-
value: Required<T2_7>[K_24][K2_48];
|
|
386
|
-
isDefined: boolean;
|
|
387
|
-
};
|
|
388
|
-
init: <K2_49 extends keyof Required<T2_7>[K_24]>(key2: K2_49, getter: () => Required<Required<T2_7>[K_24]>[K2_49]) => Required<Required<T2_7>[K_24]>[K2_49];
|
|
389
|
-
set: <K2_50 extends keyof Required<T2_7>[K_24]>(key2: K2_50, v: Required<T2_7[K_24]>[K2_50]) => Required<T2_7[K_24]>[K2_50];
|
|
390
|
-
get: <K2_51 extends keyof Required<T2_7>[K_24]>(key2: K2_51) => Required<T2_7>[K_24][K2_51] | undefined;
|
|
391
|
-
has: <K2_52 extends keyof Required<T2_7>[K_24]>(key2: K2_52) => boolean;
|
|
392
|
-
del: <K2_53 extends keyof Required<T2_7>[K_24]>(key2: K2_53) => void;
|
|
393
|
-
entries: () => [string, unknown][];
|
|
394
|
-
clear: () => void;
|
|
395
|
-
};
|
|
396
|
-
getStore: <K_25 extends keyof T2_7>(key: K_25) => T2_7[K_25];
|
|
397
|
-
setStore: <K_26 extends keyof T2_7>(key: K_26, v: T2_7[K_26]) => void;
|
|
398
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
399
|
-
hasParentCtx: () => boolean;
|
|
400
|
-
getParentCtx: <T2_8 = T2_7>() => {
|
|
401
|
-
getCtx: () => T2_8;
|
|
402
|
-
store: <K_27 extends keyof T2_8>(key: K_27) => {
|
|
403
|
-
value: T2_8[K_27];
|
|
404
|
-
hook: <K2_54 extends keyof Required<T2_8>[K_27]>(key2: K2_54) => {
|
|
405
|
-
value: Required<T2_8>[K_27][K2_54];
|
|
406
|
-
isDefined: boolean;
|
|
407
|
-
};
|
|
408
|
-
init: <K2_55 extends keyof Required<T2_8>[K_27]>(key2: K2_55, getter: () => Required<Required<T2_8>[K_27]>[K2_55]) => Required<Required<T2_8>[K_27]>[K2_55];
|
|
409
|
-
set: <K2_56 extends keyof Required<T2_8>[K_27]>(key2: K2_56, v: Required<T2_8[K_27]>[K2_56]) => Required<T2_8[K_27]>[K2_56];
|
|
410
|
-
get: <K2_57 extends keyof Required<T2_8>[K_27]>(key2: K2_57) => Required<T2_8>[K_27][K2_57] | undefined;
|
|
411
|
-
has: <K2_58 extends keyof Required<T2_8>[K_27]>(key2: K2_58) => boolean;
|
|
412
|
-
del: <K2_59 extends keyof Required<T2_8>[K_27]>(key2: K2_59) => void;
|
|
413
|
-
entries: () => [string, unknown][];
|
|
414
|
-
clear: () => void;
|
|
415
|
-
};
|
|
416
|
-
getStore: <K_28 extends keyof T2_8>(key: K_28) => T2_8[K_28];
|
|
417
|
-
setStore: <K_29 extends keyof T2_8>(key: K_29, v: T2_8[K_29]) => void;
|
|
418
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
419
|
-
hasParentCtx: () => boolean;
|
|
420
|
-
getParentCtx: <T2_9 = T2_8>() => {
|
|
421
|
-
getCtx: () => T2_9;
|
|
422
|
-
store: <K_30 extends keyof T2_9>(key: K_30) => {
|
|
423
|
-
value: T2_9[K_30];
|
|
424
|
-
hook: <K2_60 extends keyof Required<T2_9>[K_30]>(key2: K2_60) => {
|
|
425
|
-
value: Required<T2_9>[K_30][K2_60];
|
|
426
|
-
isDefined: boolean;
|
|
427
|
-
};
|
|
428
|
-
init: <K2_61 extends keyof Required<T2_9>[K_30]>(key2: K2_61, getter: () => Required<Required<T2_9>[K_30]>[K2_61]) => Required<Required<T2_9>[K_30]>[K2_61];
|
|
429
|
-
set: <K2_62 extends keyof Required<T2_9>[K_30]>(key2: K2_62, v: Required<T2_9[K_30]>[K2_62]) => Required<T2_9[K_30]>[K2_62];
|
|
430
|
-
get: <K2_63 extends keyof Required<T2_9>[K_30]>(key2: K2_63) => Required<T2_9>[K_30][K2_63] | undefined;
|
|
431
|
-
has: <K2_64 extends keyof Required<T2_9>[K_30]>(key2: K2_64) => boolean;
|
|
432
|
-
del: <K2_65 extends keyof Required<T2_9>[K_30]>(key2: K2_65) => void;
|
|
433
|
-
entries: () => [string, unknown][];
|
|
434
|
-
clear: () => void;
|
|
435
|
-
};
|
|
436
|
-
getStore: <K_31 extends keyof T2_9>(key: K_31) => T2_9[K_31];
|
|
437
|
-
setStore: <K_32 extends keyof T2_9>(key: K_32, v: T2_9[K_32]) => void;
|
|
438
|
-
setParentCtx: (parentCtx: unknown) => void;
|
|
439
|
-
hasParentCtx: () => boolean;
|
|
440
|
-
getParentCtx: <T2_10 = T2_9>() => any;
|
|
441
|
-
};
|
|
442
|
-
};
|
|
443
|
-
};
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
};
|
|
450
|
-
};
|
|
451
|
-
};
|
|
72
|
+
declare function useCliContext<T extends TEmpty>(): _wooksjs_event_core.TCtxHelpers<TCliContextStore & T & _wooksjs_event_core.TGenericContextStore<TCliEventData>>;
|
|
452
73
|
|
|
453
74
|
export { type TCliContextStore, type TCliEventData, type TCliHelpCustom, type TCliHelpRenderer, type TWooksCliEntry, type TWooksCliOptions, WooksCli, cliShortcuts, createCliApp, createCliContext, useAutoHelp, useCliContext, useCliHelp, useCliOption, useCliOptions, useCommandLookupHelp };
|