/** * A package name including the scope. */ export type PackageName = `@${string}/${string}`; /** * A version string. */ export type Version = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`; /** * Split a full package name into its scope and name. * @param fullName The full package name. * @returns The scope and name. */ export declare function splitPackageName(fullName: PackageName): [string, string]; /** * A symbol in a package. */ export interface Symbol { id: string; kind: SymbolKind[]; name: string; file: string; doc: string; url: string; deprecated: boolean; } /** * A kind of a {@link Symbol}. */ export interface SymbolKind { kind: string; char: string; title: string; } /** * Fetch the docs-latest version of a package. * @param packageName A package name including the scope. * @returns The latest version JSR serves documentation for. */ export declare function fetchDocsLatestVersion(packageName: PackageName): Promise; /** * Get the symbols in a package. * @param packageName A package name including the scope. * @param version A version string. * @returns The symbols. */ export declare function fetchSymbols(packageName: PackageName, version: Version): Promise; /** * An entry in the index. */ export type IndexEntry = Symbol & { label: string; }; /** * An index of a package. */ export type Index = Record; /** * An index and the version JSR served documentation for. */ export interface FetchIndexResult { index: Index; version: Version; } /** * Get the index of a package and the version JSR served documentation for. * @param packageName A package name including the scope. * @param version A version string. * @returns The index of a package and the resolved docs version. */ export declare function fetchIndexWithVersion(packageName: PackageName, version: Version): Promise; /** * Get the index of a package. * @param packageName A package name including the scope. * @param version A version string. * @returns The index of a package. */ export declare function fetchIndex(packageName: PackageName, version: Version): Promise; /** * Fetch the latest version of a package. * @param packageName A package name including the scope. * @param unstable Whether to include unstable versions. * @returns The latest version of the package. If no version is found, * `null` is returned. */ export declare function fetchLatestVersion(packageName: PackageName, unstable?: boolean): Promise; //# sourceMappingURL=jsr.d.ts.map