///
import { PortablePath, Filename } from '@yarnpkg/fslib';
import { Writable } from 'stream';
import { MultiFetcher } from './MultiFetcher';
import { MultiResolver } from './MultiResolver';
import { Plugin, Hooks } from './Plugin';
import { Report } from './Report';
export declare const ENVIRONMENT_PREFIX = "yarn_";
export declare const DEFAULT_RC_FILENAME: Filename;
export declare const DEFAULT_LOCK_FILENAME: Filename;
export declare enum SettingsType {
BOOLEAN = "BOOLEAN",
ABSOLUTE_PATH = "ABSOLUTE_PATH",
LOCATOR = "LOCATOR",
LOCATOR_LOOSE = "LOCATOR_LOOSE",
STRING = "STRING",
SECRET = "SECRET",
SHAPE = "SHAPE",
MAP = "MAP"
}
export declare type BaseSettingsDefinition = {
description: string;
type: T;
isArray?: boolean;
};
export declare type ShapeSettingsDefinition = BaseSettingsDefinition & {
properties: {
[propertyName: string]: SettingsDefinition;
};
};
export declare type MapSettingsDefinition = BaseSettingsDefinition & {
valueDefinition: SettingsDefinition;
};
export declare type SimpleSettingsDefinition = BaseSettingsDefinition> & {
default: any;
defaultText?: any;
isNullable?: boolean;
};
export declare type SettingsDefinition = MapSettingsDefinition | ShapeSettingsDefinition | SimpleSettingsDefinition;
export declare type PluginConfiguration = {
modules: Map;
plugins: Set;
};
export declare const coreDefinitions: {
[coreSettingName: string]: SettingsDefinition;
};
export declare class Configuration {
startingCwd: PortablePath;
projectCwd: PortablePath | null;
plugins: Map;
settings: Map;
values: Map;
sources: Map;
invalid: Map;
/**
* Instantiate a new configuration object exposing the configuration obtained
* from reading the various rc files and the environment settings.
*
* The `pluginConfiguration` parameter is expected to indicate:
*
* 1. which modules should be made available to plugins when they require a
* package (this is the dynamic linking part - for example we want all the
* plugins to use the exact same version of @yarnpkg/core, which also is the
* version used by the running Yarn instance).
*
* 2. which of those modules are actually plugins that need to be injected
* within the configuration.
*
* Note that some extra plugins will be automatically added based on the
* content of the rc files - with the rc plugins taking precedence over
* the other ones.
*
* One particularity: the plugin initialization order is quite strict, with
* plugins listed in /foo/bar/.yarnrc.yml taking precedence over plugins
* listed in /foo/.yarnrc.yml and /.yarnrc.yml. Additionally, while plugins
* can depend on one another, they can only depend on plugins that have been
* instantiated before them (so a plugin listed in /foo/.yarnrc.yml can
* depend on another one listed on /foo/bar/.yarnrc.yml, but not the other
* way around).
*/
static find(startingCwd: PortablePath, pluginConfiguration: PluginConfiguration | null, { strict, useRc }?: {
strict?: boolean;
useRc?: boolean;
}): Promise;
static findRcFiles(startingCwd: PortablePath): Promise<{
path: PortablePath;
cwd: PortablePath;
data: any;
}[]>;
static findHomeRcFile(rcFilename: string): Promise<{
path: PortablePath;
cwd: PortablePath;
data: any;
} | null>;
static findProjectCwd(startingCwd: PortablePath, lockfileFilename: Filename): Promise;
static updateConfiguration(cwd: PortablePath, patch: any): Promise;
static updateHomeConfiguration(patch: any): Promise;
constructor(startingCwd: PortablePath, projectCwd: PortablePath | null, plugins: Map);
useWithSource(source: string, data: {
[key: string]: unknown;
}, folder: PortablePath, { strict, overwrite }: {
strict?: boolean;
overwrite?: boolean;
}): void;
use(source: string, data: {
[key: string]: unknown;
}, folder: PortablePath, { strict, overwrite }: {
strict?: boolean;
overwrite?: boolean;
}): void;
get(key: string): T;
getSubprocessStreams(prefix: string, { header, report }: {
header?: string;
report: Report;
}): {
logFile: PortablePath;
stdout: Writable;
stderr: Writable;
};
makeResolver(): MultiResolver;
makeFetcher(): MultiFetcher;
getLinkers(): import("./Linker").Linker[];
triggerHook(get: (hooks: HooksDefinition) => ((...args: U) => V) | undefined, ...args: U): Promise;
triggerMultipleHooks(get: (hooks: HooksDefinition) => ((...args: U) => V) | undefined, argsList: Array): Promise;
reduceHook(get: (hooks: HooksDefinition) => ((reduced: V, ...args: U) => Promise) | undefined, initialValue: V, ...args: U): Promise;
format(text: string, color: string): any;
}