import { Simplify } from 'type-fest'; import { DeclarationOption, DeclarationOptionToOptionType, ParameterTypeToOptionTypeMap } from 'typedoc'; import type { OptionGroup } from './option-group'; import { DeclarationOptionConfig, ParameterValueType } from './utils'; import type { ABasePlugin } from '../base-plugin'; type MapFn = (value: TIn) => TOut; export type MapperPart> = ParameterValueType extends TOpt ? [ mapper?: MapFn, TOpt> ] : [ mapper: MapFn, TOpt> ]; type InferParameterType = keyof { [key in keyof ParameterTypeToOptionTypeMap as ParameterTypeToOptionTypeMap[key] extends T ? key : never]: true; }; export type InferDeclarationType = Simplify; }>; export declare class Option { readonly plugin: ABasePlugin; readonly group: OptionGroup | null; readonly name: string; private readonly _mapper; private readonly _declaration; get fullName(): string; /** * Generate a type-helper factory to constraint the option to be of the given {@link T2 type}. * * TODO: change signature once https://github.com/microsoft/TypeScript/pull/26349 is merged. * * @param plugin - The plugin declaring the option. * @returns a function to call with the option declaration (& optional mapper). */ static factory(plugin: ABasePlugin): (declaration: TDec, ...mapper: MapperPart) => Option; constructor(plugin: ABasePlugin, group: OptionGroup | null, declaration: TDeclaration, ...[mapper]: MapperPart); /** * Get the mapped value. * * @returns the value. */ getValue(): T; /** * Set the raw value. * * @param value - The value to set. */ setValue(value: DeclarationOptionToOptionType): void; } export {}; //# sourceMappingURL=option.d.ts.map