/** * Where a member is declared and used, which no import names. * * A method or property of an interface, a type literal or a class is reached * through a value, never imported, so the module graph lists nobody who * declares or calls one. Its declarations are a fact of the parse: the scan * records every member each file declares, on the container that holds it, * and this reads the ones by one name off the source index. * * So are its uses where the line writes the value's type: a binding annotated * as the container, a cast to it, an object literal written as one, a pattern * destructuring one. The scan records the type's name as each file writes it, * and the index joins that name to the declaration through the import that * binds it, so each use is listed under the one declaration it belongs to, * whatever other container shares the member's name. * * A value whose type the line does not write — inferred from a call, a * generic, a subtype, a JSX attribute, a utility type — has the type a type * checker gives it, and none runs here. Type resolution is the checker's of the * declaration's language, TypeScript's for JavaScript and TypeScript, so the * answer says where its own reading stops and names the declaration to ask * that checker's find-references about, rather than copying a type rule or * passing a text search off as the uses. */ import type { Help, Use } from '@variance-authority/package/help'; import type { Spelling } from '@variance-authority/mcp/tools'; /** The declarations of a member by one name. */ export interface Members { /** The member asked for, without the container a dotted name puts it on. */ readonly member: string; /** The container a dotted name puts the member on, as written. */ readonly on?: string; /** Each declaration, `by` the container it is on. */ readonly declared: readonly Use[]; /** * Each declaration on a named container, in `declared`'s order, with every * line that uses the member through a value written as that container, `by` * the package and how it uses it. */ readonly used: readonly { readonly declared: Use; readonly uses: readonly (Use & { readonly how: string; })[]; }[]; /** Why the declarations were not read, when they were not. */ readonly unread?: string; /** * The languages of the files the source index holds whose members the scan * does not record, by name; absent when the declarations were not read. */ readonly elsewhere?: readonly string[]; } /** Whether a container is told by what it is, having no name to write. */ export declare const isUnnamedContainer: (by: string) => boolean; /** The container a member is declared on, as a sentence names it. */ export declare function containerOf(by: string): string; /** * The member a name asks for and the container it is on: `Tree.chainsTo` is * `chainsTo` on `Tree`, read off the last dot as written, never resolved. A * name that is no path of identifiers, `src/tax.ts` or `@acme/kit`, asks for * itself. */ export declare function memberName(name: string): { readonly member: string; readonly on?: string; }; /** * The declarations of member `name` the source index of the checkout at * `root` records, in the package `wanted` names when it names one; none, and * why, when no checkout is named or the index does not read. A name written * `Container.member` keeps the declarations on the container by that name. */ export declare const membersOf: (help: Help, root: string | undefined, name: string, wanted: string | undefined) => Members; /** Which uses the answer lists, and which it leaves to a type checker, said once under the uses. */ export declare const TYPED: string; /** Whose go-to-definition or go-to-implementation answers past what the bodies read here declare, by `checkerOf`'s answer. */ export declare const CHECKER: { readonly typescript: "TypeScript's language service's"; readonly other: "its language server's"; readonly mixed: "each declaration's own language server's"; }; /** Whose type checker answers for declarations in these files: TypeScript's for JavaScript and TypeScript alone, `other` for one other language, `mixed` for several. */ export declare function checkerOf(files: readonly string[]): 'typescript' | 'other' | 'mixed'; /** * Where the uses no line types are found: find-references on the one * declaration of member `name`, or, when several declare it, on the one the * reader means among those the answer lists, which `package` narrows to when * the list is cut. It is asked of the type checker of the language the * declarations are written in: TypeScript's language service for JavaScript * and TypeScript, that language's own language server for any other, and each * declaration's own when they are written in more than one. Its * go-to-implementation on the same declaration names the implementations * that take their type from where they go, which write none on their line. */ export declare function routes(members: Members, spell: Spelling): readonly string[]; /** The languages of the checkout at `root` whose members were not read, by name; none when its index does not read. */ export declare function membersUnreadOf(root: string, name: string): readonly string[]; /** * Where a reading of the member asked for stops, given the languages `elsewhere` * names: members are read from JavaScript and TypeScript only, so a member of * those languages' files is their language server's to find, beside any * declaration the answer lists. Nothing when there are none, or the * declarations were not read. */ export declare function membersStop(members: Members): string | undefined; /** Where a search for words stops, given the same languages: its question may be a phrase, so it names no member. */ export declare function unreadStop(languages: readonly string[]): string | undefined; /** Why no member of `file` is listed when its language's members are not read; nothing when they are. */ export declare function membersNotReadIn(file: string): string | undefined; /** `N places`, in words a sentence takes. */ export declare function places(count: number): string; //# sourceMappingURL=members.d.ts.map