/// import { NativePath, PortablePath } from '@yarnpkg/fslib'; import { Readable, Writable } from 'stream'; import { Configuration } from './Configuration'; import { Project } from './Project'; import { Report } from './Report'; import { Workspace } from './Workspace'; import { Locator } from './types'; export declare function makeScriptEnv({ project, lifecycleScript }?: { project?: Project; lifecycleScript?: string; }): Promise<{ [key: string]: string; } & { BERRY_BIN_FOLDER: string; }>; /** * Given a folder, prepares this project for use. Runs `yarn install` then * `yarn build` if a `package.json` is found. */ export declare function prepareExternalProject(cwd: PortablePath, outputPath: PortablePath, { configuration, report }: { configuration: Configuration; report: Report; }): Promise; declare type HasPackageScriptOption = { project: Project; }; export declare function hasPackageScript(locator: Locator, scriptName: string, { project }: HasPackageScriptOption): Promise; declare type ExecutePackageScriptOptions = { cwd?: PortablePath | undefined; project: Project; stdin: Readable | null; stdout: Writable; stderr: Writable; }; export declare function executePackageScript(locator: Locator, scriptName: string, args: Array, { cwd, project, stdin, stdout, stderr }: ExecutePackageScriptOptions): Promise; export declare function executePackageShellcode(locator: Locator, command: string, args: Array, { cwd, project, stdin, stdout, stderr }: ExecutePackageScriptOptions): Promise; declare type ExecuteWorkspaceScriptOptions = { cwd?: PortablePath | undefined; stdin: Readable | null; stdout: Writable; stderr: Writable; }; export declare function executeWorkspaceScript(workspace: Workspace, scriptName: string, args: Array, { cwd, stdin, stdout, stderr }: ExecuteWorkspaceScriptOptions): Promise; export declare function hasWorkspaceScript(workspace: Workspace, scriptName: string): Promise; declare type GetPackageAccessibleBinariesOptions = { project: Project; }; /** * Return the binaries that can be accessed by the specified package * * @param locator The queried package * @param project The project owning the package */ export declare function getPackageAccessibleBinaries(locator: Locator, { project }: GetPackageAccessibleBinariesOptions): Promise>; /** * Return the binaries that can be accessed by the specified workspace * * @param workspace The queried workspace */ export declare function getWorkspaceAccessibleBinaries(workspace: Workspace): Promise>; declare type ExecutePackageAccessibleBinaryOptions = { cwd: PortablePath; project: Project; stdin: Readable | null; stdout: Writable; stderr: Writable; }; /** * Execute a binary from the specified package. * * Note that "binary" in this sense means "a Javascript file". Actual native * binaries cannot be executed this way, because we use Node in order to * transparently read from the archives. * * @param locator The queried package * @param binaryName The name of the binary file to execute * @param args The arguments to pass to the file */ export declare function executePackageAccessibleBinary(locator: Locator, binaryName: string, args: Array, { cwd, project, stdin, stdout, stderr }: ExecutePackageAccessibleBinaryOptions): Promise; declare type ExecuteWorkspaceAccessibleBinaryOptions = { cwd: PortablePath; stdin: Readable | null; stdout: Writable; stderr: Writable; }; /** * Execute a binary from the specified workspace * * @param workspace The queried package * @param binaryName The name of the binary file to execute * @param args The arguments to pass to the file */ export declare function executeWorkspaceAccessibleBinary(workspace: Workspace, binaryName: string, args: Array, { cwd, stdin, stdout, stderr }: ExecuteWorkspaceAccessibleBinaryOptions): Promise; export {};