/** * Properties common to all OptionDefinitions */ type BaseOption = { /** * Internal name of option and name in CLI */ name: string; /** * Field label in GUI implementations */ label: string; /** * Description displayed in --help of CLI and in GUI implementations */ description: string; /** * Wether the option is used by several adapters */ common: boolean; }; /** * Option that represents a flag (without argument, for example a checkbox in GUI implementations) */ export type FlagOptionDefinition = BaseOption & { type: 'bool'; }; /** * Option with argument that parses to type T */ export type PublicArgumentOptionDefinition = BaseOption & { type: 'text'; /** * List of possible values for options of 'text' type. Will render as dropdown in GUI implementations. */ enum?: string[]; /** * Name of the argument (displayed in --help of CLI and possibly as placeholder in GUI implementations) */ argument?: string; /** * Wether the option is required for the adapter */ required: boolean; }; export type ArgumentOptionDefinition = PublicArgumentOptionDefinition & { /** * Function that validates and parses the option. Can throw exceptions on parsing errors. Will receive empty string if option was not set. */ parse: (value: string) => T; }; export type OptionDefinition = InternalOptionDefinition | PublicArgumentOptionDefinition; export type InternalOptionDefinition = FlagOptionDefinition | ArgumentOptionDefinition; export type OptionValues = Record; /** * Option container holds options passed to the adapters (command line options or form data from UI) and provides methods to access them by OptionDefinitions. */ export declare class OptionContainer { private readonly values; constructor(values: OptionValues); getArgument(optionDefinition: ArgumentOptionDefinition): T; isFlagSet(optionDefinition: FlagOptionDefinition): boolean; } export declare const shortpilotOption: FlagOptionDefinition; export declare const nameOption: ArgumentOptionDefinition; export declare const loadOption: ArgumentOptionDefinition; export declare const entryOption: ArgumentOptionDefinition; export declare function parse16BitIntegerOption(v: string | undefined, optionName: string): number | undefined; export declare function parse8BitIntegerOption(v: string | undefined, optionName: string): number | undefined; export {};