import type { Documented, Entry, Opening, Use } from '@variance-authority/package/help'; /** * The two shapes every answer here is made of. * * A line, for a list, and a block, for the one thing that was asked about. The * split is a budget: a list of two hundred names that each carried a signature * and a paragraph would spend a context window on the two hundred names the * asker did not want, and a model that runs out of room mid-list cannot tell * that it did. */ /** * Who imports this, counted first and named second. * * The count leads because it is what a reader ranks on, and the names are capped * because a name imported by fifteen packages would otherwise spend a paragraph * saying so — in a list where the next line is a different name. A cap that says * it is a cap costs six words and never reads as a complete list. */ export declare function audience(entry: Entry, cap: number): string; /** * What the caller read of the places that may read a name: `may`, reads off * the module's `default` and the module passed on whole, which are no use of * it, and whether any place imports it for certain. The caller partitions the * sites, so every line of one answer names the same places. */ export interface Undecided { readonly may: readonly Use[]; readonly imported: boolean; } /** * How many other packages reach for this by its published path, in the words * an asker ranks on, and where it may be read. The imports inside its own * package are not in the Help value, and the caller that reads them counts * them apart. */ export declare function reach(entry: Entry, { may, imported }: Undecided): string; /** What a list line reads of a published name: the audience counted, never named. */ export interface Listed { readonly name: string; readonly kind: string; readonly doc?: string; readonly usedBy: { readonly length: number; }; readonly uses: number; } /** One name in a list: what it is, how used it is, and the first thing its doc says. */ export declare function line(entry: Listed): string; /** * The imports of a name other packages write by a path it is published from, * and how many packages write them: what the Help value counts beside each * entry, which leaves out the imports within its own package and by file path. */ export declare function byPublishedPath(imports: number, packages: number): string; /** `block` after what `lines` already holds, a blank line between them. */ export declare function section(lines: string[], ...block: readonly string[]): void; /** `count` and the noun, singular at one. */ export declare const plural: (count: number, one: string, many?: string) => string; /** An argument a shell passes through unchanged, quoted only when it would not be. */ export declare function shell(value: string): string; /** A compact list: the requested names (five by default), the number omitted, and `whole` when it can show what the line omits. */ export declare function named(head: string, names: readonly string[], total: number, whole: string, limit?: number): readonly string[]; /** The commands that take an answer further, after a blank line and a heading; nothing when there are none. */ export declare function narrower(asks: readonly string[]): readonly string[]; /** ` — N names, U imported elsewhere, D documented`. */ export declare function openingRow(published: Documented, held: Opening): string; /** The specifier whose names the most packages import, ties in code-unit order; none when nothing imports any. */ export declare function mostUsed(opened: readonly (readonly [Documented, Opening])[]): readonly [Documented, Opening] | undefined; /** The line a caller writes to reach this name; a default export is imported by `named`, and by no line when nothing names it. */ export declare function importing(published: Documented, held: Opening, entry: Entry, named?: string): readonly string[]; /** One name in full, including the head somebody would copy; `named` is the name the declaration is keyed by. */ export declare function block(published: Documented, held: Opening, entry: Entry, undecided: Undecided, named?: string): string; /** * What the project says about a name, and which of the two places it said it. * * A doc comment answers directly. For a name with nothing above it there is one * more place to look before reporting silence, and the passage that comes back * is labelled with the file it came from rather than dressed as a doc comment. * The label is the whole point: a reader told *the README says this* knows the * prose was written about a package and may not describe the signature above, * and a reader handed the same paragraph unlabelled does not. */ export declare function said(entry: Entry): readonly string[]; /** One located row: a file, a line in it, and what stands there. */ export interface Located { readonly file: string; readonly line: number; readonly text: string; /** What the row adds about that line, said on the line below it. */ readonly note?: string; } /** `12: text`, the line and what stands on it, under a file already named. */ export declare const atLine: (line: number, text: string) => string; /** * Rows in their order, a run of one file's rows said under that file once: * a file with one row is `file:line: text`, a file with several is the file, * then ` line: text` per row. A row's note follows it, one step deeper. */ export declare function byFile(rows: readonly Located[]): readonly string[]; /** * The longest run of steps every chain on a page ends with, when two chains or * more share one; none otherwise. Even the target alone is worth saying once: * it is the longest step of every row. The run stops short of every chain's * first step, so no row's own file is folded into the end it shares. */ export declare function chainsEnd(chains: readonly (readonly string[])[]): readonly string[]; /** * A chain short of the end every chain on its page shares: its own steps, * then `→ …` where the shared end follows. A chain is never cut below its * first step, the file the row is about. */ export declare function ownSteps(chain: readonly string[], end: readonly string[]): string; //# sourceMappingURL=format.d.ts.map