/** * The catalogue's reader (UIG-12): `ui:find `. * * It exists to prove the format. A schema nobody consumes is a schema nobody * has tested, and the questions it has to answer are regression tests, not the * scope: "floating panel" must find `Popover`, "scrolling" `ScrollArea`, * "empty" `EmptyState`. * * It is also the answer to "what do we have for this?", which is the question * the wall cannot answer: a lint rule refuses the wrong thing, and this is * where the right one is named (UIG-20 makes a session ask it first). */ import type { Registry, RegistryEntry } from './schema'; export interface Finding { entry: RegistryEntry; /** How many of the query's words matched anywhere. Ranked on this first. */ matched: number; score: number; /** Which fields matched, for the reader to say why. */ where: string[]; /** * The props the query named **by name**, so the answer shows those rather * than all of them. A prop whose note merely carries one of the words counts * towards the score and is not shown: on "floating panel", six of `Popover`'s * notes say "panel", and printing all six buries the answer. */ props: string[]; } /** * Search name, purpose, behaviours and variants. * * A row that answers more of the question comes first, whatever it scored: * "floating panel" has to reach `Popover`, whose purpose carries both words, * over `MenuPanel`, whose name carries one of them loudly. */ export declare function findInRegistry(registry: Registry, query: string, { limit }?: { limit?: number; }): Finding[]; /** * Search several catalogues as one: the package's, the app's own, and any app * beside it (UIG-13). * * An app's pass-on is not a result of its own — it is the package's part, and * the package's entry answers for it, saying which apps hand it on. At the * same strength the package's part comes first: it is the one to reach for. * And a package part whose name carries one of the words comes before an app's * part answering as many words, whatever each scored: "panel header" put an * app's own `Header`, whose whole name is one of the words, above the package's * `ContainerHeader` (UIG-20). Only by name: a package part the words reach * through its notes alone would bury the app part that is the answer. */ export declare function findInRegistries(registries: Registry[], query: string, { limit }?: { limit?: number; }): Finding[]; /** `http://localhost:6008/?path=/docs/overlays-popover--docs`, or `null` where the entry has no page. */ export declare function docsLink(registry: Registry, entry: RegistryEntry): string | null; /** What the command prints: the import line first, because that is what the reader came for. */ export declare function formatFindings(searched: Registry | Registry[], findings: Finding[], query: string): string; //# sourceMappingURL=find.d.ts.map