/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { ImportAliases } from "./import-aliases.js"; import { Progress } from "./progress.js"; export declare class JsonNotFoundError extends Error { } export declare const CONFIG_PATH = "src/build.config.ts"; export declare const CODEGEN_PATH = "codegen"; export declare class Package { #private; path: string; json: PackageJson; supportsEsm: boolean; supportsCjs: boolean; hasSrc: boolean; hasTests: boolean; hasConfig: boolean; isLibrary: boolean; constructor({ path, name, }?: { path?: string; name?: string; }); findJson(filename: string, path?: string, title?: string): { root: string; json: any; }; get name(): string; get version(): string; get exports(): Exports | undefined; get hasCodegen(): boolean; resolve(...paths: string[]): string; relative(path: string): string; glob(pattern: string | string[]): Promise; start(what: string): Progress; lastModified(...paths: string[]): Promise; private lastModifiedAbsolute; get dependencies(): string[]; get workspace(): Package; get isWorkspace(): boolean; get root(): Package; static set workingDir(wd: string); static get workspace(): Package; static workspaceFor(cwd: string): Package; static get tools(): Package; static findExport(name: string, type?: "cjs" | "esm"): string; resolveExport(name: string, type?: "cjs" | "esm"): string; findPackage(name: string): Package; resolveImport(name: string, type?: "cjs" | "esm"): string; hasFile(path: string): boolean; hasDirectory(path: string): boolean; readFile(path: string): Promise; readFileSync(path: string): string; writeFile(path: string, contents: unknown): Promise; save(): Promise; readJson(path: string): Promise; writeJson(path: string, value: {}): Promise; static maybeForPath(path: string): Package | undefined; static forPath(path: string): Package; get importAliases(): ImportAliases; get modules(): Record; get sourceModules(): Record; /** * Create a map of module name -> implementation file. If "source" is true, searches source files rather than * transpiled files. We do this rather than finding transpilation files then mapping to source files so this works * even if there isn't a build. */ listModules(source: boolean, ...conditions: string[]): Record; } export type PackageJson = { name?: string; version?: string; imports?: Record; matter?: { test?: boolean; }; scripts?: Record; exports?: Exports; module?: string; main?: string; workspaces?: Array; dependencies?: Record; devDependencies?: Record; optionalDependencies?: Record; engines?: Record; [key: string]: unknown; }; type Conditions = { [name: string]: Exports; }; type Exports = string | Conditions | Record; export {}; //# sourceMappingURL=package.d.ts.map