-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de490e5
commit a6626da
Showing
5 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import { StoredParserOpts } from '../opts' | ||
|
||
/** | ||
* Represents a secondary resolution source (after user arguments) for which argument values can be obtained. | ||
* | ||
* These sources may be from a network, from the file system, or from the environment. | ||
*/ | ||
export abstract class Resolver { | ||
public constructor ( | ||
public readonly identifier: string | ||
) {} | ||
|
||
/** | ||
* Determine whether this resolver can resolve the provided key. | ||
* @param key - The key to check | ||
* @param opts - The parser opts | ||
*/ | ||
abstract keyExists (key: string, opts: StoredParserOpts): boolean | ||
abstract resolveKey (key: string, opts: StoredParserOpts): string | undefined | ||
/** | ||
* Resolve the provided key to its string value. | ||
* | ||
* This value should not be validated in any way other than ensuring it is not nullish. | ||
* @param key - The key to resolve | ||
* @param opts - The parser opts | ||
*/ | ||
abstract resolveKey (key: string, opts: StoredParserOpts): string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters