@optique/core 1.0.0-dev.515 → 1.0.0-dev.517

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.
@@ -849,40 +849,40 @@ type LongestMatchArityGuard<TParsers extends readonly unknown[]> = IsTuple<TPars
849
849
  declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
850
850
  /**
851
851
  * Creates a parser that selects the successful branch that consumed
852
- * the most input tokens.
852
+ * the most input tokens, with custom error options.
853
853
  *
854
854
  * The resulting parser tries every given parser and returns the
855
855
  * successful result that consumed more input than the others.
856
856
  *
857
- * @param parsers Parsers to evaluate and compare by consumed input.
857
+ * @param rest Parsers to compare, followed by error customization options.
858
858
  * @returns A parser that yields the best successful branch result.
859
859
  * Type inference is precise for tuple calls up to 15 parser arguments.
860
- * @since 0.3.0
860
+ * @since 0.5.0
861
861
  */
862
- declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
862
+ declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
863
863
  /**
864
864
  * Creates a parser that selects the successful branch that consumed
865
865
  * the most input tokens, with custom error options.
866
866
  *
867
- * The resulting parser tries every given parser and returns the
868
- * successful result that consumed more input than the others.
869
- *
870
867
  * @param rest Parsers to compare, followed by error customization options.
871
868
  * @returns A parser that yields the best successful branch result.
872
869
  * Type inference is precise for tuple calls up to 15 parser arguments.
873
870
  * @since 0.5.0
874
871
  */
875
- declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
872
+ declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
876
873
  /**
877
874
  * Creates a parser that selects the successful branch that consumed
878
- * the most input tokens, with custom error options.
875
+ * the most input tokens.
879
876
  *
880
- * @param rest Parsers to compare, followed by error customization options.
877
+ * The resulting parser tries every given parser and returns the
878
+ * successful result that consumed more input than the others.
879
+ *
880
+ * @param parsers Parsers to evaluate and compare by consumed input.
881
881
  * @returns A parser that yields the best successful branch result.
882
882
  * Type inference is precise for tuple calls up to 15 parser arguments.
883
- * @since 0.5.0
883
+ * @since 0.3.0
884
884
  */
885
- declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
885
+ declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
886
886
  /**
887
887
  * Options for the {@link object} parser.
888
888
  * @since 0.5.0
@@ -1097,18 +1097,6 @@ type EnsureMergeParsers<TParsers extends MergeParsers> = { readonly [K in keyof
1097
1097
  type IntersectMergeValues<TParsers extends MergeParsers> = TParsers extends readonly [infer THead extends Parser<Mode, unknown, unknown>, ...infer TRest extends MergeParsers] ? ExtractObjectTypes<THead> & IntersectMergeValues<TRest> : unknown;
1098
1098
  type MergeValues<TParsers extends MergeParsers> = IsTuple<TParsers> extends true ? IntersectMergeValues<TParsers> : Record<string | symbol, unknown>;
1099
1099
  type MergeReturnType<TParsers extends MergeParsers> = Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, MergeValues<TParsers>, Record<string | symbol, unknown>>;
1100
- /**
1101
- * Merges multiple object-like parsers into one parser.
1102
- *
1103
- * This is useful for combining separate object parsers into one
1104
- * unified parser while keeping fields grouped by parser boundaries.
1105
- *
1106
- * @param parsers Parsers to merge in declaration order.
1107
- * @returns A parser that merges parsed object fields from all parsers.
1108
- * Type inference is precise for tuple calls up to 15 parser arguments.
1109
- * @since 0.4.0
1110
- */
1111
- declare function merge<const TParsers extends MergeParsers>(...parsers: EnsureMergeParsers<TParsers> & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1112
1100
  /**
1113
1101
  * Merges multiple object-like parsers into one parser, with options.
1114
1102
  *
@@ -1147,6 +1135,18 @@ declare function merge<const TParsers extends MergeParsers>(label: string, ...pa
1147
1135
  * @since 0.7.0
1148
1136
  */
1149
1137
  declare function merge<const TParsers extends MergeParsers>(label: string, ...rest: [...parsers: EnsureMergeParsers<TParsers>, options: MergeTailOptions] & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1138
+ /**
1139
+ * Merges multiple object-like parsers into one parser.
1140
+ *
1141
+ * This is useful for combining separate object parsers into one
1142
+ * unified parser while keeping fields grouped by parser boundaries.
1143
+ *
1144
+ * @param parsers Parsers to merge in declaration order.
1145
+ * @returns A parser that merges parsed object fields from all parsers.
1146
+ * Type inference is precise for tuple calls up to 15 parser arguments.
1147
+ * @since 0.4.0
1148
+ */
1149
+ declare function merge<const TParsers extends MergeParsers>(...parsers: EnsureMergeParsers<TParsers> & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1150
1150
  type ConcatParserArity = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1151
1151
  type ConcatArityLimitError = {
1152
1152
  readonly __optiqueConcatArityLimit: "concat() requires between 1 and 15 parser arguments. Nest concat() to combine more.";
@@ -849,40 +849,40 @@ type LongestMatchArityGuard<TParsers extends readonly unknown[]> = IsTuple<TPars
849
849
  declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
850
850
  /**
851
851
  * Creates a parser that selects the successful branch that consumed
852
- * the most input tokens.
852
+ * the most input tokens, with custom error options.
853
853
  *
854
854
  * The resulting parser tries every given parser and returns the
855
855
  * successful result that consumed more input than the others.
856
856
  *
857
- * @param parsers Parsers to evaluate and compare by consumed input.
857
+ * @param rest Parsers to compare, followed by error customization options.
858
858
  * @returns A parser that yields the best successful branch result.
859
859
  * Type inference is precise for tuple calls up to 15 parser arguments.
860
- * @since 0.3.0
860
+ * @since 0.5.0
861
861
  */
862
- declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
862
+ declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
863
863
  /**
864
864
  * Creates a parser that selects the successful branch that consumed
865
865
  * the most input tokens, with custom error options.
866
866
  *
867
- * The resulting parser tries every given parser and returns the
868
- * successful result that consumed more input than the others.
869
- *
870
867
  * @param rest Parsers to compare, followed by error customization options.
871
868
  * @returns A parser that yields the best successful branch result.
872
869
  * Type inference is precise for tuple calls up to 15 parser arguments.
873
870
  * @since 0.5.0
874
871
  */
875
- declare function longestMatch<const TParsers extends readonly Parser<"sync", unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<"sync", InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
872
+ declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
876
873
  /**
877
874
  * Creates a parser that selects the successful branch that consumed
878
- * the most input tokens, with custom error options.
875
+ * the most input tokens.
879
876
  *
880
- * @param rest Parsers to compare, followed by error customization options.
877
+ * The resulting parser tries every given parser and returns the
878
+ * successful result that consumed more input than the others.
879
+ *
880
+ * @param parsers Parsers to evaluate and compare by consumed input.
881
881
  * @returns A parser that yields the best successful branch result.
882
882
  * Type inference is precise for tuple calls up to 15 parser arguments.
883
- * @since 0.5.0
883
+ * @since 0.3.0
884
884
  */
885
- declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...rest: [...parsers: TParsers, options: LongestMatchTailOptions] & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
885
+ declare function longestMatch<const TParsers extends readonly Parser<Mode, unknown, unknown>[]>(...parsers: TParsers & LongestMatchArityGuard<TParsers>): Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, InferValue<TParsers[number]>, LongestMatchState<TParsers>>;
886
886
  /**
887
887
  * Options for the {@link object} parser.
888
888
  * @since 0.5.0
@@ -1097,18 +1097,6 @@ type EnsureMergeParsers<TParsers extends MergeParsers> = { readonly [K in keyof
1097
1097
  type IntersectMergeValues<TParsers extends MergeParsers> = TParsers extends readonly [infer THead extends Parser<Mode, unknown, unknown>, ...infer TRest extends MergeParsers] ? ExtractObjectTypes<THead> & IntersectMergeValues<TRest> : unknown;
1098
1098
  type MergeValues<TParsers extends MergeParsers> = IsTuple<TParsers> extends true ? IntersectMergeValues<TParsers> : Record<string | symbol, unknown>;
1099
1099
  type MergeReturnType<TParsers extends MergeParsers> = Parser<CombineModes<{ readonly [K in keyof TParsers]: ExtractMode<TParsers[K]> }>, MergeValues<TParsers>, Record<string | symbol, unknown>>;
1100
- /**
1101
- * Merges multiple object-like parsers into one parser.
1102
- *
1103
- * This is useful for combining separate object parsers into one
1104
- * unified parser while keeping fields grouped by parser boundaries.
1105
- *
1106
- * @param parsers Parsers to merge in declaration order.
1107
- * @returns A parser that merges parsed object fields from all parsers.
1108
- * Type inference is precise for tuple calls up to 15 parser arguments.
1109
- * @since 0.4.0
1110
- */
1111
- declare function merge<const TParsers extends MergeParsers>(...parsers: EnsureMergeParsers<TParsers> & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1112
1100
  /**
1113
1101
  * Merges multiple object-like parsers into one parser, with options.
1114
1102
  *
@@ -1147,6 +1135,18 @@ declare function merge<const TParsers extends MergeParsers>(label: string, ...pa
1147
1135
  * @since 0.7.0
1148
1136
  */
1149
1137
  declare function merge<const TParsers extends MergeParsers>(label: string, ...rest: [...parsers: EnsureMergeParsers<TParsers>, options: MergeTailOptions] & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1138
+ /**
1139
+ * Merges multiple object-like parsers into one parser.
1140
+ *
1141
+ * This is useful for combining separate object parsers into one
1142
+ * unified parser while keeping fields grouped by parser boundaries.
1143
+ *
1144
+ * @param parsers Parsers to merge in declaration order.
1145
+ * @returns A parser that merges parsed object fields from all parsers.
1146
+ * Type inference is precise for tuple calls up to 15 parser arguments.
1147
+ * @since 0.4.0
1148
+ */
1149
+ declare function merge<const TParsers extends MergeParsers>(...parsers: EnsureMergeParsers<TParsers> & MergeArityGuard<TParsers>): MergeReturnType<TParsers>;
1150
1150
  type ConcatParserArity = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
1151
1151
  type ConcatArityLimitError = {
1152
1152
  readonly __optiqueConcatArityLimit: "concat() requires between 1 and 15 parser arguments. Nest concat() to combine more.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.515+abdd200c",
3
+ "version": "1.0.0-dev.517+e46c5180",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",