@optique/run 1.0.0-dev.592 → 1.0.0-dev.596
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 +8 -1
- package/dist/run.d.ts +8 -1
- package/package.json +2 -2
package/dist/run.d.cts
CHANGED
|
@@ -228,7 +228,7 @@ interface RunOptions {
|
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Rejects context tuples that are statically known to be empty so those calls
|
|
231
|
-
* fall back to the
|
|
231
|
+
* fall back to the no-context overloads.
|
|
232
232
|
*/
|
|
233
233
|
type RejectEmptyContexts<TContexts extends readonly SourceContext<unknown>[]> = TContexts extends readonly [] ? never : unknown;
|
|
234
234
|
/**
|
|
@@ -255,6 +255,11 @@ type RejectUnknownRunOptionKeys<TOptions> = [TOptions] extends [undefined] ? unk
|
|
|
255
255
|
* conservative fallback overloads because they may hide context presence.
|
|
256
256
|
*/
|
|
257
257
|
type AcceptExactRunOptions<TOptions> = [TOptions] extends [RunOptions] ? [RunOptions] extends [TOptions] ? unknown : never : never;
|
|
258
|
+
/**
|
|
259
|
+
* Accepts only values typed exactly as `RunOptions | undefined`, which model
|
|
260
|
+
* optional forwarding wrappers without widening generic Program overloads.
|
|
261
|
+
*/
|
|
262
|
+
type AcceptExactOptionalRunOptions<TOptions> = [TOptions] extends [RunOptions | undefined] ? [RunOptions | undefined] extends [TOptions] ? unknown : never : never;
|
|
258
263
|
/**
|
|
259
264
|
* Runs a command-line parser with automatic process integration.
|
|
260
265
|
*
|
|
@@ -363,6 +368,7 @@ declare function runSync<T, const TContexts extends readonly SourceContext<unkno
|
|
|
363
368
|
} & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, T>): T;
|
|
364
369
|
declare function runSync<T, const TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): T;
|
|
365
370
|
declare function runSync<T, TOptions extends RunOptions>(program: Program<"sync", T>, options: TOptions & AcceptExactRunOptions<TOptions>): T;
|
|
371
|
+
declare function runSync<T, TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options: TOptions & AcceptExactOptionalRunOptions<TOptions>): T;
|
|
366
372
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
367
373
|
/**
|
|
368
374
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -386,6 +392,7 @@ declare function runAsync<M extends Mode, T, const TContexts extends readonly So
|
|
|
386
392
|
declare function runAsync<T, const TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): Promise<T>;
|
|
387
393
|
declare function runAsync<T, const TOptions extends RunOptions | undefined>(program: Program<"async", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): Promise<T>;
|
|
388
394
|
declare function runAsync<T, TOptions extends RunOptions>(program: Program<Mode, T>, options: TOptions & AcceptExactRunOptions<TOptions>): Promise<T>;
|
|
395
|
+
declare function runAsync<T, TOptions extends RunOptions | undefined>(program: Program<Mode, T>, options: TOptions & AcceptExactOptionalRunOptions<TOptions>): Promise<T>;
|
|
389
396
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
390
397
|
//#endregion
|
|
391
398
|
export { RunOptions, run, runAsync, runSync };
|
package/dist/run.d.ts
CHANGED
|
@@ -228,7 +228,7 @@ interface RunOptions {
|
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Rejects context tuples that are statically known to be empty so those calls
|
|
231
|
-
* fall back to the
|
|
231
|
+
* fall back to the no-context overloads.
|
|
232
232
|
*/
|
|
233
233
|
type RejectEmptyContexts<TContexts extends readonly SourceContext<unknown>[]> = TContexts extends readonly [] ? never : unknown;
|
|
234
234
|
/**
|
|
@@ -255,6 +255,11 @@ type RejectUnknownRunOptionKeys<TOptions> = [TOptions] extends [undefined] ? unk
|
|
|
255
255
|
* conservative fallback overloads because they may hide context presence.
|
|
256
256
|
*/
|
|
257
257
|
type AcceptExactRunOptions<TOptions> = [TOptions] extends [RunOptions] ? [RunOptions] extends [TOptions] ? unknown : never : never;
|
|
258
|
+
/**
|
|
259
|
+
* Accepts only values typed exactly as `RunOptions | undefined`, which model
|
|
260
|
+
* optional forwarding wrappers without widening generic Program overloads.
|
|
261
|
+
*/
|
|
262
|
+
type AcceptExactOptionalRunOptions<TOptions> = [TOptions] extends [RunOptions | undefined] ? [RunOptions | undefined] extends [TOptions] ? unknown : never : never;
|
|
258
263
|
/**
|
|
259
264
|
* Runs a command-line parser with automatic process integration.
|
|
260
265
|
*
|
|
@@ -363,6 +368,7 @@ declare function runSync<T, const TContexts extends readonly SourceContext<unkno
|
|
|
363
368
|
} & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, T>): T;
|
|
364
369
|
declare function runSync<T, const TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): T;
|
|
365
370
|
declare function runSync<T, TOptions extends RunOptions>(program: Program<"sync", T>, options: TOptions & AcceptExactRunOptions<TOptions>): T;
|
|
371
|
+
declare function runSync<T, TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options: TOptions & AcceptExactOptionalRunOptions<TOptions>): T;
|
|
366
372
|
declare function runSync<T extends Parser<"sync", unknown, unknown>>(parser: T, options?: RunOptions): InferValue<T>;
|
|
367
373
|
/**
|
|
368
374
|
* Runs an asynchronous command-line parser with automatic process integration.
|
|
@@ -386,6 +392,7 @@ declare function runAsync<M extends Mode, T, const TContexts extends readonly So
|
|
|
386
392
|
declare function runAsync<T, const TOptions extends RunOptions | undefined>(program: Program<"sync", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): Promise<T>;
|
|
387
393
|
declare function runAsync<T, const TOptions extends RunOptions | undefined>(program: Program<"async", T>, options?: TOptions & RejectContextfulOptions<TOptions> & RejectUnknownRunOptionKeys<TOptions>): Promise<T>;
|
|
388
394
|
declare function runAsync<T, TOptions extends RunOptions>(program: Program<Mode, T>, options: TOptions & AcceptExactRunOptions<TOptions>): Promise<T>;
|
|
395
|
+
declare function runAsync<T, TOptions extends RunOptions | undefined>(program: Program<Mode, T>, options: TOptions & AcceptExactOptionalRunOptions<TOptions>): Promise<T>;
|
|
389
396
|
declare function runAsync<T extends Parser<Mode, unknown, unknown>>(parser: T, options?: RunOptions): Promise<InferValue<T>>;
|
|
390
397
|
//#endregion
|
|
391
398
|
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.596+30063a22",
|
|
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.596+30063a22"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|