@optique/core 0.10.0-dev.305 → 0.10.0-dev.307
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 +9 -9
- package/dist/constructs.js +10 -10
- package/dist/dependency.cjs +86 -86
- package/dist/dependency.d.cts +35 -35
- package/dist/dependency.d.ts +35 -35
- package/dist/dependency.js +74 -74
- package/dist/index.cjs +12 -12
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/modifiers.cjs +11 -11
- package/dist/modifiers.js +12 -12
- package/dist/primitives.cjs +10 -10
- package/dist/primitives.js +11 -11
- package/package.json +1 -1
package/dist/dependency.d.cts
CHANGED
|
@@ -11,42 +11,42 @@ import { Mode, Suggestion } from "./parser.cjs";
|
|
|
11
11
|
* {@link ValueParser} instances.
|
|
12
12
|
* @since 0.10.0
|
|
13
13
|
*/
|
|
14
|
-
declare const
|
|
14
|
+
declare const dependencySourceMarker: unique symbol;
|
|
15
15
|
/**
|
|
16
16
|
* A unique symbol used to identify derived value parsers at compile time.
|
|
17
17
|
* This marker is used to distinguish {@link DerivedValueParser} from regular
|
|
18
18
|
* {@link ValueParser} instances.
|
|
19
19
|
* @since 0.10.0
|
|
20
20
|
*/
|
|
21
|
-
declare const
|
|
21
|
+
declare const derivedValueParserMarker: unique symbol;
|
|
22
22
|
/**
|
|
23
23
|
* A unique symbol used to store the dependency ID on value parsers.
|
|
24
24
|
* @since 0.10.0
|
|
25
25
|
*/
|
|
26
|
-
declare const
|
|
26
|
+
declare const dependencyId: unique symbol;
|
|
27
27
|
/**
|
|
28
28
|
* A unique symbol used to store multiple dependency IDs on derived parsers
|
|
29
29
|
* that depend on multiple sources (created via {@link deriveFrom}).
|
|
30
30
|
* @since 0.10.0
|
|
31
31
|
*/
|
|
32
|
-
declare const
|
|
32
|
+
declare const dependencyIds: unique symbol;
|
|
33
33
|
/**
|
|
34
34
|
* A unique symbol used to store the default values function on derived parsers.
|
|
35
35
|
* This is used during partial dependency resolution to fill in missing values.
|
|
36
36
|
* @since 0.10.0
|
|
37
37
|
*/
|
|
38
|
-
declare const
|
|
38
|
+
declare const defaultValues: unique symbol;
|
|
39
39
|
/**
|
|
40
40
|
* A unique symbol used to access the parseWithDependency method on derived parsers.
|
|
41
41
|
* @since 0.10.0
|
|
42
42
|
*/
|
|
43
|
-
declare const
|
|
43
|
+
declare const parseWithDependency: unique symbol;
|
|
44
44
|
/**
|
|
45
45
|
* A unique symbol used to access the suggestWithDependency method on derived parsers.
|
|
46
46
|
* This method generates suggestions using the provided dependency values instead of defaults.
|
|
47
47
|
* @since 0.10.0
|
|
48
48
|
*/
|
|
49
|
-
declare const
|
|
49
|
+
declare const suggestWithDependency: unique symbol;
|
|
50
50
|
/**
|
|
51
51
|
* Combines two modes into a single mode.
|
|
52
52
|
* If either mode is async, the result is async.
|
|
@@ -145,12 +145,12 @@ interface DependencySource<M extends Mode = "sync", T = unknown> extends ValuePa
|
|
|
145
145
|
* Marker to identify this as a dependency source.
|
|
146
146
|
* @internal
|
|
147
147
|
*/
|
|
148
|
-
readonly [
|
|
148
|
+
readonly [dependencySourceMarker]: true;
|
|
149
149
|
/**
|
|
150
150
|
* Unique identifier for this dependency source.
|
|
151
151
|
* @internal
|
|
152
152
|
*/
|
|
153
|
-
readonly [
|
|
153
|
+
readonly [dependencyId]: symbol;
|
|
154
154
|
/**
|
|
155
155
|
* Creates a derived value parser whose behavior depends on this
|
|
156
156
|
* dependency source's value.
|
|
@@ -323,28 +323,28 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
323
323
|
* Marker to identify this as a derived value parser.
|
|
324
324
|
* @internal
|
|
325
325
|
*/
|
|
326
|
-
readonly [
|
|
326
|
+
readonly [derivedValueParserMarker]: true;
|
|
327
327
|
/**
|
|
328
328
|
* The unique identifier of the dependency source this parser depends on.
|
|
329
329
|
* For parsers created with {@link deriveFrom} that have multiple dependencies,
|
|
330
330
|
* this is set to the first dependency's ID for backwards compatibility.
|
|
331
331
|
* @internal
|
|
332
332
|
*/
|
|
333
|
-
readonly [
|
|
333
|
+
readonly [dependencyId]: symbol;
|
|
334
334
|
/**
|
|
335
335
|
* The unique identifiers of all dependency sources this parser depends on.
|
|
336
336
|
* Present only for parsers created with {@link deriveFrom} that have multiple
|
|
337
|
-
* dependencies. If present, this takes precedence over {@link
|
|
337
|
+
* dependencies. If present, this takes precedence over {@link dependencyId}
|
|
338
338
|
* during dependency resolution.
|
|
339
339
|
* @internal
|
|
340
340
|
*/
|
|
341
|
-
readonly [
|
|
341
|
+
readonly [dependencyIds]?: readonly symbol[];
|
|
342
342
|
/**
|
|
343
343
|
* The default values function for this parser's dependencies.
|
|
344
344
|
* Used during partial dependency resolution to fill in missing values.
|
|
345
345
|
* @internal
|
|
346
346
|
*/
|
|
347
|
-
readonly [
|
|
347
|
+
readonly [defaultValues]?: () => readonly unknown[];
|
|
348
348
|
/**
|
|
349
349
|
* Parses the input using the actual dependency value instead of the default.
|
|
350
350
|
* This method is used during dependency resolution in `complete()`.
|
|
@@ -354,7 +354,7 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
354
354
|
* @returns The parse result.
|
|
355
355
|
* @internal
|
|
356
356
|
*/
|
|
357
|
-
readonly [
|
|
357
|
+
readonly [parseWithDependency]: (input: string, dependencyValue: S) => ValueParserResult<T> | Promise<ValueParserResult<T>>;
|
|
358
358
|
/**
|
|
359
359
|
* Generates suggestions using the provided dependency value instead of the default.
|
|
360
360
|
* This method is used during shell completion when dependency sources have been parsed.
|
|
@@ -364,7 +364,7 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
364
364
|
* @returns An iterable of suggestions.
|
|
365
365
|
* @internal
|
|
366
366
|
*/
|
|
367
|
-
readonly [
|
|
367
|
+
readonly [suggestWithDependency]?: (prefix: string, dependencyValue: S) => Iterable<Suggestion> | AsyncIterable<Suggestion>;
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* Creates a dependency source from a {@link ValueParser}.
|
|
@@ -478,7 +478,7 @@ declare function deriveFromAsync<Deps extends readonly AnyDependencySource[], T>
|
|
|
478
478
|
* A unique symbol used to identify deferred parse states.
|
|
479
479
|
* @since 0.10.0
|
|
480
480
|
*/
|
|
481
|
-
declare const
|
|
481
|
+
declare const deferredParseMarker: unique symbol;
|
|
482
482
|
/**
|
|
483
483
|
* Represents a deferred parse state for a DerivedValueParser.
|
|
484
484
|
*
|
|
@@ -494,7 +494,7 @@ interface DeferredParseState<T = unknown> {
|
|
|
494
494
|
/**
|
|
495
495
|
* Marker to identify this as a deferred parse state.
|
|
496
496
|
*/
|
|
497
|
-
readonly [
|
|
497
|
+
readonly [deferredParseMarker]: true;
|
|
498
498
|
/**
|
|
499
499
|
* The raw input string to be parsed.
|
|
500
500
|
*/
|
|
@@ -549,7 +549,7 @@ declare function createDeferredParseState<T, S>(rawInput: string, parser: Derive
|
|
|
549
549
|
* A unique symbol used to identify dependency source parse states.
|
|
550
550
|
* @since 0.10.0
|
|
551
551
|
*/
|
|
552
|
-
declare const
|
|
552
|
+
declare const dependencySourceStateMarker: unique symbol;
|
|
553
553
|
/**
|
|
554
554
|
* Represents a parse state from a DependencySource.
|
|
555
555
|
* This wraps the normal ValueParserResult with the dependency ID so that
|
|
@@ -562,11 +562,11 @@ interface DependencySourceState<T = unknown> {
|
|
|
562
562
|
/**
|
|
563
563
|
* Marker to identify this as a dependency source state.
|
|
564
564
|
*/
|
|
565
|
-
readonly [
|
|
565
|
+
readonly [dependencySourceStateMarker]: true;
|
|
566
566
|
/**
|
|
567
567
|
* The dependency ID of the source.
|
|
568
568
|
*/
|
|
569
|
-
readonly [
|
|
569
|
+
readonly [dependencyId]: symbol;
|
|
570
570
|
/**
|
|
571
571
|
* The underlying parse result.
|
|
572
572
|
*/
|
|
@@ -585,16 +585,16 @@ declare function isDependencySourceState<T>(value: unknown): value is Dependency
|
|
|
585
585
|
*
|
|
586
586
|
* @template T The type of value the state contains.
|
|
587
587
|
* @param result The parse result.
|
|
588
|
-
* @param
|
|
588
|
+
* @param depId The dependency ID.
|
|
589
589
|
* @returns A DependencySourceState object.
|
|
590
590
|
* @since 0.10.0
|
|
591
591
|
*/
|
|
592
|
-
declare function createDependencySourceState<T>(result: ValueParserResult<T>,
|
|
592
|
+
declare function createDependencySourceState<T>(result: ValueParserResult<T>, depId: symbol): DependencySourceState<T>;
|
|
593
593
|
/**
|
|
594
594
|
* A unique symbol used to identify pending dependency source states.
|
|
595
595
|
* @since 0.10.0
|
|
596
596
|
*/
|
|
597
|
-
declare const
|
|
597
|
+
declare const pendingDependencySourceStateMarker: unique symbol;
|
|
598
598
|
/**
|
|
599
599
|
* Represents a pending dependency source state.
|
|
600
600
|
* This is used when a dependency source option was not provided, but its
|
|
@@ -607,11 +607,11 @@ interface PendingDependencySourceState {
|
|
|
607
607
|
/**
|
|
608
608
|
* Marker to identify this as a pending dependency source state.
|
|
609
609
|
*/
|
|
610
|
-
readonly [
|
|
610
|
+
readonly [pendingDependencySourceStateMarker]: true;
|
|
611
611
|
/**
|
|
612
612
|
* The dependency ID of the source.
|
|
613
613
|
*/
|
|
614
|
-
readonly [
|
|
614
|
+
readonly [dependencyId]: symbol;
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
617
617
|
* Checks if a value is a {@link PendingDependencySourceState}.
|
|
@@ -624,18 +624,18 @@ declare function isPendingDependencySourceState(value: unknown): value is Pendin
|
|
|
624
624
|
/**
|
|
625
625
|
* Creates a pending dependency source state.
|
|
626
626
|
*
|
|
627
|
-
* @param
|
|
627
|
+
* @param depId The dependency ID.
|
|
628
628
|
* @returns A PendingDependencySourceState object.
|
|
629
629
|
* @since 0.10.0
|
|
630
630
|
*/
|
|
631
|
-
declare function createPendingDependencySourceState(
|
|
631
|
+
declare function createPendingDependencySourceState(depId: symbol): PendingDependencySourceState;
|
|
632
632
|
/**
|
|
633
633
|
* A unique symbol used to identify parsers that wrap a dependency source.
|
|
634
634
|
* This is used by withDefault to indicate it contains an inner parser
|
|
635
635
|
* with a PendingDependencySourceState initialState.
|
|
636
636
|
* @since 0.10.0
|
|
637
637
|
*/
|
|
638
|
-
declare const
|
|
638
|
+
declare const wrappedDependencySourceMarker: unique symbol;
|
|
639
639
|
/**
|
|
640
640
|
* A unique symbol used to indicate that a wrapper transforms the dependency
|
|
641
641
|
* source value. This is used by withDefault to determine whether its default
|
|
@@ -647,26 +647,26 @@ declare const WrappedDependencySourceMarker: unique symbol;
|
|
|
647
647
|
*
|
|
648
648
|
* @since 0.10.0
|
|
649
649
|
*/
|
|
650
|
-
declare const
|
|
650
|
+
declare const transformsDependencyValueMarker: unique symbol;
|
|
651
651
|
/**
|
|
652
|
-
* Checks if a parser transforms the dependency value (has
|
|
652
|
+
* Checks if a parser transforms the dependency value (has transformsDependencyValueMarker).
|
|
653
653
|
*
|
|
654
654
|
* @param parser The parser to check.
|
|
655
655
|
* @returns `true` if the parser transforms the dependency value.
|
|
656
656
|
* @since 0.10.0
|
|
657
657
|
*/
|
|
658
658
|
declare function transformsDependencyValue(parser: unknown): parser is {
|
|
659
|
-
[
|
|
659
|
+
[transformsDependencyValueMarker]: true;
|
|
660
660
|
};
|
|
661
661
|
/**
|
|
662
|
-
* Checks if a parser wraps a dependency source (has
|
|
662
|
+
* Checks if a parser wraps a dependency source (has wrappedDependencySourceMarker).
|
|
663
663
|
*
|
|
664
664
|
* @param parser The parser to check.
|
|
665
665
|
* @returns `true` if the parser wraps a dependency source.
|
|
666
666
|
* @since 0.10.0
|
|
667
667
|
*/
|
|
668
668
|
declare function isWrappedDependencySource(parser: unknown): parser is {
|
|
669
|
-
[
|
|
669
|
+
[wrappedDependencySourceMarker]: PendingDependencySourceState;
|
|
670
670
|
};
|
|
671
671
|
/**
|
|
672
672
|
* Represents a resolved dependency value stored during parsing.
|
|
@@ -747,4 +747,4 @@ type DependencyError = {
|
|
|
747
747
|
*/
|
|
748
748
|
declare function formatDependencyError(error: DependencyError): Message;
|
|
749
749
|
//#endregion
|
|
750
|
-
export { AnyDependencySource, CombineMode, CombinedDependencyMode,
|
|
750
|
+
export { AnyDependencySource, CombineMode, CombinedDependencyMode, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, PendingDependencySourceState, ResolvedDependency, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isPendingDependencySourceState, isWrappedDependencySource, parseWithDependency, pendingDependencySourceStateMarker, suggestWithDependency, transformsDependencyValue, transformsDependencyValueMarker, wrappedDependencySourceMarker };
|
package/dist/dependency.d.ts
CHANGED
|
@@ -11,42 +11,42 @@ import { Mode, Suggestion } from "./parser.js";
|
|
|
11
11
|
* {@link ValueParser} instances.
|
|
12
12
|
* @since 0.10.0
|
|
13
13
|
*/
|
|
14
|
-
declare const
|
|
14
|
+
declare const dependencySourceMarker: unique symbol;
|
|
15
15
|
/**
|
|
16
16
|
* A unique symbol used to identify derived value parsers at compile time.
|
|
17
17
|
* This marker is used to distinguish {@link DerivedValueParser} from regular
|
|
18
18
|
* {@link ValueParser} instances.
|
|
19
19
|
* @since 0.10.0
|
|
20
20
|
*/
|
|
21
|
-
declare const
|
|
21
|
+
declare const derivedValueParserMarker: unique symbol;
|
|
22
22
|
/**
|
|
23
23
|
* A unique symbol used to store the dependency ID on value parsers.
|
|
24
24
|
* @since 0.10.0
|
|
25
25
|
*/
|
|
26
|
-
declare const
|
|
26
|
+
declare const dependencyId: unique symbol;
|
|
27
27
|
/**
|
|
28
28
|
* A unique symbol used to store multiple dependency IDs on derived parsers
|
|
29
29
|
* that depend on multiple sources (created via {@link deriveFrom}).
|
|
30
30
|
* @since 0.10.0
|
|
31
31
|
*/
|
|
32
|
-
declare const
|
|
32
|
+
declare const dependencyIds: unique symbol;
|
|
33
33
|
/**
|
|
34
34
|
* A unique symbol used to store the default values function on derived parsers.
|
|
35
35
|
* This is used during partial dependency resolution to fill in missing values.
|
|
36
36
|
* @since 0.10.0
|
|
37
37
|
*/
|
|
38
|
-
declare const
|
|
38
|
+
declare const defaultValues: unique symbol;
|
|
39
39
|
/**
|
|
40
40
|
* A unique symbol used to access the parseWithDependency method on derived parsers.
|
|
41
41
|
* @since 0.10.0
|
|
42
42
|
*/
|
|
43
|
-
declare const
|
|
43
|
+
declare const parseWithDependency: unique symbol;
|
|
44
44
|
/**
|
|
45
45
|
* A unique symbol used to access the suggestWithDependency method on derived parsers.
|
|
46
46
|
* This method generates suggestions using the provided dependency values instead of defaults.
|
|
47
47
|
* @since 0.10.0
|
|
48
48
|
*/
|
|
49
|
-
declare const
|
|
49
|
+
declare const suggestWithDependency: unique symbol;
|
|
50
50
|
/**
|
|
51
51
|
* Combines two modes into a single mode.
|
|
52
52
|
* If either mode is async, the result is async.
|
|
@@ -145,12 +145,12 @@ interface DependencySource<M extends Mode = "sync", T = unknown> extends ValuePa
|
|
|
145
145
|
* Marker to identify this as a dependency source.
|
|
146
146
|
* @internal
|
|
147
147
|
*/
|
|
148
|
-
readonly [
|
|
148
|
+
readonly [dependencySourceMarker]: true;
|
|
149
149
|
/**
|
|
150
150
|
* Unique identifier for this dependency source.
|
|
151
151
|
* @internal
|
|
152
152
|
*/
|
|
153
|
-
readonly [
|
|
153
|
+
readonly [dependencyId]: symbol;
|
|
154
154
|
/**
|
|
155
155
|
* Creates a derived value parser whose behavior depends on this
|
|
156
156
|
* dependency source's value.
|
|
@@ -323,28 +323,28 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
323
323
|
* Marker to identify this as a derived value parser.
|
|
324
324
|
* @internal
|
|
325
325
|
*/
|
|
326
|
-
readonly [
|
|
326
|
+
readonly [derivedValueParserMarker]: true;
|
|
327
327
|
/**
|
|
328
328
|
* The unique identifier of the dependency source this parser depends on.
|
|
329
329
|
* For parsers created with {@link deriveFrom} that have multiple dependencies,
|
|
330
330
|
* this is set to the first dependency's ID for backwards compatibility.
|
|
331
331
|
* @internal
|
|
332
332
|
*/
|
|
333
|
-
readonly [
|
|
333
|
+
readonly [dependencyId]: symbol;
|
|
334
334
|
/**
|
|
335
335
|
* The unique identifiers of all dependency sources this parser depends on.
|
|
336
336
|
* Present only for parsers created with {@link deriveFrom} that have multiple
|
|
337
|
-
* dependencies. If present, this takes precedence over {@link
|
|
337
|
+
* dependencies. If present, this takes precedence over {@link dependencyId}
|
|
338
338
|
* during dependency resolution.
|
|
339
339
|
* @internal
|
|
340
340
|
*/
|
|
341
|
-
readonly [
|
|
341
|
+
readonly [dependencyIds]?: readonly symbol[];
|
|
342
342
|
/**
|
|
343
343
|
* The default values function for this parser's dependencies.
|
|
344
344
|
* Used during partial dependency resolution to fill in missing values.
|
|
345
345
|
* @internal
|
|
346
346
|
*/
|
|
347
|
-
readonly [
|
|
347
|
+
readonly [defaultValues]?: () => readonly unknown[];
|
|
348
348
|
/**
|
|
349
349
|
* Parses the input using the actual dependency value instead of the default.
|
|
350
350
|
* This method is used during dependency resolution in `complete()`.
|
|
@@ -354,7 +354,7 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
354
354
|
* @returns The parse result.
|
|
355
355
|
* @internal
|
|
356
356
|
*/
|
|
357
|
-
readonly [
|
|
357
|
+
readonly [parseWithDependency]: (input: string, dependencyValue: S) => ValueParserResult<T> | Promise<ValueParserResult<T>>;
|
|
358
358
|
/**
|
|
359
359
|
* Generates suggestions using the provided dependency value instead of the default.
|
|
360
360
|
* This method is used during shell completion when dependency sources have been parsed.
|
|
@@ -364,7 +364,7 @@ interface DerivedValueParser<M extends Mode = "sync", T = unknown, S = unknown>
|
|
|
364
364
|
* @returns An iterable of suggestions.
|
|
365
365
|
* @internal
|
|
366
366
|
*/
|
|
367
|
-
readonly [
|
|
367
|
+
readonly [suggestWithDependency]?: (prefix: string, dependencyValue: S) => Iterable<Suggestion> | AsyncIterable<Suggestion>;
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* Creates a dependency source from a {@link ValueParser}.
|
|
@@ -478,7 +478,7 @@ declare function deriveFromAsync<Deps extends readonly AnyDependencySource[], T>
|
|
|
478
478
|
* A unique symbol used to identify deferred parse states.
|
|
479
479
|
* @since 0.10.0
|
|
480
480
|
*/
|
|
481
|
-
declare const
|
|
481
|
+
declare const deferredParseMarker: unique symbol;
|
|
482
482
|
/**
|
|
483
483
|
* Represents a deferred parse state for a DerivedValueParser.
|
|
484
484
|
*
|
|
@@ -494,7 +494,7 @@ interface DeferredParseState<T = unknown> {
|
|
|
494
494
|
/**
|
|
495
495
|
* Marker to identify this as a deferred parse state.
|
|
496
496
|
*/
|
|
497
|
-
readonly [
|
|
497
|
+
readonly [deferredParseMarker]: true;
|
|
498
498
|
/**
|
|
499
499
|
* The raw input string to be parsed.
|
|
500
500
|
*/
|
|
@@ -549,7 +549,7 @@ declare function createDeferredParseState<T, S>(rawInput: string, parser: Derive
|
|
|
549
549
|
* A unique symbol used to identify dependency source parse states.
|
|
550
550
|
* @since 0.10.0
|
|
551
551
|
*/
|
|
552
|
-
declare const
|
|
552
|
+
declare const dependencySourceStateMarker: unique symbol;
|
|
553
553
|
/**
|
|
554
554
|
* Represents a parse state from a DependencySource.
|
|
555
555
|
* This wraps the normal ValueParserResult with the dependency ID so that
|
|
@@ -562,11 +562,11 @@ interface DependencySourceState<T = unknown> {
|
|
|
562
562
|
/**
|
|
563
563
|
* Marker to identify this as a dependency source state.
|
|
564
564
|
*/
|
|
565
|
-
readonly [
|
|
565
|
+
readonly [dependencySourceStateMarker]: true;
|
|
566
566
|
/**
|
|
567
567
|
* The dependency ID of the source.
|
|
568
568
|
*/
|
|
569
|
-
readonly [
|
|
569
|
+
readonly [dependencyId]: symbol;
|
|
570
570
|
/**
|
|
571
571
|
* The underlying parse result.
|
|
572
572
|
*/
|
|
@@ -585,16 +585,16 @@ declare function isDependencySourceState<T>(value: unknown): value is Dependency
|
|
|
585
585
|
*
|
|
586
586
|
* @template T The type of value the state contains.
|
|
587
587
|
* @param result The parse result.
|
|
588
|
-
* @param
|
|
588
|
+
* @param depId The dependency ID.
|
|
589
589
|
* @returns A DependencySourceState object.
|
|
590
590
|
* @since 0.10.0
|
|
591
591
|
*/
|
|
592
|
-
declare function createDependencySourceState<T>(result: ValueParserResult<T>,
|
|
592
|
+
declare function createDependencySourceState<T>(result: ValueParserResult<T>, depId: symbol): DependencySourceState<T>;
|
|
593
593
|
/**
|
|
594
594
|
* A unique symbol used to identify pending dependency source states.
|
|
595
595
|
* @since 0.10.0
|
|
596
596
|
*/
|
|
597
|
-
declare const
|
|
597
|
+
declare const pendingDependencySourceStateMarker: unique symbol;
|
|
598
598
|
/**
|
|
599
599
|
* Represents a pending dependency source state.
|
|
600
600
|
* This is used when a dependency source option was not provided, but its
|
|
@@ -607,11 +607,11 @@ interface PendingDependencySourceState {
|
|
|
607
607
|
/**
|
|
608
608
|
* Marker to identify this as a pending dependency source state.
|
|
609
609
|
*/
|
|
610
|
-
readonly [
|
|
610
|
+
readonly [pendingDependencySourceStateMarker]: true;
|
|
611
611
|
/**
|
|
612
612
|
* The dependency ID of the source.
|
|
613
613
|
*/
|
|
614
|
-
readonly [
|
|
614
|
+
readonly [dependencyId]: symbol;
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
617
617
|
* Checks if a value is a {@link PendingDependencySourceState}.
|
|
@@ -624,18 +624,18 @@ declare function isPendingDependencySourceState(value: unknown): value is Pendin
|
|
|
624
624
|
/**
|
|
625
625
|
* Creates a pending dependency source state.
|
|
626
626
|
*
|
|
627
|
-
* @param
|
|
627
|
+
* @param depId The dependency ID.
|
|
628
628
|
* @returns A PendingDependencySourceState object.
|
|
629
629
|
* @since 0.10.0
|
|
630
630
|
*/
|
|
631
|
-
declare function createPendingDependencySourceState(
|
|
631
|
+
declare function createPendingDependencySourceState(depId: symbol): PendingDependencySourceState;
|
|
632
632
|
/**
|
|
633
633
|
* A unique symbol used to identify parsers that wrap a dependency source.
|
|
634
634
|
* This is used by withDefault to indicate it contains an inner parser
|
|
635
635
|
* with a PendingDependencySourceState initialState.
|
|
636
636
|
* @since 0.10.0
|
|
637
637
|
*/
|
|
638
|
-
declare const
|
|
638
|
+
declare const wrappedDependencySourceMarker: unique symbol;
|
|
639
639
|
/**
|
|
640
640
|
* A unique symbol used to indicate that a wrapper transforms the dependency
|
|
641
641
|
* source value. This is used by withDefault to determine whether its default
|
|
@@ -647,26 +647,26 @@ declare const WrappedDependencySourceMarker: unique symbol;
|
|
|
647
647
|
*
|
|
648
648
|
* @since 0.10.0
|
|
649
649
|
*/
|
|
650
|
-
declare const
|
|
650
|
+
declare const transformsDependencyValueMarker: unique symbol;
|
|
651
651
|
/**
|
|
652
|
-
* Checks if a parser transforms the dependency value (has
|
|
652
|
+
* Checks if a parser transforms the dependency value (has transformsDependencyValueMarker).
|
|
653
653
|
*
|
|
654
654
|
* @param parser The parser to check.
|
|
655
655
|
* @returns `true` if the parser transforms the dependency value.
|
|
656
656
|
* @since 0.10.0
|
|
657
657
|
*/
|
|
658
658
|
declare function transformsDependencyValue(parser: unknown): parser is {
|
|
659
|
-
[
|
|
659
|
+
[transformsDependencyValueMarker]: true;
|
|
660
660
|
};
|
|
661
661
|
/**
|
|
662
|
-
* Checks if a parser wraps a dependency source (has
|
|
662
|
+
* Checks if a parser wraps a dependency source (has wrappedDependencySourceMarker).
|
|
663
663
|
*
|
|
664
664
|
* @param parser The parser to check.
|
|
665
665
|
* @returns `true` if the parser wraps a dependency source.
|
|
666
666
|
* @since 0.10.0
|
|
667
667
|
*/
|
|
668
668
|
declare function isWrappedDependencySource(parser: unknown): parser is {
|
|
669
|
-
[
|
|
669
|
+
[wrappedDependencySourceMarker]: PendingDependencySourceState;
|
|
670
670
|
};
|
|
671
671
|
/**
|
|
672
672
|
* Represents a resolved dependency value stored during parsing.
|
|
@@ -747,4 +747,4 @@ type DependencyError = {
|
|
|
747
747
|
*/
|
|
748
748
|
declare function formatDependencyError(error: DependencyError): Message;
|
|
749
749
|
//#endregion
|
|
750
|
-
export { AnyDependencySource, CombineMode, CombinedDependencyMode,
|
|
750
|
+
export { AnyDependencySource, CombineMode, CombinedDependencyMode, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, PendingDependencySourceState, ResolvedDependency, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, formatDependencyError, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isPendingDependencySourceState, isWrappedDependencySource, parseWithDependency, pendingDependencySourceStateMarker, suggestWithDependency, transformsDependencyValue, transformsDependencyValueMarker, wrappedDependencySourceMarker };
|