@optique/run 1.0.0-dev.584 → 1.0.0-dev.586

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 CHANGED
@@ -227,6 +227,7 @@ interface RunOptions {
227
227
  readonly contexts?: readonly SourceContext<unknown>[];
228
228
  }
229
229
  type RejectEmptyContexts<TContexts extends readonly SourceContext<unknown>[]> = TContexts extends readonly [] ? never : unknown;
230
+ type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext<unknown>[]];
230
231
  type RejectContextfulOptions<TOptions> = TOptions extends {
231
232
  readonly contexts?: infer TContexts extends readonly SourceContext<unknown>[] | undefined;
232
233
  } ? [TContexts] extends [undefined | readonly []] ? unknown : never : unknown;
@@ -297,9 +298,12 @@ type AcceptExactRunOptions<TOptions> = [TOptions] extends [RunOptions] ? [RunOpt
297
298
  *
298
299
  * @since 0.11.0 Added support for {@link Program} objects.
299
300
  */
301
+ declare function run<T extends Parser<Mode, unknown, unknown>, const TContexts extends NonEmptySourceContexts>(parser: T, options: RunOptions & {
302
+ readonly contexts: TContexts;
303
+ } & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
300
304
  declare function run<T extends Parser<Mode, unknown, unknown>, const TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
301
305
  readonly contexts: TContexts;
302
- } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
306
+ } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, InferValue<T>>): ModeValue<InferMode<T>, InferValue<T>> | Promise<InferValue<T>>;
303
307
  declare function run<M extends Mode, T, const TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
304
308
  readonly contexts: TContexts;
305
309
  } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, T>): Promise<T>;
package/dist/run.d.ts CHANGED
@@ -227,6 +227,7 @@ interface RunOptions {
227
227
  readonly contexts?: readonly SourceContext<unknown>[];
228
228
  }
229
229
  type RejectEmptyContexts<TContexts extends readonly SourceContext<unknown>[]> = TContexts extends readonly [] ? never : unknown;
230
+ type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext<unknown>[]];
230
231
  type RejectContextfulOptions<TOptions> = TOptions extends {
231
232
  readonly contexts?: infer TContexts extends readonly SourceContext<unknown>[] | undefined;
232
233
  } ? [TContexts] extends [undefined | readonly []] ? unknown : never : unknown;
@@ -297,9 +298,12 @@ type AcceptExactRunOptions<TOptions> = [TOptions] extends [RunOptions] ? [RunOpt
297
298
  *
298
299
  * @since 0.11.0 Added support for {@link Program} objects.
299
300
  */
301
+ declare function run<T extends Parser<Mode, unknown, unknown>, const TContexts extends NonEmptySourceContexts>(parser: T, options: RunOptions & {
302
+ readonly contexts: TContexts;
303
+ } & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
300
304
  declare function run<T extends Parser<Mode, unknown, unknown>, const TContexts extends readonly SourceContext<unknown>[]>(parser: T, options: RunOptions & {
301
305
  readonly contexts: TContexts;
302
- } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, InferValue<T>>): Promise<InferValue<T>>;
306
+ } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, InferValue<T>>): ModeValue<InferMode<T>, InferValue<T>> | Promise<InferValue<T>>;
303
307
  declare function run<M extends Mode, T, const TContexts extends readonly SourceContext<unknown>[]>(program: Program<M, T>, options: RunOptions & {
304
308
  readonly contexts: TContexts;
305
309
  } & RejectEmptyContexts<TContexts> & ExtractRequiredOptions<TContexts, T>): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/run",
3
- "version": "1.0.0-dev.584+e5bde834",
3
+ "version": "1.0.0-dev.586+a66615c7",
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.584+e5bde834"
73
+ "@optique/core": "1.0.0-dev.586+a66615c7"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^20.19.9",