Skip to content

Commit

Permalink
Use string instead of OptionValueSource
Browse files Browse the repository at this point in the history
OptionValueSource is only meaningful as defined in
commander-js/extra-typings#3
  • Loading branch information
aweebit committed Jul 29, 2023
1 parent 940b111 commit 52d5885
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ export interface OutputConfiguration {

export type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
export type OptionValueSource = 'default' | 'config' | 'env' | 'cli' | 'implied';

export type OptionValues = Record<string, any>;

Expand Down Expand Up @@ -595,17 +594,17 @@ export class Command {
/**
* Store option value and where the value came from.
*/
setOptionValueWithSource(key: string, value: unknown, source: 'config'): this;
setOptionValueWithSource(key: string, value: unknown, source?: string | undefined): this;

/**
* Get source of option value.
*/
getOptionValueSource(key: string): OptionValueSource | undefined;
getOptionValueSource(key: string): string | undefined;

/**
* Get source of option value. See also .optsWithGlobals().
*/
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
getOptionValueSourceWithGlobals(key: string): string | undefined;

/**
* Alter parsing of short flags with optional values.
Expand Down

0 comments on commit 52d5885

Please sign in to comment.