import { JsonSourceFile } from './json-source-file'; import { FileMeta, SourceFile } from './source-file'; import { ResolveResult } from './paths'; type ConditionKey = 'node-addons' | 'node' | 'import' | 'require' | 'module-sync' | 'default' | (string & Record); type ExportTarget = string | null | ExportTarget[] | { [K in ConditionKey]?: ExportTarget; }; type Exports = string | Record; type Imports = Record; type Schema = { name?: string; version?: string; license?: string; main?: string; engines?: Record; exports?: Exports; imports?: Imports; dependencies?: Record; devDependencies?: Record; private?: boolean; workspaces?: string[]; }; export interface EngineSupportResult { engine: string; requirements?: string; incompatible: boolean; } export declare class PackageJsonFile { #private; static FILENAME: string; readonly id: number; jsonFile: JsonSourceFile; basePath: string; mainPaths: string[]; private constructor(); hasExports(): boolean; resolveExportPath(exportPath: string, conditions: ConditionKey[]): ResolveResult; get meta(): FileMeta; get name(): string | undefined; get version(): string | undefined; get dependencies(): Record | undefined; get devDependencies(): Record | undefined; get engines(): Record | undefined; get workspaces(): string[] | undefined; supportsEngine(engine: string, version: string): EngineSupportResult; static make(filePath: string, data: Schema): PackageJsonFile; static loadFromJsonSourceFile(jsonFile: JsonSourceFile): Promise; static loadFromSourceFile(sourceFile: SourceFile): Promise; static loadFromFilePath(filePath: string): Promise; static filePath(dirPath: string): string; upsertDependencies(dependencies: Record): boolean; upsertDevDependencies(dependencies: Record): boolean; toJSON(): string; } export {};