/**
* Oversimplified package.json type definition. Doesn't
* have absolutely everything, and is more of a "reasonable default"
* view.
*/
export type PackageJsonLike = {
dependencies?: Record;
devDependencies?: Record;
exports?: {
[key: string]: {
default?: string;
import?: string;
require?: string;
types?: string;
} & Record;
};
files?: string[];
git?: string | Record;
main?: string;
module?: string;
name: string;
peerDependencies?: Record;
private?: boolean;
publishConfig?: {
access: "public";
};
readme?: string;
repository?: {
directory?: string;
type?: string;
url?: string;
};
scripts?: Record;
types?: string;
typings?: string;
version: string;
};
/**
* Property names for the parts of a package.json which
* may include dependency information.
*/
export declare const DEPENDENCIES_KEYS: readonly ["dependencies", "devDependencies", "peerDependencies"];
/**
* Ensure the given path points to a package.json file and not
* just a directory.
*/
export declare const pathWithPackageJson: (...parts: string[]) => string;
/**
* Read a package.json from the given path, returning it
* as structured data instead of just text.
*/
export declare const readPackageJson: (pathOrModuleName: string) => PackageJsonLike;
/**
* Reasonable order for the keys of a package.json's exports map.
*/
export declare const EXPORTS_ORDER: readonly ["types", "import", "require", "default"];
/**
* Comparator for the keys of a package.json's exports map,
* to ensure they are serialized in the correct order.
*/
export declare const compareExportsKeys: (a: string, b: string) => number;
/**
* Given a package.json's exports map, generate a
* version which should serialize in the correct order.
*/
export declare const remapExports: >(exports: R) => R;
/**
* Mangle a package.json structure to make it serialize properly.
*/
export declare const preparePackageJsonForSerialization: (pkg: PackageJsonLike) => PackageJsonLike;
//# sourceMappingURL=package-json.d.ts.map