@optique/run 1.0.0-dev.572 → 1.0.0-dev.574
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/dist/run.d.cts +10 -6
- package/dist/run.d.ts +10 -6
- package/package.json +2 -2
package/dist/run.d.cts
CHANGED
|
@@ -226,6 +226,10 @@ interface RunOptions {
|
|
|
226
226
|
*/
|
|
227
227
|
readonly contexts?: readonly SourceContext<unknown>[];
|
|
228
228
|
}
|
|
229
|
+
type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext<unknown>[]];
|
|
230
|
+
type RunOptionsWithoutContexts = RunOptions & {
|
|
231
|
+
readonly contexts?: readonly [] | undefined;
|
|
232
|
+
};
|
|
229
233
|
/**
|
|
230
234
|
* Runs a command-line parser with automatic process integration.
|
|
231
235
|
*
|
|
@@ -294,11 +298,11 @@ interface RunOptions {
|
|
|
294
298
|
declare function run<T extends Parser<Mode, unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
295
299
|
readonly contexts: TContexts;
|
|
296
300
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
|
|
297
|
-
declare function run<M extends Mode, T, TContexts extends
|
|
301
|
+
declare function run<M extends Mode, T, TContexts extends NonEmptySourceContexts>(program: Program<M, T>, options: RunOptions & {
|
|
298
302
|
readonly contexts: TContexts;
|
|
299
303
|
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
300
|
-
declare function run<T>(program: Program<"sync", T>, options?:
|
|
301
|
-
declare function run<T>(program: Program<"async", T>, options?:
|
|
304
|
+
declare function run<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
305
|
+
declare function run<T>(program: Program<"async", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
302
306
|
declare function run<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
303
307
|
declare function run<T extends Parser<"async", unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
304
308
|
declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): ModeValue<InferMode<T>, InferValue<T>>;
|
|
@@ -321,7 +325,7 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>, TContexts e
|
|
|
321
325
|
declare function runSync<T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<"sync", T>, options: RunOptions & {
|
|
322
326
|
readonly contexts: TContexts;
|
|
323
327
|
} & ExtractRequiredOptions<TContexts, T>): T;
|
|
324
|
-
declare function runSync<T>(program: Program<"sync", T>, options?:
|
|
328
|
+
declare function runSync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
325
329
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
326
330
|
/**
|
|
327
331
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -342,8 +346,8 @@ declare function runAsync<T extends Parser<Mode, unknown, unknown>, TContexts ex
|
|
|
342
346
|
declare function runAsync<M extends Mode, T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
|
|
343
347
|
readonly contexts: TContexts;
|
|
344
348
|
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
345
|
-
declare function runAsync<T>(program: Program<"sync", T>, options?:
|
|
346
|
-
declare function runAsync<T>(program: Program<"async", T>, options?:
|
|
349
|
+
declare function runAsync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
350
|
+
declare function runAsync<T>(program: Program<"async", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
347
351
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
348
352
|
//#endregion
|
|
349
353
|
export { RunOptions, run, runAsync, runSync };
|
package/dist/run.d.ts
CHANGED
|
@@ -226,6 +226,10 @@ interface RunOptions {
|
|
|
226
226
|
*/
|
|
227
227
|
readonly contexts?: readonly SourceContext<unknown>[];
|
|
228
228
|
}
|
|
229
|
+
type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext<unknown>[]];
|
|
230
|
+
type RunOptionsWithoutContexts = RunOptions & {
|
|
231
|
+
readonly contexts?: readonly [] | undefined;
|
|
232
|
+
};
|
|
229
233
|
/**
|
|
230
234
|
* Runs a command-line parser with automatic process integration.
|
|
231
235
|
*
|
|
@@ -294,11 +298,11 @@ interface RunOptions {
|
|
|
294
298
|
declare function run<T extends Parser<Mode, unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
295
299
|
readonly contexts: TContexts;
|
|
296
300
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
|
|
297
|
-
declare function run<M extends Mode, T, TContexts extends
|
|
301
|
+
declare function run<M extends Mode, T, TContexts extends NonEmptySourceContexts>(program: Program<M, T>, options: RunOptions & {
|
|
298
302
|
readonly contexts: TContexts;
|
|
299
303
|
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
300
|
-
declare function run<T>(program: Program<"sync", T>, options?:
|
|
301
|
-
declare function run<T>(program: Program<"async", T>, options?:
|
|
304
|
+
declare function run<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
305
|
+
declare function run<T>(program: Program<"async", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
302
306
|
declare function run<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
303
307
|
declare function run<T extends Parser<"async", unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
304
308
|
declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): ModeValue<InferMode<T>, InferValue<T>>;
|
|
@@ -321,7 +325,7 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>, TContexts e
|
|
|
321
325
|
declare function runSync<T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<"sync", T>, options: RunOptions & {
|
|
322
326
|
readonly contexts: TContexts;
|
|
323
327
|
} & ExtractRequiredOptions<TContexts, T>): T;
|
|
324
|
-
declare function runSync<T>(program: Program<"sync", T>, options?:
|
|
328
|
+
declare function runSync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
325
329
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
326
330
|
/**
|
|
327
331
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -342,8 +346,8 @@ declare function runAsync<T extends Parser<Mode, unknown, unknown>, TContexts ex
|
|
|
342
346
|
declare function runAsync<M extends Mode, T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
|
|
343
347
|
readonly contexts: TContexts;
|
|
344
348
|
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
345
|
-
declare function runAsync<T>(program: Program<"sync", T>, options?:
|
|
346
|
-
declare function runAsync<T>(program: Program<"async", T>, options?:
|
|
349
|
+
declare function runAsync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
350
|
+
declare function runAsync<T>(program: Program<"async", T>, options?: RunOptionsWithoutContexts): Promise<T>;
|
|
347
351
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
348
352
|
//#endregion
|
|
349
353
|
export { RunOptions, run, runAsync, runSync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/run",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.574+619839f3",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@optique/core": "1.0.0-dev.
|
|
73
|
+
"@optique/core": "1.0.0-dev.574+619839f3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|