/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import Dockerode from "dockerode";
import { ReadStream } from "node:fs";
import type { Docker } from "./docker.js";
import { edit } from "./edit.js";
import { Image } from "./image.js";
import { Network } from "./network.js";
import { Terminal } from "./terminal.js";
/**
 * Container interface with various convenience methods.
 */
export interface Container {
    docker: Docker;
    image: Promise<Image>;
    start(): Promise<void>;
    kill(): Promise<void>;
    remove(force?: boolean): Promise<void>;
    attach<T extends Terminal.Factory>(terminal: T): Promise<ReturnType<T>>;
    wait(options?: Dockerode.ContainerWaitOptions): Promise<void>;
    /**
     * Execute a command with no input or output.
     */
    exec(command: string | string[], options?: Container.ExecOptions): Promise<void>;
    /**
     * Execute a command with input and/or output.
     */
    exec<T extends Terminal.Factory>(command: string | string[], terminal: T, options?: Container.ExecOptions): Promise<ReturnType<T>>;
    /**
     * Retrieve contents of a file as a string.
     */
    read(path: string): Promise<string>;
    /**
     * Retrieve the contents of a file using a terminal.
     */
    read<T extends Terminal.Factory>(path: string, terminal: T): Promise<ReturnType<T>>;
    /**
     * Continuously stream the contents of a text file until the terminal closes.
     */
    follow(path: string): Promise<Terminal<string>>;
    /**
     * Continously stream the contents of a file until the terminal closes.
     */
    follow<T extends Terminal.Factory>(path: string, terminal: T): Promise<ReturnType<T>>;
    /**
     * Retrieve the response of a command as a string.
     */
    execAndRead(command: string | string[]): Promise<string>;
    /**
     * Retrieve the response of a command using a terminal.
     */
    execAndRead<T extends Terminal.Factory>(command: string | string[], terminal: T): Promise<ReturnType<T>>;
    /**
     * Set contents of a file.
     */
    write(path: string, contents: {}): Promise<void>;
    /**
     * Delete a file.
     */
    delete(path: string, options?: FileDeleteOptions): Promise<void>;
    /**
     * Modify one or more files.
     */
    edit(editor: edit.Editor, ...paths: string[]): Promise<void>;
    /**
     * List files matching a bash glob.
     */
    resolveGlob(glob: string): Promise<string[]>;
    /**
     * Create a named pipe.
     *
     * Communicate with the pipe via {@link readFile} and {@link writeFile}.
     */
    createPipe(name: string): Promise<void>;
}
export interface FileDeleteOptions {
    force?: boolean;
    recursive?: boolean;
}
/**
 * Create a new container.
 */
export declare function Container(docker: Docker, options: Container.Configuration): Promise<Container>;
/**
 * Wrap a {@link Dockerode.Container}.
 */
export declare function Container(docker: Docker, container: Dockerode.Container): Container;
export declare namespace Container {
    interface Configuration {
        image: string;
        tag?: string;
        platform?: string;
        name?: string;
        replace?: boolean;
        autoRemove?: boolean;
        entrypoint?: string | string[];
        command?: string | string[];
        env?: Record<string, string>;
        privileged?: boolean;
        binds?: Record<string, string>;
        network?: string | Network | Network[];
        input?: ReadStream;
        openStdin?: boolean;
        cwd?: string;
    }
    interface ExecOptions {
        stdin?: boolean;
        cwd?: string;
        env?: Record<string, string>;
    }
    interface NetworkConfiguration {
        network: string | Network;
    }
}
//# sourceMappingURL=container.d.ts.map