export declare let standardExport: string; /** * Type representing a dictionary of words mapped to their scores * Lower scores typically indicate better matches */ export type TDictionaryMap = { [key: string]: number; }; /** * Main class for fuzzy string matching against a dictionary * * @example * ```typescript * const fuzzy = new Smartfuzzy(['apple', 'banana', 'orange']); * const result = fuzzy.findClosestMatch('aple'); // Returns 'apple' * ``` */ export declare class Smartfuzzy { /** * Array of words used for fuzzy matching */ dictionary: string[]; /** * Creates a new Smartfuzzy instance * * @param dictionary - Initial array of words to use for matching */ constructor(dictionary: string[]); /** * Adds one or more words to the dictionary * * @param payloadArg - A single word or an array of words to add to the dictionary * @returns void * * @example * ```typescript * fuzzy.addToDictionary('pear'); * fuzzy.addToDictionary(['pear', 'grape', 'kiwi']); * ``` */ addToDictionary(payloadArg: string | string[]): void; /** * Calculates the Levenshtein distance (edit distance) between the input string * and each word in the dictionary * * @param stringArg - The string to compare against the dictionary * @returns A dictionary map where keys are words and values are edit distances * * @example * ```typescript * const scores = fuzzy.calculateScores('aple'); * // Returns: { 'apple': 1, 'banana': 5, 'orange': 5 } * ``` */ calculateScores(stringArg: string): TDictionaryMap; /** * Finds the closest matching word in the dictionary using fuzzy search * * @param stringArg - The string to find a match for * @returns The closest matching word, or null if no match is found or dictionary is empty * * @example * ```typescript * const match = fuzzy.findClosestMatch('oragne'); * // Returns: 'orange' * ``` */ findClosestMatch(stringArg: string): string | null; }