@optique/run 1.0.0-dev.571 → 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 +18 -5
- package/dist/run.d.ts +18 -5
- 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,8 +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<T>(program: Program<
|
|
298
|
-
|
|
301
|
+
declare function run<M extends Mode, T, TContexts extends NonEmptySourceContexts>(program: Program<M, T>, options: RunOptions & {
|
|
302
|
+
readonly contexts: TContexts;
|
|
303
|
+
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
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>;
|
|
299
306
|
declare function run<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
300
307
|
declare function run<T extends Parser<"async", unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
301
308
|
declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): ModeValue<InferMode<T>, InferValue<T>>;
|
|
@@ -315,7 +322,10 @@ declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, option
|
|
|
315
322
|
declare function runSync<T extends Parser<"sync", unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
316
323
|
readonly contexts: TContexts;
|
|
317
324
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): InferValue<T>;
|
|
318
|
-
declare function runSync<T>(program: Program<"sync", T>, options
|
|
325
|
+
declare function runSync<T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<"sync", T>, options: RunOptions & {
|
|
326
|
+
readonly contexts: TContexts;
|
|
327
|
+
} & ExtractRequiredOptions<TContexts, T>): T;
|
|
328
|
+
declare function runSync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
319
329
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
320
330
|
/**
|
|
321
331
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -333,8 +343,11 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T,
|
|
|
333
343
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
334
344
|
readonly contexts: TContexts;
|
|
335
345
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
|
|
336
|
-
declare function runAsync<T>(program: Program<
|
|
337
|
-
|
|
346
|
+
declare function runAsync<M extends Mode, T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
|
|
347
|
+
readonly contexts: TContexts;
|
|
348
|
+
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
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>;
|
|
338
351
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
339
352
|
//#endregion
|
|
340
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,8 +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<T>(program: Program<
|
|
298
|
-
|
|
301
|
+
declare function run<M extends Mode, T, TContexts extends NonEmptySourceContexts>(program: Program<M, T>, options: RunOptions & {
|
|
302
|
+
readonly contexts: TContexts;
|
|
303
|
+
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
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>;
|
|
299
306
|
declare function run<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
300
307
|
declare function run<T extends Parser<"async", unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
301
308
|
declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): ModeValue<InferMode<T>, InferValue<T>>;
|
|
@@ -315,7 +322,10 @@ declare function run<T extends Parser<Mode, unknown, unknown>>(parser: T, option
|
|
|
315
322
|
declare function runSync<T extends Parser<"sync", unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
316
323
|
readonly contexts: TContexts;
|
|
317
324
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): InferValue<T>;
|
|
318
|
-
declare function runSync<T>(program: Program<"sync", T>, options
|
|
325
|
+
declare function runSync<T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<"sync", T>, options: RunOptions & {
|
|
326
|
+
readonly contexts: TContexts;
|
|
327
|
+
} & ExtractRequiredOptions<TContexts, T>): T;
|
|
328
|
+
declare function runSync<T>(program: Program<"sync", T>, options?: RunOptionsWithoutContexts): T;
|
|
319
329
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
320
330
|
/**
|
|
321
331
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -333,8 +343,11 @@ declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T,
|
|
|
333
343
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>, TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
|
|
334
344
|
readonly contexts: TContexts;
|
|
335
345
|
} & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
|
|
336
|
-
declare function runAsync<T>(program: Program<
|
|
337
|
-
|
|
346
|
+
declare function runAsync<M extends Mode, T, TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
|
|
347
|
+
readonly contexts: TContexts;
|
|
348
|
+
} & ExtractRequiredOptions<TContexts, T>): Promise<T>;
|
|
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>;
|
|
338
351
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
339
352
|
//#endregion
|
|
340
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",
|