@optique/core 0.10.0-dev.291 → 0.10.0-dev.292
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/constructs.cjs +71 -2
- package/dist/constructs.js +71 -2
- package/dist/dependency.cjs +383 -0
- package/dist/dependency.d.cts +457 -0
- package/dist/dependency.d.ts +457 -0
- package/dist/dependency.js +367 -0
- package/dist/facade.cjs +1 -1
- package/dist/facade.js +1 -1
- package/dist/index.cjs +18 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -2
- package/dist/parser.d.cts +3 -3
- package/dist/parser.d.ts +3 -3
- package/dist/primitives.cjs +60 -12
- package/dist/primitives.d.cts +8 -2
- package/dist/primitives.d.ts +8 -2
- package/dist/primitives.js +60 -12
- package/package.json +9 -1
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
//#region src/dependency.ts
|
|
2
|
+
/**
|
|
3
|
+
* A unique symbol used to identify dependency sources at compile time.
|
|
4
|
+
* This marker is used to distinguish {@link DependencySource} from regular
|
|
5
|
+
* {@link ValueParser} instances.
|
|
6
|
+
* @since 0.10.0
|
|
7
|
+
*/
|
|
8
|
+
const DependencySourceMarker = Symbol.for("@optique/core/dependency/DependencySourceMarker");
|
|
9
|
+
/**
|
|
10
|
+
* A unique symbol used to identify derived value parsers at compile time.
|
|
11
|
+
* This marker is used to distinguish {@link DerivedValueParser} from regular
|
|
12
|
+
* {@link ValueParser} instances.
|
|
13
|
+
* @since 0.10.0
|
|
14
|
+
*/
|
|
15
|
+
const DerivedValueParserMarker = Symbol.for("@optique/core/dependency/DerivedValueParserMarker");
|
|
16
|
+
/**
|
|
17
|
+
* A unique symbol used to store the dependency ID on value parsers.
|
|
18
|
+
* @since 0.10.0
|
|
19
|
+
*/
|
|
20
|
+
const DependencyId = Symbol.for("@optique/core/dependency/DependencyId");
|
|
21
|
+
/**
|
|
22
|
+
* A unique symbol used to access the parseWithDependency method on derived parsers.
|
|
23
|
+
* @since 0.10.0
|
|
24
|
+
*/
|
|
25
|
+
const ParseWithDependency = Symbol.for("@optique/core/dependency/ParseWithDependency");
|
|
26
|
+
/**
|
|
27
|
+
* Creates a dependency source from a {@link ValueParser}.
|
|
28
|
+
*
|
|
29
|
+
* A dependency source wraps an existing value parser and enables creating
|
|
30
|
+
* derived parsers that depend on the parsed value. This is useful for
|
|
31
|
+
* scenarios where one option's valid values depend on another option's value.
|
|
32
|
+
*
|
|
33
|
+
* @template M The execution mode of the value parser.
|
|
34
|
+
* @template T The type of value the parser produces.
|
|
35
|
+
* @param parser The value parser to wrap as a dependency source.
|
|
36
|
+
* @returns A {@link DependencySource} that can be used to create
|
|
37
|
+
* derived parsers.
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import { dependency } from "@optique/core/dependency";
|
|
41
|
+
* import { string } from "@optique/core/valueparser";
|
|
42
|
+
*
|
|
43
|
+
* // Create a dependency source for a directory path
|
|
44
|
+
* const cwdParser = dependency(string({ metavar: "DIR" }));
|
|
45
|
+
*
|
|
46
|
+
* // Create a derived parser that depends on the directory
|
|
47
|
+
* const branchParser = cwdParser.derive({
|
|
48
|
+
* metavar: "BRANCH",
|
|
49
|
+
* factory: (dir) => gitBranch({ dir }),
|
|
50
|
+
* defaultValue: () => process.cwd(),
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
* @since 0.10.0
|
|
54
|
+
*/
|
|
55
|
+
function dependency(parser) {
|
|
56
|
+
const id = Symbol();
|
|
57
|
+
return {
|
|
58
|
+
...parser,
|
|
59
|
+
[DependencySourceMarker]: true,
|
|
60
|
+
[DependencyId]: id,
|
|
61
|
+
derive(options) {
|
|
62
|
+
return createDerivedValueParser(id, parser, options);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Checks if a value parser is a {@link DependencySource}.
|
|
68
|
+
*
|
|
69
|
+
* @param parser The value parser to check.
|
|
70
|
+
* @returns `true` if the parser is a dependency source, `false` otherwise.
|
|
71
|
+
* @since 0.10.0
|
|
72
|
+
*/
|
|
73
|
+
function isDependencySource(parser) {
|
|
74
|
+
return DependencySourceMarker in parser && parser[DependencySourceMarker] === true;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a value parser is a {@link DerivedValueParser}.
|
|
78
|
+
*
|
|
79
|
+
* @param parser The value parser to check.
|
|
80
|
+
* @returns `true` if the parser is a derived value parser, `false` otherwise.
|
|
81
|
+
* @since 0.10.0
|
|
82
|
+
*/
|
|
83
|
+
function isDerivedValueParser(parser) {
|
|
84
|
+
return DerivedValueParserMarker in parser && parser[DerivedValueParserMarker] === true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Creates a derived value parser from multiple dependency sources.
|
|
88
|
+
*
|
|
89
|
+
* This function allows creating a parser whose behavior depends on
|
|
90
|
+
* multiple other parsers' values. This is useful for scenarios where
|
|
91
|
+
* an option's valid values depend on a combination of other options.
|
|
92
|
+
*
|
|
93
|
+
* @template Deps A tuple of DependencySource types.
|
|
94
|
+
* @template T The type of value the derived parser produces.
|
|
95
|
+
* @param options Configuration for the derived parser.
|
|
96
|
+
* @returns A {@link DerivedValueParser} that depends on the given sources.
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* import { dependency, deriveFrom } from "@optique/core/dependency";
|
|
100
|
+
* import { string, choice } from "@optique/core/valueparser";
|
|
101
|
+
*
|
|
102
|
+
* const dirParser = dependency(string({ metavar: "DIR" }));
|
|
103
|
+
* const modeParser = dependency(choice(["dev", "prod"]));
|
|
104
|
+
*
|
|
105
|
+
* const configParser = deriveFrom({
|
|
106
|
+
* metavar: "CONFIG",
|
|
107
|
+
* dependencies: [dirParser, modeParser] as const,
|
|
108
|
+
* factory: (dir, mode) =>
|
|
109
|
+
* choice(mode === "dev"
|
|
110
|
+
* ? [`${dir}/dev.json`, `${dir}/dev.yaml`]
|
|
111
|
+
* : [`${dir}/prod.json`, `${dir}/prod.yaml`]),
|
|
112
|
+
* defaultValues: () => ["/config", "dev"],
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
* @since 0.10.0
|
|
116
|
+
*/
|
|
117
|
+
function deriveFrom(options) {
|
|
118
|
+
const isAsync = options.dependencies.some((dep) => dep.$mode === "async");
|
|
119
|
+
const sourceId = options.dependencies.length > 0 ? options.dependencies[0][DependencyId] : Symbol();
|
|
120
|
+
if (isAsync) return createAsyncDerivedFromParser(sourceId, options);
|
|
121
|
+
return createSyncDerivedFromParser(sourceId, options);
|
|
122
|
+
}
|
|
123
|
+
function createSyncDerivedFromParser(sourceId, options) {
|
|
124
|
+
return {
|
|
125
|
+
$mode: "sync",
|
|
126
|
+
metavar: options.metavar,
|
|
127
|
+
[DerivedValueParserMarker]: true,
|
|
128
|
+
[DependencyId]: sourceId,
|
|
129
|
+
parse(input) {
|
|
130
|
+
const sourceValues = options.defaultValues();
|
|
131
|
+
const derivedParser = options.factory(...sourceValues);
|
|
132
|
+
return derivedParser.parse(input);
|
|
133
|
+
},
|
|
134
|
+
[ParseWithDependency](input, dependencyValue) {
|
|
135
|
+
const derivedParser = options.factory(...dependencyValue);
|
|
136
|
+
return derivedParser.parse(input);
|
|
137
|
+
},
|
|
138
|
+
format(value) {
|
|
139
|
+
const sourceValues = options.defaultValues();
|
|
140
|
+
const derivedParser = options.factory(...sourceValues);
|
|
141
|
+
return derivedParser.format(value);
|
|
142
|
+
},
|
|
143
|
+
*suggest(prefix) {
|
|
144
|
+
const sourceValues = options.defaultValues();
|
|
145
|
+
const derivedParser = options.factory(...sourceValues);
|
|
146
|
+
if (derivedParser.suggest) yield* derivedParser.suggest(prefix);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function createAsyncDerivedFromParser(sourceId, options) {
|
|
151
|
+
return {
|
|
152
|
+
$mode: "async",
|
|
153
|
+
metavar: options.metavar,
|
|
154
|
+
[DerivedValueParserMarker]: true,
|
|
155
|
+
[DependencyId]: sourceId,
|
|
156
|
+
parse(input) {
|
|
157
|
+
const sourceValues = options.defaultValues();
|
|
158
|
+
const derivedParser = options.factory(...sourceValues);
|
|
159
|
+
return Promise.resolve(derivedParser.parse(input));
|
|
160
|
+
},
|
|
161
|
+
[ParseWithDependency](input, dependencyValue) {
|
|
162
|
+
const derivedParser = options.factory(...dependencyValue);
|
|
163
|
+
return Promise.resolve(derivedParser.parse(input));
|
|
164
|
+
},
|
|
165
|
+
format(value) {
|
|
166
|
+
const sourceValues = options.defaultValues();
|
|
167
|
+
const derivedParser = options.factory(...sourceValues);
|
|
168
|
+
return derivedParser.format(value);
|
|
169
|
+
},
|
|
170
|
+
async *suggest(prefix) {
|
|
171
|
+
const sourceValues = options.defaultValues();
|
|
172
|
+
const derivedParser = options.factory(...sourceValues);
|
|
173
|
+
if (derivedParser.suggest) yield* derivedParser.suggest(prefix);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function createDerivedValueParser(sourceId, sourceParser, options) {
|
|
178
|
+
if (sourceParser.$mode === "async") return createAsyncDerivedParser(sourceId, options);
|
|
179
|
+
return createSyncDerivedParser(sourceId, options);
|
|
180
|
+
}
|
|
181
|
+
function createSyncDerivedParser(sourceId, options) {
|
|
182
|
+
return {
|
|
183
|
+
$mode: "sync",
|
|
184
|
+
metavar: options.metavar,
|
|
185
|
+
[DerivedValueParserMarker]: true,
|
|
186
|
+
[DependencyId]: sourceId,
|
|
187
|
+
parse(input) {
|
|
188
|
+
const sourceValue = options.defaultValue();
|
|
189
|
+
const derivedParser = options.factory(sourceValue);
|
|
190
|
+
return derivedParser.parse(input);
|
|
191
|
+
},
|
|
192
|
+
[ParseWithDependency](input, dependencyValue) {
|
|
193
|
+
const derivedParser = options.factory(dependencyValue);
|
|
194
|
+
return derivedParser.parse(input);
|
|
195
|
+
},
|
|
196
|
+
format(value) {
|
|
197
|
+
const sourceValue = options.defaultValue();
|
|
198
|
+
const derivedParser = options.factory(sourceValue);
|
|
199
|
+
return derivedParser.format(value);
|
|
200
|
+
},
|
|
201
|
+
*suggest(prefix) {
|
|
202
|
+
const sourceValue = options.defaultValue();
|
|
203
|
+
const derivedParser = options.factory(sourceValue);
|
|
204
|
+
if (derivedParser.suggest) yield* derivedParser.suggest(prefix);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function createAsyncDerivedParser(sourceId, options) {
|
|
209
|
+
return {
|
|
210
|
+
$mode: "async",
|
|
211
|
+
metavar: options.metavar,
|
|
212
|
+
[DerivedValueParserMarker]: true,
|
|
213
|
+
[DependencyId]: sourceId,
|
|
214
|
+
parse(input) {
|
|
215
|
+
const sourceValue = options.defaultValue();
|
|
216
|
+
const derivedParser = options.factory(sourceValue);
|
|
217
|
+
return Promise.resolve(derivedParser.parse(input));
|
|
218
|
+
},
|
|
219
|
+
[ParseWithDependency](input, dependencyValue) {
|
|
220
|
+
const derivedParser = options.factory(dependencyValue);
|
|
221
|
+
return Promise.resolve(derivedParser.parse(input));
|
|
222
|
+
},
|
|
223
|
+
format(value) {
|
|
224
|
+
const sourceValue = options.defaultValue();
|
|
225
|
+
const derivedParser = options.factory(sourceValue);
|
|
226
|
+
return derivedParser.format(value);
|
|
227
|
+
},
|
|
228
|
+
async *suggest(prefix) {
|
|
229
|
+
const sourceValue = options.defaultValue();
|
|
230
|
+
const derivedParser = options.factory(sourceValue);
|
|
231
|
+
if (derivedParser.suggest) yield* derivedParser.suggest(prefix);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* A unique symbol used to identify deferred parse states.
|
|
237
|
+
* @since 0.10.0
|
|
238
|
+
*/
|
|
239
|
+
const DeferredParseMarker = Symbol.for("@optique/core/dependency/DeferredParseMarker");
|
|
240
|
+
/**
|
|
241
|
+
* Checks if a value is a {@link DeferredParseState}.
|
|
242
|
+
*
|
|
243
|
+
* @param value The value to check.
|
|
244
|
+
* @returns `true` if the value is a deferred parse state, `false` otherwise.
|
|
245
|
+
* @since 0.10.0
|
|
246
|
+
*/
|
|
247
|
+
function isDeferredParseState(value) {
|
|
248
|
+
return typeof value === "object" && value !== null && DeferredParseMarker in value && value[DeferredParseMarker] === true;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Creates a deferred parse state for a DerivedValueParser.
|
|
252
|
+
*
|
|
253
|
+
* @template T The type of value the parser will produce.
|
|
254
|
+
* @template S The type of the source dependency value.
|
|
255
|
+
* @param rawInput The raw input string to be parsed.
|
|
256
|
+
* @param parser The DerivedValueParser that will parse the input.
|
|
257
|
+
* @param preliminaryResult The parse result using default dependency value.
|
|
258
|
+
* @returns A DeferredParseState object.
|
|
259
|
+
* @since 0.10.0
|
|
260
|
+
*/
|
|
261
|
+
function createDeferredParseState(rawInput, parser, preliminaryResult) {
|
|
262
|
+
return {
|
|
263
|
+
[DeferredParseMarker]: true,
|
|
264
|
+
rawInput,
|
|
265
|
+
parser,
|
|
266
|
+
dependencyId: parser[DependencyId],
|
|
267
|
+
preliminaryResult
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* A unique symbol used to identify dependency source parse states.
|
|
272
|
+
* @since 0.10.0
|
|
273
|
+
*/
|
|
274
|
+
const DependencySourceStateMarker = Symbol.for("@optique/core/dependency/DependencySourceStateMarker");
|
|
275
|
+
/**
|
|
276
|
+
* Checks if a value is a {@link DependencySourceState}.
|
|
277
|
+
*
|
|
278
|
+
* @param value The value to check.
|
|
279
|
+
* @returns `true` if the value is a dependency source state, `false` otherwise.
|
|
280
|
+
* @since 0.10.0
|
|
281
|
+
*/
|
|
282
|
+
function isDependencySourceState(value) {
|
|
283
|
+
return typeof value === "object" && value !== null && DependencySourceStateMarker in value && value[DependencySourceStateMarker] === true;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Creates a dependency source state from a parse result.
|
|
287
|
+
*
|
|
288
|
+
* @template T The type of value the state contains.
|
|
289
|
+
* @param result The parse result.
|
|
290
|
+
* @param dependencyId The dependency ID.
|
|
291
|
+
* @returns A DependencySourceState object.
|
|
292
|
+
* @since 0.10.0
|
|
293
|
+
*/
|
|
294
|
+
function createDependencySourceState(result, dependencyId) {
|
|
295
|
+
return {
|
|
296
|
+
[DependencySourceStateMarker]: true,
|
|
297
|
+
[DependencyId]: dependencyId,
|
|
298
|
+
result
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* A registry for storing resolved dependency values during parsing.
|
|
303
|
+
* This is used to pass dependency values from DependencySource options
|
|
304
|
+
* to DerivedValueParser options.
|
|
305
|
+
* @since 0.10.0
|
|
306
|
+
*/
|
|
307
|
+
var DependencyRegistry = class DependencyRegistry {
|
|
308
|
+
values = /* @__PURE__ */ new Map();
|
|
309
|
+
/**
|
|
310
|
+
* Registers a resolved dependency value.
|
|
311
|
+
* @param id The dependency ID.
|
|
312
|
+
* @param value The resolved value.
|
|
313
|
+
*/
|
|
314
|
+
set(id, value) {
|
|
315
|
+
this.values.set(id, value);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Gets a resolved dependency value.
|
|
319
|
+
* @param id The dependency ID.
|
|
320
|
+
* @returns The resolved value, or undefined if not found.
|
|
321
|
+
*/
|
|
322
|
+
get(id) {
|
|
323
|
+
return this.values.get(id);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Checks if a dependency has been resolved.
|
|
327
|
+
* @param id The dependency ID.
|
|
328
|
+
* @returns `true` if the dependency has been resolved.
|
|
329
|
+
*/
|
|
330
|
+
has(id) {
|
|
331
|
+
return this.values.has(id);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Creates a copy of the registry.
|
|
335
|
+
*/
|
|
336
|
+
clone() {
|
|
337
|
+
const copy = new DependencyRegistry();
|
|
338
|
+
for (const [id, value] of this.values) copy.values.set(id, value);
|
|
339
|
+
return copy;
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Formats a {@link DependencyError} into a human-readable {@link Message}.
|
|
344
|
+
*
|
|
345
|
+
* @param error The dependency error to format.
|
|
346
|
+
* @returns A Message describing the error.
|
|
347
|
+
* @since 0.10.0
|
|
348
|
+
*/
|
|
349
|
+
function formatDependencyError(error) {
|
|
350
|
+
switch (error.kind) {
|
|
351
|
+
case "duplicate": return [{
|
|
352
|
+
type: "text",
|
|
353
|
+
text: `Dependency used in multiple locations: ${error.locations.join(", ")}.`
|
|
354
|
+
}];
|
|
355
|
+
case "unresolved": return [{
|
|
356
|
+
type: "text",
|
|
357
|
+
text: `Unresolved dependency for ${error.derivedParserMetavar}: the dependency was not provided.`
|
|
358
|
+
}];
|
|
359
|
+
case "circular": return [{
|
|
360
|
+
type: "text",
|
|
361
|
+
text: `Circular dependency detected.`
|
|
362
|
+
}];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
export { DeferredParseMarker, DependencyId, DependencyRegistry, DependencySourceMarker, DependencySourceStateMarker, DerivedValueParserMarker, ParseWithDependency, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser };
|
package/dist/facade.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_message = require('./message.cjs');
|
|
2
|
+
const require_completion = require('./completion.cjs');
|
|
2
3
|
const require_usage = require('./usage.cjs');
|
|
3
4
|
const require_constructs = require('./constructs.cjs');
|
|
4
5
|
const require_doc = require('./doc.cjs');
|
|
5
|
-
const require_completion = require('./completion.cjs');
|
|
6
6
|
const require_modifiers = require('./modifiers.cjs');
|
|
7
7
|
const require_valueparser = require('./valueparser.cjs');
|
|
8
8
|
const require_primitives = require('./primitives.cjs');
|
package/dist/facade.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { commandLine, formatMessage, message, optionName, text, value } from "./message.js";
|
|
2
|
+
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
2
3
|
import { formatUsage } from "./usage.js";
|
|
3
4
|
import { longestMatch, object } from "./constructs.js";
|
|
4
5
|
import { formatDocPage } from "./doc.js";
|
|
5
|
-
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
6
6
|
import { multiple, optional, withDefault } from "./modifiers.js";
|
|
7
7
|
import { string } from "./valueparser.js";
|
|
8
8
|
import { argument, command, constant, flag, option } from "./primitives.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const require_message = require('./message.cjs');
|
|
2
|
+
const require_completion = require('./completion.cjs');
|
|
3
|
+
const require_dependency = require('./dependency.cjs');
|
|
2
4
|
const require_usage = require('./usage.cjs');
|
|
3
5
|
const require_constructs = require('./constructs.cjs');
|
|
4
6
|
const require_doc = require('./doc.cjs');
|
|
5
|
-
const require_completion = require('./completion.cjs');
|
|
6
7
|
const require_modifiers = require('./modifiers.cjs');
|
|
7
8
|
const require_nonempty = require('./nonempty.cjs');
|
|
8
9
|
const require_valueparser = require('./valueparser.cjs');
|
|
@@ -10,7 +11,14 @@ const require_primitives = require('./primitives.cjs');
|
|
|
10
11
|
const require_parser = require('./parser.cjs');
|
|
11
12
|
const require_facade = require('./facade.cjs');
|
|
12
13
|
|
|
14
|
+
exports.DeferredParseMarker = require_dependency.DeferredParseMarker;
|
|
15
|
+
exports.DependencyId = require_dependency.DependencyId;
|
|
16
|
+
exports.DependencyRegistry = require_dependency.DependencyRegistry;
|
|
17
|
+
exports.DependencySourceMarker = require_dependency.DependencySourceMarker;
|
|
18
|
+
exports.DependencySourceStateMarker = require_dependency.DependencySourceStateMarker;
|
|
19
|
+
exports.DerivedValueParserMarker = require_dependency.DerivedValueParserMarker;
|
|
13
20
|
exports.DuplicateOptionError = require_constructs.DuplicateOptionError;
|
|
21
|
+
exports.ParseWithDependency = require_dependency.ParseWithDependency;
|
|
14
22
|
exports.RunError = require_facade.RunError;
|
|
15
23
|
exports.RunParserError = require_facade.RunParserError;
|
|
16
24
|
exports.WithDefaultError = require_modifiers.WithDefaultError;
|
|
@@ -22,6 +30,10 @@ exports.commandLine = require_message.commandLine;
|
|
|
22
30
|
exports.concat = require_constructs.concat;
|
|
23
31
|
exports.conditional = require_constructs.conditional;
|
|
24
32
|
exports.constant = require_primitives.constant;
|
|
33
|
+
exports.createDeferredParseState = require_dependency.createDeferredParseState;
|
|
34
|
+
exports.createDependencySourceState = require_dependency.createDependencySourceState;
|
|
35
|
+
exports.dependency = require_dependency.dependency;
|
|
36
|
+
exports.deriveFrom = require_dependency.deriveFrom;
|
|
25
37
|
exports.ensureNonEmptyString = require_nonempty.ensureNonEmptyString;
|
|
26
38
|
exports.envVar = require_message.envVar;
|
|
27
39
|
exports.extractArgumentMetavars = require_usage.extractArgumentMetavars;
|
|
@@ -30,6 +42,7 @@ exports.extractOptionNames = require_usage.extractOptionNames;
|
|
|
30
42
|
exports.fish = require_completion.fish;
|
|
31
43
|
exports.flag = require_primitives.flag;
|
|
32
44
|
exports.float = require_valueparser.float;
|
|
45
|
+
exports.formatDependencyError = require_dependency.formatDependencyError;
|
|
33
46
|
exports.formatDocPage = require_doc.formatDocPage;
|
|
34
47
|
exports.formatMessage = require_message.formatMessage;
|
|
35
48
|
exports.formatUsage = require_usage.formatUsage;
|
|
@@ -39,6 +52,10 @@ exports.getDocPageAsync = require_parser.getDocPageAsync;
|
|
|
39
52
|
exports.getDocPageSync = require_parser.getDocPageSync;
|
|
40
53
|
exports.group = require_constructs.group;
|
|
41
54
|
exports.integer = require_valueparser.integer;
|
|
55
|
+
exports.isDeferredParseState = require_dependency.isDeferredParseState;
|
|
56
|
+
exports.isDependencySource = require_dependency.isDependencySource;
|
|
57
|
+
exports.isDependencySourceState = require_dependency.isDependencySourceState;
|
|
58
|
+
exports.isDerivedValueParser = require_dependency.isDerivedValueParser;
|
|
42
59
|
exports.isNonEmptyString = require_nonempty.isNonEmptyString;
|
|
43
60
|
exports.isValueParser = require_valueparser.isValueParser;
|
|
44
61
|
exports.locale = require_valueparser.locale;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,10 +3,11 @@ import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLin
|
|
|
3
3
|
import { OptionName, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.cjs";
|
|
4
4
|
import { DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, ShowDefaultOptions, formatDocPage } from "./doc.cjs";
|
|
5
5
|
import { ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, FloatOptions, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, StringOptions, UrlOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, choice, float, integer, isValueParser, locale, string, url, uuid } from "./valueparser.cjs";
|
|
6
|
+
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.cjs";
|
|
6
7
|
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.cjs";
|
|
7
|
-
import {
|
|
8
|
+
import { AnyDependencySource, CombinedDependencyMode, DeferredParseMarker, DeferredParseState, DependencyError, DependencyId, DependencyMode, DependencyRegistry, DependencySource, DependencySourceMarker, DependencySourceState, DependencySourceStateMarker, DependencyValue, DependencyValues, DeriveFromOptions, DeriveOptions, DerivedValueParser, DerivedValueParserMarker, ParseWithDependency, ResolvedDependency, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser } from "./dependency.cjs";
|
|
9
|
+
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, OptionState, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.cjs";
|
|
8
10
|
import { CombineModes, DocState, InferMode, InferValue, Mode, ModeIterable, ModeValue, Parser, ParserContext, ParserResult, Result, Suggestion, getDocPage, getDocPageAsync, getDocPageSync, parse, parseAsync, parseSync, suggest, suggestAsync, suggestSync } from "./parser.cjs";
|
|
9
|
-
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.cjs";
|
|
10
11
|
import { ShellCompletion, bash, fish, nu, pwsh, zsh } from "./completion.cjs";
|
|
11
12
|
import { RunError, RunOptions, RunParserError, run, runParser, runParserAsync, runParserSync } from "./facade.cjs";
|
|
12
|
-
export { ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, FloatOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Message, MessageFormatOptions, MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, RunError, RunOptions, RunParserError, ShellCompletion, ShowDefaultOptions, StringOptions, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, ValueSetOptions, WithDefaultError, WithDefaultOptions, argument, bash, choice, command, commandLine, concat, conditional, constant, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
|
13
|
+
export { AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DeferredParseMarker, DeferredParseState, DependencyError, DependencyId, DependencyMode, DependencyRegistry, DependencySource, DependencySourceMarker, DependencySourceState, DependencySourceStateMarker, DependencyValue, DependencyValues, DeriveFromOptions, DeriveOptions, DerivedValueParser, DerivedValueParserMarker, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, FloatOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Message, MessageFormatOptions, MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, ParseWithDependency, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, ResolvedDependency, Result, RunError, RunOptions, RunParserError, ShellCompletion, ShowDefaultOptions, StringOptions, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, ValueSetOptions, WithDefaultError, WithDefaultOptions, argument, bash, choice, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLin
|
|
|
3
3
|
import { OptionName, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.js";
|
|
4
4
|
import { DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, ShowDefaultOptions, formatDocPage } from "./doc.js";
|
|
5
5
|
import { ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, FloatOptions, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, StringOptions, UrlOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, choice, float, integer, isValueParser, locale, string, url, uuid } from "./valueparser.js";
|
|
6
|
+
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.js";
|
|
6
7
|
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.js";
|
|
7
|
-
import {
|
|
8
|
+
import { AnyDependencySource, CombinedDependencyMode, DeferredParseMarker, DeferredParseState, DependencyError, DependencyId, DependencyMode, DependencyRegistry, DependencySource, DependencySourceMarker, DependencySourceState, DependencySourceStateMarker, DependencyValue, DependencyValues, DeriveFromOptions, DeriveOptions, DerivedValueParser, DerivedValueParserMarker, ParseWithDependency, ResolvedDependency, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser } from "./dependency.js";
|
|
9
|
+
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, OptionState, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.js";
|
|
8
10
|
import { CombineModes, DocState, InferMode, InferValue, Mode, ModeIterable, ModeValue, Parser, ParserContext, ParserResult, Result, Suggestion, getDocPage, getDocPageAsync, getDocPageSync, parse, parseAsync, parseSync, suggest, suggestAsync, suggestSync } from "./parser.js";
|
|
9
|
-
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.js";
|
|
10
11
|
import { ShellCompletion, bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
11
12
|
import { RunError, RunOptions, RunParserError, run, runParser, runParserAsync, runParserSync } from "./facade.js";
|
|
12
|
-
export { ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, FloatOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Message, MessageFormatOptions, MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, RunError, RunOptions, RunParserError, ShellCompletion, ShowDefaultOptions, StringOptions, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, ValueSetOptions, WithDefaultError, WithDefaultOptions, argument, bash, choice, command, commandLine, concat, conditional, constant, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
|
13
|
+
export { AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DeferredParseMarker, DeferredParseState, DependencyError, DependencyId, DependencyMode, DependencyRegistry, DependencySource, DependencySourceMarker, DependencySourceState, DependencySourceStateMarker, DependencyValue, DependencyValues, DeriveFromOptions, DeriveOptions, DerivedValueParser, DerivedValueParserMarker, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, FloatOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Message, MessageFormatOptions, MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, ParseWithDependency, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, ResolvedDependency, Result, RunError, RunOptions, RunParserError, ShellCompletion, ShowDefaultOptions, StringOptions, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, ValueSetOptions, WithDefaultError, WithDefaultOptions, argument, bash, choice, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { commandLine, envVar, formatMessage, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.js";
|
|
2
|
+
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
3
|
+
import { DeferredParseMarker, DependencyId, DependencyRegistry, DependencySourceMarker, DependencySourceStateMarker, DerivedValueParserMarker, ParseWithDependency, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser } from "./dependency.js";
|
|
2
4
|
import { extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.js";
|
|
3
5
|
import { DuplicateOptionError, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.js";
|
|
4
6
|
import { formatDocPage } from "./doc.js";
|
|
5
|
-
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
6
7
|
import { WithDefaultError, map, multiple, optional, withDefault } from "./modifiers.js";
|
|
7
8
|
import { ensureNonEmptyString, isNonEmptyString } from "./nonempty.js";
|
|
8
9
|
import { choice, float, integer, isValueParser, locale, string, url, uuid } from "./valueparser.js";
|
|
@@ -10,4 +11,4 @@ import { argument, command, constant, flag, option, passThrough } from "./primit
|
|
|
10
11
|
import { getDocPage, getDocPageAsync, getDocPageSync, parse, parseAsync, parseSync, suggest, suggestAsync, suggestSync } from "./parser.js";
|
|
11
12
|
import { RunError, RunParserError, run, runParser, runParserAsync, runParserSync } from "./facade.js";
|
|
12
13
|
|
|
13
|
-
export { DuplicateOptionError, RunError, RunParserError, WithDefaultError, argument, bash, choice, command, commandLine, concat, conditional, constant, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
|
14
|
+
export { DeferredParseMarker, DependencyId, DependencyRegistry, DependencySourceMarker, DependencySourceStateMarker, DerivedValueParserMarker, DuplicateOptionError, ParseWithDependency, RunError, RunParserError, WithDefaultError, argument, bash, choice, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, dependency, deriveFrom, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getDocPage, getDocPageAsync, getDocPageSync, group, integer, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isValueParser, locale, longestMatch, map, merge, message, metavar, multiple, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, passThrough, pwsh, run, runParser, runParserAsync, runParserSync, string, suggest, suggestAsync, suggestSync, text, tuple, url, uuid, value, valueSet, values, withDefault, zsh };
|
package/dist/parser.d.cts
CHANGED
|
@@ -2,9 +2,9 @@ import { Message } from "./message.cjs";
|
|
|
2
2
|
import { Usage } from "./usage.cjs";
|
|
3
3
|
import { DocFragments, DocPage } from "./doc.cjs";
|
|
4
4
|
import { ValueParserResult } from "./valueparser.cjs";
|
|
5
|
-
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.cjs";
|
|
6
|
-
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.cjs";
|
|
7
5
|
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.cjs";
|
|
6
|
+
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.cjs";
|
|
7
|
+
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, OptionState, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.cjs";
|
|
8
8
|
|
|
9
9
|
//#region src/parser.d.ts
|
|
10
10
|
|
|
@@ -507,4 +507,4 @@ declare function getDocPage(parser: Parser<"sync", unknown, unknown>, args?: rea
|
|
|
507
507
|
declare function getDocPage(parser: Parser<"async", unknown, unknown>, args?: readonly string[]): Promise<DocPage | undefined>;
|
|
508
508
|
declare function getDocPage<M extends Mode>(parser: Parser<M, unknown, unknown>, args?: readonly string[]): ModeValue<M, DocPage | undefined>;
|
|
509
509
|
//#endregion
|
|
510
|
-
export { ArgumentErrorOptions, ArgumentOptions, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, InferMode, InferValue, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionOptions, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, Suggestion, TupleOptions, WithDefaultError, WithDefaultOptions, argument, command, concat, conditional, constant, flag, getDocPage, getDocPageAsync, getDocPageSync, group, longestMatch, map, merge, multiple, object, option, optional, or, parse, parseAsync, parseSync, passThrough, suggest, suggestAsync, suggestSync, tuple, withDefault };
|
|
510
|
+
export { ArgumentErrorOptions, ArgumentOptions, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, InferMode, InferValue, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionOptions, OptionState, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, Suggestion, TupleOptions, WithDefaultError, WithDefaultOptions, argument, command, concat, conditional, constant, flag, getDocPage, getDocPageAsync, getDocPageSync, group, longestMatch, map, merge, multiple, object, option, optional, or, parse, parseAsync, parseSync, passThrough, suggest, suggestAsync, suggestSync, tuple, withDefault };
|
package/dist/parser.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Message } from "./message.js";
|
|
|
2
2
|
import { Usage } from "./usage.js";
|
|
3
3
|
import { DocFragments, DocPage } from "./doc.js";
|
|
4
4
|
import { ValueParserResult } from "./valueparser.js";
|
|
5
|
-
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.js";
|
|
6
|
-
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.js";
|
|
7
5
|
import { ConditionalErrorOptions, ConditionalOptions, DuplicateOptionError, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OrErrorOptions, OrOptions, TupleOptions, concat, conditional, group, longestMatch, merge, object, or, tuple } from "./constructs.js";
|
|
6
|
+
import { MultipleErrorOptions, MultipleOptions, WithDefaultError, WithDefaultOptions, map, multiple, optional, withDefault } from "./modifiers.js";
|
|
7
|
+
import { ArgumentErrorOptions, ArgumentOptions, CommandErrorOptions, CommandOptions, FlagErrorOptions, FlagOptions, OptionErrorOptions, OptionOptions, OptionState, PassThroughFormat, PassThroughOptions, argument, command, constant, flag, option, passThrough } from "./primitives.js";
|
|
8
8
|
|
|
9
9
|
//#region src/parser.d.ts
|
|
10
10
|
|
|
@@ -507,4 +507,4 @@ declare function getDocPage(parser: Parser<"sync", unknown, unknown>, args?: rea
|
|
|
507
507
|
declare function getDocPage(parser: Parser<"async", unknown, unknown>, args?: readonly string[]): Promise<DocPage | undefined>;
|
|
508
508
|
declare function getDocPage<M extends Mode>(parser: Parser<M, unknown, unknown>, args?: readonly string[]): ModeValue<M, DocPage | undefined>;
|
|
509
509
|
//#endregion
|
|
510
|
-
export { ArgumentErrorOptions, ArgumentOptions, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, InferMode, InferValue, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionOptions, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, Suggestion, TupleOptions, WithDefaultError, WithDefaultOptions, argument, command, concat, conditional, constant, flag, getDocPage, getDocPageAsync, getDocPageSync, group, longestMatch, map, merge, multiple, object, option, optional, or, parse, parseAsync, parseSync, passThrough, suggest, suggestAsync, suggestSync, tuple, withDefault };
|
|
510
|
+
export { ArgumentErrorOptions, ArgumentOptions, CombineModes, CommandErrorOptions, CommandOptions, ConditionalErrorOptions, ConditionalOptions, DocState, DuplicateOptionError, FlagErrorOptions, FlagOptions, InferMode, InferValue, LongestMatchErrorOptions, LongestMatchOptions, MergeOptions, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionOptions, OptionState, OrErrorOptions, OrOptions, Parser, ParserContext, ParserResult, PassThroughFormat, PassThroughOptions, Result, Suggestion, TupleOptions, WithDefaultError, WithDefaultOptions, argument, command, concat, conditional, constant, flag, getDocPage, getDocPageAsync, getDocPageSync, group, longestMatch, map, merge, multiple, object, option, optional, or, parse, parseAsync, parseSync, passThrough, suggest, suggestAsync, suggestSync, tuple, withDefault };
|