import Description from '../description'; /** * A (value, description) pair. * The description "explains" the value, hence interface name Explanation. * * @template T The type of the stored value. * * @property value - The stored value. * @property description - A description or explanation of the stored value. */ export interface Explanation { readonly value: T; readonly description: Description; } /** * A shorthand function for creating an explanation object. * * @template T The type of the value to be explained. * * @param value - The value for the explanation. * @param description - The description for the explanation. * @returns The explanation object, a (value, description) pair. */ export declare function explain(value: T, description: string): Explanation; /** * A shorthand function for creating an explanation object. * Deals with potentially undefined values. * * @template T The type of the value to be explained. * * @param value - The value for the explanation (or undefined). * @param descriptionCreator - A function that creates a description given the value. * @returns The explanation object, a (value, description) pair (or undefined). */ export declare function explainOptional(value: T | undefined, descriptionCreator: (_: T) => string): Explanation | undefined; /** * A shorthand function for creating an explanation object. * Explains arrays. * * @template TArray The type of the array elements. * @template TNewArray The type of the explanations for each array element. * @param value - The original array of values to be explained. * @param explainElement - A function that explains individual elements of the array. * @param description - The description for the entire array. * @returns The explanation object, a (value, description) pair. The value is the original array mapped using explainElement. */ export declare function explainArray(value: TArray[], explainElement: (_: TArray) => TNewArray, description: string): Explanation; /** * A shorthand function for creating an explanation object. * Explains arrays. Deals with potentially undefined values. * * @template TArray The type of the array elements. * @template TNewArray The type of the explanations for each array element. * @param value - The original array of values to be explained (or undefined). * @param explainElement - A function that explains individual elements of the array. * @param description - The description for the entire array. * @returns The explanation object, a (value, description) pair (or undefined). * The value is the original array mapped using explainElement. */ export declare function explainOptionalArray(value: TArray[] | undefined, explainElement: (_: TArray) => TNewArray, description: string): Explanation | undefined; //# sourceMappingURL=Explanation.d.ts.map