@wonderwhy-er/desktop-commander
Version:
MCP server for terminal operations and file editing
31 lines (30 loc) • 1.2 kB
TypeScript
/**
* SPDX-License-Identifier: PolyForm-Small-Business-1.0.0
*
* Copyright (c) 2025 Desktope Commander MCP Contributors
*
* This file is licensed under the PolyForm Small Business License 1.0.0
* See the LICENSE file in the /src/polyform directory for the full license text.
*/
/**
* Recursively finds the closest match to a query string within text using fuzzy matching
* @param text The text to search within
* @param query The query string to find
* @param start Start index in the text (default: 0)
* @param end End index in the text (default: text.length)
* @param parentDistance Best distance found so far (default: Infinity)
* @returns Object with start and end indices, matched value, and Levenshtein distance
*/
export declare function recursiveFuzzyIndexOf(text: string, query: string, start?: number, end?: number | null, parentDistance?: number, depth?: number): {
start: number;
end: number;
value: string;
distance: number;
};
/**
* Calculates the similarity ratio between two strings
* @param a First string
* @param b Second string
* @returns Similarity ratio (0-1)
*/
export declare function getSimilarityRatio(a: string, b: string): number;