/** * The files and directories of a workspace, for the `@` reference picker. * * Ordering is the whole value here. A flat alphabetical list of every path buries `package.json` * under a thousand entries from `dist/`, so entries are ranked by how close they are to the root * and directories come first at each level — which is the order someone reaching for `@` is * thinking in. What the repository already ignores is ignored here too, because a build output * directory is not what anyone means to reference. */ export declare function listWorkspaceEntries(cwd: string, limit?: number): Promise; /** * Shallow before deep, directories before files, then alphabetical. * * Depth first because a reference is far more often to `src/engine.ts` than to something eight * levels down, and a picker that has to be scrolled past the whole of `src/` to reach `README.md` * is slower than typing the path by hand. */ export declare function rankEntries(entries: readonly string[]): string[]; /** * Scores a path against what has been typed, or null when it does not match. * * Matching is a subsequence over the whole path, so `egt` finds `src/engine.ts`, but a hit in the * file name beats one spread across directories — typing `chat` should offer `ink-chat.tsx` before * `chat/old/notes.md`. Lower is better. */ export declare function scoreEntry(entry: string, query: string): number | null; /** The best matches for a query, in the order they should be offered. */ export declare function filterEntries(entries: readonly string[], query: string, limit?: number): string[]; /** * Where an `@` reference being typed begins, or -1 if the caret is not in one. * * The `@` only opens a reference at a word boundary, so an email address or a decorator in pasted * code does not trigger the picker. A space ends it, since paths shown here never contain one. */ export declare function activeReference(draft: string, caret: number): { start: number; query: string; } | null; //# sourceMappingURL=workspace-files.d.ts.map