import type { Documented, Entry, Help, Opening } from '@variance-authority/package/help'; import { type Members } from './members.js'; import { type Spelling } from '@variance-authority/mcp/tools'; /** * Locating the thing a question is about, and answering well when it is not there. * * Every such answer names what *is* there. A model handed "unknown package" has * one move left, which is to guess again; a model handed the list has the answer * in the same turn. The list is the expensive part of the reading and it has * already been read, so withholding it buys nothing. */ /** What a workspace with no published package is told, wherever it would have been listed. */ export declare const NOTHING_PUBLISHED = "this workspace publishes no package: no manifest it declares is both named and public"; /** The door a subpath names, written the way somebody would import it. */ export declare function specifierOf(published: Pick, opening: Pick): string; export declare function packageOf(help: Help, name: string): Documented; export declare function openingOf(published: Documented, subpath: string | undefined): Opening; /** * The door a caller named, whether they named it as a package and a subpath or * as the one string that `docs_packages` prints and an import line carries. * * `docs_packages` answers with specifiers — `@scope/name/tools` — and a caller * who hands one straight back is doing what the answer told them to. Refusing * it as an unknown package and printing the thirty-five names it *is* one of * is a form mismatch dressed as a fact, and it was the most common wrong turn * on the way from the first question to the third. * * A package name wins when both readings are possible, because a subpath given * alongside says which reading the caller meant. Otherwise the longest package * name that prefixes the string is the package and the rest is its subpath; * longest, because `@scope/a` and `@scope/a-b` are both packages and a prefix * rule that stopped at the first would open the wrong one. */ export declare function doorOf(help: Help, specifier: string, subpath: string | undefined): readonly [Documented, Opening]; /** Whether a published package is the one a caller named, by its name or by any specifier it opens. */ export declare function isPackage(published: Documented, opening: Opening, wanted: string): boolean; /** * Every place a name is published. * * A list rather than one entry, because a barrel and a subpath publishing the * same declaration is normal and answering with whichever came first would make * the import line a coin flip. */ export declare function entriesNamed(help: Help, name: string): readonly (readonly [Documented, Opening, Entry])[]; /** * Why a name was not found, said so the next question is the right one. * * Exact matching is the contract of `docs_symbol` and `docs_uses`, and it * stays: a precise question gets a fact, never a guess dressed as an answer. * But the refusal is allowed to know what the search would have said. When * exactly one published name differs only in case, that is the name, and * saying so costs the caller one hop instead of three; when the name is a * substring of several, the count says whether `search` is worth asking. */ export declare function unfound(help: Help, name: string, within: string | undefined, spell: Spelling): string; /** * A name a question looked for and did not find, said as an answer rather * than a refusal: what was read and found nothing, and where else the name * may be written. It is thrown, not returned, so a surface tells it from a * found answer; it is given as the answer from the generation it was read * from, whose date line says when the checkout was not compared with it: * `variance ask` and `variance-authority-help` print it on stdout and exit cleanly. */ export declare class FoundNothing extends Error { readonly name = "FoundNothing"; } /** * The answer for a name nothing in the workspace declares: that no file * declares it, then, given `dependencies`, what is known of the installed * ones, then where the reading of members stopped, then that a name written * only as text is a text search's to find, then the files the source * index holds no declarations of. Where the index could not be read, that is * said in place of a claim about the files. Members are read from JavaScript * and TypeScript only, so where the index holds files of another language the * claim about members is made of those two, and the others are named. */ export declare function nowhere(help: Help, name: string, wanted: string | undefined, root: string | undefined, members: Members | undefined, dependencies: string | undefined, spell: Spelling, limit: number): string; //# sourceMappingURL=find.d.ts.map