import { AbstractFormatter } from '../Formatter'; import { TypedValue, DataType } from '../DataPrimitive'; import { DataPoint } from '../DataPoint'; export interface MatchesConfig { match: any; value: any; } /** * This formatter accepts a list of potential matches and a defaultValue (if no match is found) as the config. * * It maps each element in the DataSeries to find a corresponding matched value and returns the matched value if found, or the defaultValue if present. * Otherwise if neither are present, it returns the original value. * * The asterisk (`*`) character can be used as a wildcard in match values to represent any number of characters in a string. It can be placed anywhere within the string. Matching prioritizes exact values, followed by values with more common characters. * If multiple match values share the same length and number of wildcards, they will be matched according to their order of entry. * * For example, given the match values `["vis*, "*ual"]`, the string `"visual"` would match `"vis*"`. * * * ```js * primary | seriesByIndex(0) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #FF0000 * colorOption2: '> primary | seriesByIndex(1) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #0000FF * colorOption3: '> primary | seriesByIndex(2) | lastPoint() | matchValue(colorMatches, "#0000FF")' // returns #FFFFFF * }} * dataSources={{ * primary: { * data: { * columns: [[100, 200, 300, 400, 500], [600, 700, 800, 900, 1000], ["visual"]] * fields: [{ name: 'foo' }, { name: 'bar' }, { name: 'baz' }], * } * } * }} * /> * * * * @extends AbstractFormatter */ export declare class MatchValue extends AbstractFormatter { private readonly matches; private readonly defaultValue; constructor(matches: MatchesConfig[], defaultValue?: any); protected formatTypedValue(input: DataPoint): TypedValue; }