@biskyjs/framework
Version:
41 lines • 1.62 kB
TypeScript
import { PrefixedStrategy } from "@sapphire/lexure";
import { Option } from "@sapphire/result";
/**
* The strategy options used in Sapphire.
*/
export interface FlagStrategyOptions {
/**
* The accepted flags. Flags are key-only identifiers that can be placed anywhere in the command. Two different types are accepted:
* * An array of strings, e.g. [`silent`].
* * A boolean defining whether the strategy should accept all keys (`true`) or none at all (`false`).
* @default []
*/
flags?: readonly string[] | boolean;
/**
* The accepted options. Options are key-value identifiers that can be placed anywhere in the command. Two different types are accepted:
* * An array of strings, e.g. [`silent`].
* * A boolean defining whether the strategy should accept all keys (`true`) or none at all (`false`).
* @default []
*/
options?: readonly string[] | boolean;
/**
* The prefixes for both flags and options.
* @default ['--', '-', '—']
*/
prefixes?: string[];
/**
* The flag separators.
* @default ['=', ':']
*/
separators?: string[];
}
export declare class FlagUnorderedStrategy extends PrefixedStrategy {
readonly flags: readonly string[] | true;
readonly options: readonly string[] | true;
constructor({ flags, options, prefixes, separators }?: FlagStrategyOptions);
matchFlag(s: string): Option<string>;
matchOption(s: string): Option<readonly [key: string, value: string]>;
private allowedFlag;
private allowedOption;
}
//# sourceMappingURL=flag-unordered-strategy.d.ts.map