import { PulumiCommand } from "./cmd";
import { ConfigMap, ConfigValue } from "./config";
import { ProjectSettings } from "./projectSettings";
import { OutputMap, Stack } from "./stack";
import { StackSettings } from "./stackSettings";
import { TagMap } from "./tag";
import { Deployment, PluginInfo, PulumiFn, StackSummary, WhoAmIResult, Workspace } from "./workspace";
/**
 * LocalWorkspace is a default implementation of the Workspace interface.
 * A Workspace is the execution context containing a single Pulumi project, a program,
 * and multiple stacks. Workspaces are used to manage the execution environment,
 * providing various utilities such as plugin installation, environment configuration
 * ($PULUMI_HOME), and creation, deletion, and listing of Stacks.
 * LocalWorkspace relies on Pulumi.yaml and Pulumi.<stack>.yaml as the intermediate format
 * for Project and Stack settings. Modifying ProjectSettings will
 * alter the Workspace Pulumi.yaml file, and setting config on a Stack will modify the Pulumi.<stack>.yaml file.
 * This is identical to the behavior of Pulumi CLI driven workspaces.
 *
 * @alpha
 */
export declare class LocalWorkspace implements Workspace {
    /**
     * The working directory to run Pulumi CLI commands
     */
    readonly workDir: string;
    /**
     * The directory override for CLI metadata if set.
     * This customizes the location of $PULUMI_HOME where metadata is stored and plugins are installed.
     */
    readonly pulumiHome?: string;
    /**
     * The secrets provider to use for encryption and decryption of stack secrets.
     * See: https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers
     */
    readonly secretsProvider?: string;
    private _pulumiCommand?;
    /**
     * The underlying Pulumi CLI.
     */
    get pulumiCommand(): PulumiCommand;
    /**
     *  The inline program `PulumiFn` to be used for Preview/Update operations if any.
     *  If none is specified, the stack will refer to ProjectSettings for this information.
     */
    program?: PulumiFn;
    /**
     * Environment values scoped to the current workspace. These will be supplied to every Pulumi command.
     */
    envVars: {
        [key: string]: string;
    };
    private _pulumiVersion?;
    /**
     * The version of the underlying Pulumi CLI/Engine.
     *
     * @returns A string representation of the version, if available. `null` otherwise.
     */
    get pulumiVersion(): string;
    private ready;
    /**
     * Whether the workspace is a remote workspace.
     */
    private remote?;
    /**
     * Remote Git source info.
     */
    private remoteGitProgramArgs?;
    /**
     * An optional list of arbitrary commands to run before the remote Pulumi operation is invoked.
     */
    private remotePreRunCommands?;
    /**
     * The environment variables to pass along when running remote Pulumi operations.
     */
    private remoteEnvVars?;
    /**
     * Whether to skip the default dependency installation step.
     */
    private remoteSkipInstallDependencies?;
    /**
     * Whether to inherit the deployment settings set on the stack.
     */
    private remoteInheritSettings?;
    /**
     * Creates a workspace using the specified options. Used for maximal control and customization
     * of the underlying environment before any stacks are created or selected.
     *
     * @param opts Options used to configure the Workspace
     */
    static create(opts: LocalWorkspaceOptions): Promise<LocalWorkspace>;
    /**
     * Creates a Stack with a LocalWorkspace utilizing the local Pulumi CLI program from the specified workDir.
     * This is a way to create drivers on top of pre-existing Pulumi programs. This Workspace will pick up
     * any available Settings files (Pulumi.yaml, Pulumi.<stack>.yaml).
     *
     * @param args A set of arguments to initialize a Stack with a pre-configured Pulumi CLI program that already exists on disk.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static createStack(args: LocalProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    /**
     * Creates a Stack with a LocalWorkspace utilizing the specified inline (in process) Pulumi program.
     * This program is fully debuggable and runs in process. If no Project option is specified, default project settings
     * will be created on behalf of the user. Similarly, unless a `workDir` option is specified, the working directory
     * will default to a new temporary directory provided by the OS.
     *
     * @param args A set of arguments to initialize a Stack with and inline `PulumiFn` program that runs in process.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static createStack(args: InlineProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    /**
     * Selects a Stack with a LocalWorkspace utilizing the local Pulumi CLI program from the specified workDir.
     * This is a way to create drivers on top of pre-existing Pulumi programs. This Workspace will pick up
     * any available Settings files (Pulumi.yaml, Pulumi.<stack>.yaml).
     *
     * @param args A set of arguments to initialize a Stack with a pre-configured Pulumi CLI program that already exists on disk.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static selectStack(args: LocalProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    /**
     * Selects an existing Stack with a LocalWorkspace utilizing the specified inline (in process) Pulumi program.
     * This program is fully debuggable and runs in process. If no Project option is specified, default project settings
     * will be created on behalf of the user. Similarly, unless a `workDir` option is specified, the working directory
     * will default to a new temporary directory provided by the OS.
     *
     * @param args A set of arguments to initialize a Stack with and inline `PulumiFn` program that runs in process.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static selectStack(args: InlineProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    /**
     * Creates or selects an existing Stack with a LocalWorkspace utilizing the specified inline (in process) Pulumi CLI program.
     * This program is fully debuggable and runs in process. If no Project option is specified, default project settings
     * will be created on behalf of the user. Similarly, unless a `workDir` option is specified, the working directory
     * will default to a new temporary directory provided by the OS.
     *
     * @param args A set of arguments to initialize a Stack with a pre-configured Pulumi CLI program that already exists on disk.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static createOrSelectStack(args: LocalProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    /**
     * Creates or selects an existing Stack with a LocalWorkspace utilizing the specified inline Pulumi CLI program.
     * This program is fully debuggable and runs in process. If no Project option is specified, default project settings will be created
     * on behalf of the user. Similarly, unless a `workDir` option is specified, the working directory will default
     * to a new temporary directory provided by the OS.
     *
     * @param args A set of arguments to initialize a Stack with and inline `PulumiFn` program that runs in process.
     * @param opts Additional customizations to be applied to the Workspace.
     */
    static createOrSelectStack(args: InlineProgramArgs, opts?: LocalWorkspaceOptions): Promise<Stack>;
    private static localSourceStackHelper;
    private static inlineSourceStackHelper;
    private constructor();
    /**
     * Returns the settings object for the current project if any
     * LocalWorkspace reads settings from the Pulumi.yaml in the workspace.
     * A workspace can contain only a single project at a time.
     */
    projectSettings(): Promise<ProjectSettings>;
    /**
     * Overwrites the settings object in the current project.
     * There can only be a single project per workspace. Fails if new project name does not match old.
     * LocalWorkspace writes this value to a Pulumi.yaml file in Workspace.WorkDir().
     *
     * @param settings The settings object to save to the Workspace.
     */
    saveProjectSettings(settings: ProjectSettings): Promise<void>;
    /**
     * Returns the settings object for the stack matching the specified stack name if any.
     * LocalWorkspace reads this from a Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to retrieve settings from.
     */
    stackSettings(stackName: string): Promise<StackSettings>;
    /**
     * Overwrites the settings object for the stack matching the specified stack name.
     * LocalWorkspace writes this value to a Pulumi.<stack>.yaml file in Workspace.WorkDir()
     *
     * @param stackName The stack to operate on.
     * @param settings The settings object to save.
     */
    saveStackSettings(stackName: string, settings: StackSettings): Promise<void>;
    /**
     * Creates and sets a new stack with the stack name, failing if one already exists.
     *
     * @param stackName The stack to create.
     */
    createStack(stackName: string): Promise<void>;
    /**
     * Selects and sets an existing stack matching the stack name, failing if none exists.
     *
     * @param stackName The stack to select.
     */
    selectStack(stackName: string): Promise<void>;
    /**
     * Deletes the stack and all associated configuration and history.
     *
     * @param stackName The stack to remove
     */
    removeStack(stackName: string): Promise<void>;
    /**
     * Adds environments to the end of a stack's import list. Imported environments are merged in order
     * per the ESC merge rules. The list of environments behaves as if it were the import list in an anonymous
     * environment.
     *
     * @param stackName The stack to operate on
     * @param environments The names of the environments to add to the stack's configuration
     */
    addEnvironments(stackName: string, ...environments: string[]): Promise<void>;
    /**
     * Returns the list of environments associated with the specified stack name.
     *
     * @param stackName The stack to operate on
     */
    listEnvironments(stackName: string): Promise<string[]>;
    /**
     * Removes an environment from a stack's import list.
     *
     * @param stackName The stack to operate on
     * @param environment The name of the environment to remove from the stack's configuration
     */
    removeEnvironment(stackName: string, environment: string): Promise<void>;
    /**
     * Returns the value associated with the specified stack name and key,
     * scoped to the current workspace. LocalWorkspace reads this config from the matching Pulumi.stack.yaml file.
     *
     * @param stackName The stack to read config from
     * @param key The key to use for the config lookup
     * @param path The key contains a path to a property in a map or list to get
     */
    getConfig(stackName: string, key: string, path?: boolean): Promise<ConfigValue>;
    /**
     * Returns the config map for the specified stack name, scoped to the current workspace.
     * LocalWorkspace reads this config from the matching Pulumi.stack.yaml file.
     *
     * @param stackName The stack to read config from
     */
    getAllConfig(stackName: string): Promise<ConfigMap>;
    /**
     * Sets the specified key-value pair on the provided stack name.
     * LocalWorkspace writes this value to the matching Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to operate on
     * @param key The config key to set
     * @param value The value to set
     * @param path The key contains a path to a property in a map or list to set
     */
    setConfig(stackName: string, key: string, value: ConfigValue, path?: boolean): Promise<void>;
    /**
     * Sets all values in the provided config map for the specified stack name.
     * LocalWorkspace writes the config to the matching Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to operate on
     * @param config The `ConfigMap` to upsert against the existing config
     * @param path The keys contain a path to a property in a map or list to set
     */
    setAllConfig(stackName: string, config: ConfigMap, path?: boolean): Promise<void>;
    /**
     * Removes the specified key-value pair on the provided stack name.
     * It will remove any matching values in the Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to operate on
     * @param key The config key to remove
     * @param path The key contains a path to a property in a map or list to remove
     */
    removeConfig(stackName: string, key: string, path?: boolean): Promise<void>;
    /**
     *
     * Removes all values in the provided key list for the specified stack name
     * It will remove any matching values in the Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to operate on
     * @param keys The list of keys to remove from the underlying config
     * @param path The keys contain a path to a property in a map or list to remove
     */
    removeAllConfig(stackName: string, keys: string[], path?: boolean): Promise<void>;
    /**
     * Gets and sets the config map used with the last update for Stack matching stack name.
     * It will overwrite all configuration in the Pulumi.<stack>.yaml file in Workspace.WorkDir().
     *
     * @param stackName The stack to refresh
     */
    refreshConfig(stackName: string): Promise<ConfigMap>;
    /**
     * Returns the value associated with the specified stack name and key,
     * scoped to the LocalWorkspace.
     *
     * @param stackName The stack to read tag metadata from.
     * @param key The key to use for the tag lookup.
     */
    getTag(stackName: string, key: string): Promise<string>;
    /**
     * Sets the specified key-value pair on the provided stack name.
     *
     * @param stackName The stack to operate on.
     * @param key The tag key to set.
     * @param value The tag value to set.
     */
    setTag(stackName: string, key: string, value: string): Promise<void>;
    /**
     * Removes the specified key-value pair on the provided stack name.
     *
     * @param stackName The stack to operate on.
     * @param key The tag key to remove.
     */
    removeTag(stackName: string, key: string): Promise<void>;
    /**
     * Returns the tag map for the specified tag name, scoped to the current LocalWorkspace.
     *
     * @param stackName The stack to read tag metadata from.
     */
    listTags(stackName: string): Promise<TagMap>;
    /**
     * Returns the currently authenticated user.
     */
    whoAmI(): Promise<WhoAmIResult>;
    /**
     * Returns a summary of the currently selected stack, if any.
     */
    stack(): Promise<StackSummary | undefined>;
    /**
     * Returns all Stacks from the underlying backend based on the provided options.
     * This queries underlying backend and may return stacks not present in the Workspace (as Pulumi.<stack>.yaml files).
     *
     * @param opts Options to customize the behavior of the list.
     */
    listStacks(opts?: ListOptions): Promise<StackSummary[]>;
    /**
     * Installs a plugin in the Workspace, for example to use cloud providers like AWS or GCP.
     *
     * @param name the name of the plugin.
     * @param version the version of the plugin e.g. "v1.0.0".
     * @param kind the kind of plugin, defaults to "resource"
     */
    installPlugin(name: string, version: string, kind?: string): Promise<void>;
    /**
     * Installs a plugin in the Workspace, from a third party server.
     *
     * @param name the name of the plugin.
     * @param version the version of the plugin e.g. "v1.0.0".
     * @param server the server to install the plugin from
     */
    installPluginFromServer(name: string, version: string, server: string): Promise<void>;
    /**
     * Removes a plugin from the Workspace matching the specified name and version.
     *
     * @param name the optional name of the plugin.
     * @param versionRange optional semver range to check when removing plugins matching the given name
     *  e.g. "1.0.0", ">1.0.0".
     * @param kind he kind of plugin, defaults to "resource".
     */
    removePlugin(name?: string, versionRange?: string, kind?: string): Promise<void>;
    /**
     * Returns a list of all plugins installed in the Workspace.
     */
    listPlugins(): Promise<PluginInfo[]>;
    /**
     * exportStack exports the deployment state of the stack.
     * This can be combined with Workspace.importStack to edit a stack's state (such as recovery from failed deployments).
     *
     * @param stackName the name of the stack.
     */
    exportStack(stackName: string): Promise<Deployment>;
    /**
     * importStack imports the specified deployment state into a pre-existing stack.
     * This can be combined with Workspace.exportStack to edit a stack's state (such as recovery from failed deployments).
     *
     * @param stackName the name of the stack.
     * @param state the stack state to import.
     */
    importStack(stackName: string, state: Deployment): Promise<void>;
    /**
     * Gets the current set of Stack outputs from the last Stack.up().
     * @param stackName the name of the stack.
     */
    stackOutputs(stackName: string): Promise<OutputMap>;
    /**
     * serializeArgsForOp is hook to provide additional args to every CLI commands before they are executed.
     * Provided with stack name,
     * returns a list of args to append to an invoked command ["--config=...", ]
     * LocalWorkspace does not utilize this extensibility point.
     */
    serializeArgsForOp(_: string): Promise<string[]>;
    /**
     * postCommandCallback is a hook executed after every command. Called with the stack name.
     * An extensibility point to perform workspace cleanup (CLI operations may create/modify a Pulumi.stack.yaml)
     * LocalWorkspace does not utilize this extensibility point.
     */
    postCommandCallback(_: string): Promise<void>;
    private checkRemoteSupport;
    private runPulumiCmd;
}
/**
 * Description of a stack backed by an inline (in process) Pulumi program.
 */
export interface InlineProgramArgs {
    /**
     * The name of the associated Stack
     */
    stackName: string;
    /**
     * The name of the associated project
     */
    projectName: string;
    /**
     * The inline (in process) Pulumi program to use with Update and Preview operations.
     */
    program: PulumiFn;
}
/**
 * Description of a stack backed by pre-existing local Pulumi CLI program.
 */
export interface LocalProgramArgs {
    stackName: string;
    workDir: string;
}
/**
 * Extensibility options to configure a LocalWorkspace; e.g: settings to seed
 * and environment variables to pass through to every command.
 */
export interface LocalWorkspaceOptions {
    /**
     * The directory to run Pulumi commands and read settings (Pulumi.yaml and Pulumi.<stack>.yaml).
     */
    workDir?: string;
    /**
     * The directory to override for CLI metadata
     */
    pulumiHome?: string;
    /**
     * The underlying Pulumi CLI.
     */
    pulumiCommand?: PulumiCommand;
    /**
     *  The inline program `PulumiFn` to be used for Preview/Update operations if any.
     *  If none is specified, the stack will refer to ProjectSettings for this information.
     */
    program?: PulumiFn;
    /**
     * Environment values scoped to the current workspace. These will be supplied to every Pulumi command.
     */
    envVars?: {
        [key: string]: string;
    };
    /**
     * The secrets provider to use for encryption and decryption of stack secrets.
     * See: https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers
     */
    secretsProvider?: string;
    /**
     * The settings object for the current project.
     */
    projectSettings?: ProjectSettings;
    /**
     * A map of Stack names and corresponding settings objects.
     */
    stackSettings?: {
        [key: string]: StackSettings;
    };
}
export interface ListOptions {
    /**
     * List all stacks instead of just stacks for the current project
     */
    all?: boolean;
}
