/** * Names a file exports and no entry publishes, answered rather than refused. * * Exported for a neighbour and never published is most of any repository. A * caller who typed such a name exactly is not wrong about the name, only about * the door: `symbol` says where it is declared, and `uses` lists who imports it. * * The Help value records the imports that cross a package, and an import within * one is most of what an unpublished name has. So the imports come from the * source index, which holds every file's requests and what each resolved to: * an import counts when it resolved to a file that exports the name, or to a * file that passes it on with `export … from`, which is followed and is no use. */ import type { Help, Named, Taken, Use } from '@variance-authority/package/help'; /** What an import count leaves out: a use that names the export without importing it. */ export declare const UNCOUNTED = "a namespace imported by name that goes somewhere whole and, outside Rust, a call through a qualified path are not counted"; /** * Every export of `name` from ordinary source, in `within` when one is named, * and every default export its declaration is named `name` by. */ export declare function exportsNamed(help: Help, root: string | undefined, name: string, within: string | undefined): readonly Named[]; /** `at:line`, and how many more exports there are past the first. */ export declare function exportedAt(exported: readonly Named[]): string; /** One use the source index resolved, with the specifier its file wrote. */ export type IndexedUse = Taken & { readonly specifier: string; /** The lines of the importing file that use what the import binds; absent for a member read, which binds nothing. */ readonly lines?: readonly number[]; }; /** * A namespace one file passes a name on inside: `export * as shout` passes * `greet` as `shout.greet`, `name` `shout` and `members` `['greet']`. */ export interface PassedInside { readonly at: string; readonly name: string; readonly members: readonly string[]; } /** * What the source index says about the imports of one name out of a set of * files: each use with the name it takes, every file that passes the name on * with `export … from`, every namespace one passes it on inside, and each line * of one of the files that uses the name it declares there; or why it could * not be read. */ export type Within = { readonly uses: readonly IndexedUse[]; readonly through: readonly string[]; readonly namespaces: readonly PassedInside[]; readonly inFile: readonly Use[]; } | { readonly unread: string; }; /** * Every import of `name` out of one of `files`, or out of a file that passes it * on from one, read off the source index of `root`, or why that index says * nothing: no checkout named, none published, or one that does not read. */ export declare function importsOf(root: string | undefined, files: readonly string[], name: string): Within; /** One file asked who imports a name out of it, and the name it exports it under. */ export type Asked = { readonly file: string; readonly name: string; }; /** What the source index says one file asked about answers alone: its uses and the files passing it on, or why it could not be read. */ export type Apart = { readonly uses: readonly IndexedUse[]; readonly through: readonly string[]; } | { readonly unread: string; }; /** * `importsOf` for each asked file and name apart, in the order asked, read in * one walk: the imports of the name out of that file, or a file passing it on * from it, and the files passing it on, that file left out. */ export declare function importsApart(root: string | undefined, asked: readonly Asked[]): readonly Apart[]; /** The refusal when the imports cannot be read: the export is known, the index that holds its importers is not. */ export declare function indexMissing(name: string, exported: readonly Named[], unread: string): string; //# sourceMappingURL=unpublished.d.ts.map