import { type FileSource } from "./repo-files.ts"; /** * Package-manager commands in docs are references to `package.json#scripts.` that name * no file: the manager in `packageManager` is the prefix, the nearest package.json the owner. */ type PackageManager = "npm" | "pnpm" | "yarn" | "bun"; interface PackageJson { packageManager?: unknown; engines?: { node?: unknown; }; scripts?: Record; } interface ScriptReference { script: string; command: string; line: number; } interface ToolchainFact { field: "packageManager" | "engines.node"; value: string; } export declare function packageManagerOf(pkg: PackageJson): PackageManager | null; /** ` run ` and ` ` in inline code and shell fences. */ export declare function scriptReferences(markdown: string, pm: PackageManager): ScriptReference[]; /** Exact toolchain values the instruction file beside this package.json must quote. */ export declare function toolchainFacts(pkg: PackageJson): ToolchainFact[]; /** True when an inline code span in the document is exactly this value. */ export declare function quotesValue(markdown: string, value: string): boolean; export declare function parsePackageJson(content: string | null): PackageJson | null; /** Repo-relative path of the package.json nearest the document, or null when none owns it. */ export declare function owningPackageJson(root: string, docPath: string, source?: FileSource): string | null; export {};