@builder.io/dev-tools
Version:
Builder.io Visual CMS Devtools
15 lines (14 loc) • 590 B
TypeScript
import Fuse, { type FuseResult } from "fuse.js";
export type FileSearchItem = {
fullPath: string;
basename: string;
filenameWithoutExt: string;
dirname: string;
};
export declare function buildFileSearchItems(files: string[]): FileSearchItem[];
export declare function createFileSearchIndex(files: string[]): Fuse<FileSearchItem>;
/**
* Convert Fuse match indices from the best-matching field back to indices
* relative to the fullPath string, so the UI can highlight them.
*/
export declare function getMatchIndicesForPath(result: FuseResult<FileSearchItem>): number[];