import { NativePath, PortablePath, Path } from '@yarnpkg/fslib';
export declare enum LinkType {
HARD = "HARD",
SOFT = "SOFT"
}
export declare type PhysicalPackageLocator = {
name: string;
reference: string;
};
export declare type TopLevelPackageLocator = {
name: null;
reference: null;
};
export declare type PackageLocator = PhysicalPackageLocator | TopLevelPackageLocator;
export declare type DependencyTarget = string | [string, string] | null;
export declare type PackageInformation
= {
packageLocation: P;
packageDependencies: Map;
packagePeers: Set;
linkType: LinkType;
discardFromLookup: boolean;
};
export declare type PackageInformationData = {
packageLocation: P;
packageDependencies: Array<[string, DependencyTarget]>;
packagePeers?: Array;
linkType: LinkType;
discardFromLookup?: boolean;
};
export declare type PackageStore = Map>;
export declare type PackageStoreData = Array<[string | null, PackageInformationData]>;
export declare type PackageRegistry = Map;
export declare type PackageRegistryData = Array<[string | null, PackageStoreData]>;
export declare type LocationBlacklistData = Array;
export declare type LocationLengthData = Array;
export declare type SerializedState = {
__info: Array;
enableTopLevelFallback: boolean;
fallbackExclusionList: Array<[string, Array]>;
fallbackPool: Array<[string, DependencyTarget]>;
ignorePatternData: string | null;
locationBlacklistData: LocationBlacklistData;
packageRegistryData: PackageRegistryData;
dependencyTreeRoots: Array;
};
export declare type RuntimeState = {
basePath: PortablePath;
enableTopLevelFallback: boolean;
fallbackExclusionList: Map>;
fallbackPool: Map;
ignorePattern: RegExp | null;
packageLocationLengths: Array;
packageLocatorsByLocations: Map;
packageRegistry: PackageRegistry;
dependencyTreeRoots: Array;
};
export declare type PnpSettings = {
blacklistedLocations?: Iterable;
enableTopLevelFallback?: boolean;
fallbackExclusionList?: Array;
fallbackPool?: Map;
ignorePattern?: string | null;
packageRegistry: PackageRegistry;
shebang?: string | null;
dependencyTreeRoots: Array;
};
export declare type PnpApi = {
VERSIONS: {
std: number;
[key: string]: number;
};
topLevel: {
name: null;
reference: null;
};
getLocator: (name: string, referencish: string | [string, string]) => PhysicalPackageLocator;
getDependencyTreeRoots: () => Array;
getPackageInformation: (locator: PackageLocator) => PackageInformation | null;
findPackageLocator: (location: NativePath) => PhysicalPackageLocator | null;
resolveToUnqualified: (request: string, issuer: NativePath | null, opts?: {
considerBuiltins?: boolean;
}) => NativePath | null;
resolveUnqualified: (unqualified: NativePath, opts?: {
extensions?: Array;
}) => NativePath;
resolveRequest: (request: string, issuer: NativePath | null, opts?: {
considerBuiltins?: boolean;
extensions?: Array;
}) => NativePath | null;
resolveVirtual?: (p: NativePath) => NativePath | null;
getAllLocators?: () => Array;
};