///
import { PortablePath } from '@yarnpkg/fslib';
import { CommandClass } from 'clipanion';
import { Writable, Readable } from 'stream';
import { PluginConfiguration, Configuration, ConfigurationDefinitionMap } from './Configuration';
import { Fetcher } from './Fetcher';
import { Linker } from './Linker';
import { MessageName } from './MessageName';
import { Project, InstallOptions } from './Project';
import { Resolver, ResolveOptions } from './Resolver';
import { Workspace } from './Workspace';
import { Locator, Descriptor } from './types';
declare type ProcessEnvironment = {
[key: string]: string;
};
export declare type CommandContext = {
cwd: PortablePath;
plugins: PluginConfiguration;
quiet: boolean;
stdin: Readable;
stdout: Writable;
stderr: Writable;
};
export interface FetcherPlugin {
new (): Fetcher;
}
export interface LinkerPlugin {
new (): Linker;
}
export interface ResolverPlugin {
new (): Resolver;
}
export declare type Hooks = {
registerPackageExtensions?: (configuration: Configuration, registerPackageExtension: (descriptor: Descriptor, extensionData: any) => void) => Promise;
setupScriptEnvironment?: (project: Project, env: ProcessEnvironment, makePathWrapper: (name: string, argv0: string, args: Array) => Promise) => Promise;
wrapScriptExecution?: (executor: () => Promise, project: Project, locator: Locator, scriptName: string, extra: {
script: string;
args: Array;
cwd: PortablePath;
env: ProcessEnvironment;
stdin: Readable | null;
stdout: Writable;
stderr: Writable;
}) => Promise<() => Promise>;
globalHashGeneration?: (project: Project, contributeHash: (data: string | Buffer) => void) => Promise;
reduceDependency?: (dependency: Descriptor, project: Project, locator: Locator, initialDependency: Descriptor, extra: {
resolver: Resolver;
resolveOptions: ResolveOptions;
}) => Promise;
afterAllInstalled?: (project: Project, options: InstallOptions) => void;
validateProject?: (project: Project, report: {
reportWarning: (name: MessageName, text: string) => void;
reportError: (name: MessageName, text: string) => void;
}) => void;
validateWorkspace?: (workspace: Workspace, report: {
reportWarning: (name: MessageName, text: string) => void;
reportError: (name: MessageName, text: string) => void;
}) => void;
populateYarnPaths?: (project: Project, definePath: (path: PortablePath | null) => void) => Promise;
};
export declare type Plugin = {
configuration?: Partial;
commands?: Array>;
fetchers?: Array;
linkers?: Array;
resolvers?: Array;
hooks?: PluginHooks;
};
export {};