import * as util from "node:util"; import type { PkgManagerName } from "./pkg_manager.ts"; export declare let DEBUG: boolean; export declare function setDebug(enabled: boolean): void; export declare function logDebug(msg: string): void; export declare class JsrPackageNameError extends Error { } export declare class JsrPackage { scope: string; name: string; version: string | null; private constructor(); static from(input: string): JsrPackage; toNpmPackage(): string; toString(): string; } export declare function fileExists(file: string): Promise; export interface ProjectInfo { projectDir: string; pkgManagerName: PkgManagerName | null; pkgJsonPath: string | null; root: string | null; } export declare function findProjectDir(cwd: string, dir?: string, result?: ProjectInfo): Promise; export declare function prettyTime(diff: number): string; export declare function timeAgo(diff: number): string; export declare class ExecError extends Error { code: number; constructor(code: number); } export interface ExecOutput { combined: string; stdout: string; stderr: string; } export declare function exec(cmd: string, args: string[], cwd: string, env?: Record, captureOutput?: boolean): Promise; export declare function getNewLineChars(source: string): "\n" | "\r\n"; export declare function readJson(file: string): Promise; export interface PkgJson { name?: string; version?: string; license?: string; workspaces?: string[]; dependencies?: Record; devDependencies?: Record; optionalDependencies?: Record; exports?: string | Record>; scripts?: Record; } export declare function writeJson(file: string, data: T): Promise; export declare function readTextFile(file: string): Promise; export declare function writeTextFile(file: string, content: string): Promise; export declare const styleText: typeof util.styleText;