import { Cache, DescriptorHash, Descriptor, Ident, Locator, Project, Workspace, Configuration } from '@yarnpkg/core'; import { PortablePath } from '@yarnpkg/fslib'; export type Suggestion = { descriptor: Descriptor; name: string; reason: string; }; export type NullableSuggestion = { descriptor: Descriptor | null; name: string; reason: string; }; export type Results = { suggestions: Array; rejections: Array; }; export declare enum Target { REGULAR = "dependencies", DEVELOPMENT = "devDependencies", PEER = "peerDependencies" } export declare enum Modifier { CARET = "^", TILDE = "~", EXACT = "" } export declare enum WorkspaceModifier { CARET = "^", TILDE = "~", EXACT = "*" } export declare enum Strategy { /** * If set, the suggest engine will offer to keep the current version if the * local workspace already depends on it. */ KEEP = "keep", /** * If set, the suggest engine will offer to fulfill the request by looking at * the ranges currently used by the other workspaces in the project. */ REUSE = "reuse", /** * If set, the suggest engine will offer to fulfill the request by using any * workspace whose name would match the request. */ PROJECT = "project", /** * If set, the suggest engine will offer to fulfill the request by using * whatever `@latest` would return. */ LATEST = "latest", /** * If set, the suggest engine will offer to fulfill the request based on the * versions of the package that are already within our cache. */ CACHE = "cache" } export declare function disableTimeGate(configuration: Configuration): void; export declare function getModifier(flags: { exact: boolean; caret: boolean; tilde: boolean; }, project: Project): Modifier; export declare function extractRangeModifier(range: string, { project }: { project: Project; }): string; export declare function applyModifier(descriptor: Descriptor, modifier: Modifier): Descriptor; export declare function toWorkspaceModifier(modifier: Modifier): WorkspaceModifier; export declare function makeWorkspaceDescriptor(workspace: Workspace, modifier: Modifier): Descriptor; export declare function findProjectDescriptors(ident: Ident, { project, target }: { project: Project; target: Target; }): Promise; }>>; export declare function extractDescriptorFromPath(path: PortablePath, { cwd, workspace }: { cwd: PortablePath; workspace: Workspace; }): Promise; export declare function getSuggestedDescriptors(request: Descriptor, { project, workspace, cache, target, fixed, modifier, strategies, maxResults }: { project: Project; workspace: Workspace; cache: Cache; target: Target; fixed: boolean; modifier: Modifier; strategies: Array; maxResults?: number; }): Promise; export type FetchDescriptorFromOptions = { project: Project; cache: Cache; workspace: Workspace; } & ({ preserveModifier?: boolean | string; modifier?: undefined; } | { preserveModifier?: undefined; modifier: Modifier; }); export declare function fetchDescriptorFrom(ident: Ident, range: string, { project, cache, workspace, preserveModifier, modifier }: FetchDescriptorFromOptions): Promise;