UNPKG

@grammyjs/commands

Version:
19 lines (18 loc) 881 B
import { CommandGroup } from "../command-group.js"; import { Context, LanguageCode } from "../deps.node.js"; import type { BotCommandX } from "../types.js"; export declare function distance(s1: string, s2: string): number; export type JaroWinklerOptions = { ignoreCase?: boolean; similarityThreshold?: number; language?: LanguageCode | string; ignoreLocalization?: boolean; }; type CommandSimilarity = { command: BotCommandX | null; similarity: number; }; export declare function JaroWinklerDistance(s1: string, s2: string, options: Pick<Partial<JaroWinklerOptions>, "ignoreCase">): number; export declare function isLanguageCode(value: string | undefined): value is LanguageCode; export declare function fuzzyMatch<C extends Context>(userInput: string, commands: CommandGroup<C>, options: Partial<JaroWinklerOptions>): CommandSimilarity | null; export {};