import { FakeFS, Filename, PortablePath } from '@yarnpkg/fslib'; import { Resolution } from '@yarnpkg/parsers'; import { Ident, Descriptor } from './types'; import { IdentHash } from './types'; export type AllDependencies = `dependencies` | `devDependencies` | `peerDependencies`; export type HardDependencies = `dependencies` | `devDependencies`; export interface WorkspaceDefinition { pattern: string; } export interface DependencyMeta { built?: boolean; optional?: boolean; unplugged?: boolean; } export interface PeerDependencyMeta { optional?: boolean; } export interface PublishConfig { access?: string; bin?: Map; browser?: PortablePath | Map; executableFiles?: Set; main?: PortablePath; module?: PortablePath; provenance?: boolean; registry?: string; type?: string; } export interface InstallConfig { hoistingLimits?: string; selfReferences?: boolean; } export declare class Manifest { indent: string; name: Ident | null; version: string | null; os: Array | null; cpu: Array | null; libc: Array | null; type: string | null; packageManager: string | null; [`private`]: boolean; license: string | null; main: PortablePath | null; module: PortablePath | null; browser: PortablePath | Map | null; languageName: string | null; bin: Map; scripts: Map; dependencies: Map; devDependencies: Map; peerDependencies: Map; workspaceDefinitions: Array; dependenciesMeta: Map>; peerDependenciesMeta: Map; resolutions: Array<{ pattern: Resolution; reference: string; }>; files: Set | null; publishConfig: PublishConfig | null; installConfig: InstallConfig | null; preferUnplugged: boolean | null; raw: { [key: string]: any; }; /** * errors found in the raw manifest while loading */ errors: Array; static readonly fileName: Filename; static readonly allDependencies: Array; static readonly hardDependencies: Array; static tryFind(path: PortablePath, { baseFs }?: { baseFs?: FakeFS; }): Promise; static find(path: PortablePath, { baseFs }?: { baseFs?: FakeFS; }): Promise; static fromFile(path: PortablePath, { baseFs }?: { baseFs?: FakeFS; }): Promise; static fromText(text: string): Manifest; loadFromText(text: string): void; loadFile(path: PortablePath, { baseFs }: { baseFs?: FakeFS; }): Promise; load(data: any, { yamlCompatibilityMode }?: { yamlCompatibilityMode?: boolean; }): void; getForScope(type: string): Map; hasConsumerDependency(ident: Ident): boolean; hasHardDependency(ident: Ident): boolean; hasSoftDependency(ident: Ident): boolean; hasDependency(ident: Ident): boolean; getConditions(): string | null; ensureDependencyMeta(descriptor: Descriptor): DependencyMeta; ensurePeerDependencyMeta(descriptor: Descriptor): PeerDependencyMeta; setRawField(name: string, value: any, { after }?: { after?: Array; }): void; exportTo(data: { [key: string]: any; }, { compatibilityMode }?: { compatibilityMode?: boolean; }): { [key: string]: any; }; }