/**
 * Node.js process shim
 * Provides minimal process object for browser environment
 * Process is an EventEmitter in Node.js
 */
import { EventListener } from './events';
export interface ProcessEnv {
    [key: string]: string | undefined;
}
interface ProcessStream {
    isTTY: boolean;
    readable: boolean;
    writable: boolean;
    destroyed: boolean;
    on: (event: string, listener: EventListener) => ProcessStream;
    once: (event: string, listener: EventListener) => ProcessStream;
    off: (event: string, listener: EventListener) => ProcessStream;
    emit: (event: string, ...args: unknown[]) => boolean;
    addListener: (event: string, listener: EventListener) => ProcessStream;
    removeListener: (event: string, listener: EventListener) => ProcessStream;
    removeAllListeners: (event?: string) => ProcessStream;
    setMaxListeners: (n: number) => ProcessStream;
    getMaxListeners: () => number;
    listenerCount: (event: string) => number;
    listeners: (event: string) => EventListener[];
    rawListeners: (event: string) => EventListener[];
    prependListener: (event: string, listener: EventListener) => ProcessStream;
    prependOnceListener: (event: string, listener: EventListener) => ProcessStream;
    eventNames: () => string[];
    pause?: () => ProcessStream;
    resume?: () => ProcessStream;
    setEncoding?: (encoding: string) => ProcessStream;
    ref?: () => ProcessStream;
    unref?: () => ProcessStream;
    destroy?: () => ProcessStream;
}
interface ProcessWritableStream extends ProcessStream {
    write: (data: string | Buffer, encoding?: string, callback?: () => void) => boolean;
    end?: (data?: string, callback?: () => void) => void;
    cursorTo?: (x: number, y?: number | (() => void), callback?: () => void) => boolean;
    moveCursor?: (dx: number, dy: number, callback?: () => void) => boolean;
    clearLine?: (dir: number, callback?: () => void) => boolean;
    clearScreenDown?: (callback?: () => void) => boolean;
    columns?: number;
    rows?: number;
    getColorDepth?: () => number;
    hasColors?: () => boolean;
}
interface ProcessReadableStream extends ProcessStream {
    read?: (size?: number) => string | Buffer | null;
    setRawMode?: (mode: boolean) => ProcessReadableStream;
}
export interface Process {
    env: ProcessEnv;
    cwd: () => string;
    chdir: (directory: string) => void;
    arch: string;
    platform: string;
    version: string;
    versions: {
        node: string;
        v8: string;
        uv: string;
    };
    argv: string[];
    argv0: string;
    execPath: string;
    execArgv: string[];
    pid: number;
    ppid: number;
    getuid: () => number;
    getgid: () => number;
    geteuid: () => number;
    getegid: () => number;
    exit: (code?: number) => never;
    kill: (pid: number, signal?: string | number) => boolean;
    nextTick: (callback: (...args: unknown[]) => void, ...args: unknown[]) => void;
    stdout: ProcessWritableStream;
    stderr: ProcessWritableStream;
    stdin: ProcessReadableStream;
    hrtime: {
        (time?: [number, number]): [number, number];
        bigint: () => bigint;
    };
    memoryUsage: () => {
        rss: number;
        heapTotal: number;
        heapUsed: number;
        external: number;
        arrayBuffers: number;
    };
    uptime: () => number;
    cpuUsage: () => {
        user: number;
        system: number;
    };
    on: (event: string, listener: EventListener) => Process;
    once: (event: string, listener: EventListener) => Process;
    off: (event: string, listener: EventListener) => Process;
    emit: (event: string, ...args: unknown[]) => boolean;
    addListener: (event: string, listener: EventListener) => Process;
    removeListener: (event: string, listener: EventListener) => Process;
    removeAllListeners: (event?: string) => Process;
    listeners: (event: string) => EventListener[];
    listenerCount: (event: string) => number;
    prependListener: (event: string, listener: EventListener) => Process;
    prependOnceListener: (event: string, listener: EventListener) => Process;
    eventNames: () => string[];
    setMaxListeners: (n: number) => Process;
    getMaxListeners: () => number;
    emitWarning: (warning: string | Error, typeOrOptions?: string | {
        type?: string;
        code?: string;
    }, code?: string) => void;
    send?: (message: unknown, callback?: (error: Error | null) => void) => boolean;
    connected?: boolean;
    _cwdCallCount?: number;
}
export declare function createProcess(options?: {
    cwd?: string;
    env?: ProcessEnv;
    pid?: number;
    ppid?: number;
    uid?: number;
    gid?: number;
    tty?: boolean;
    onExit?: (code: number) => void;
    onStdout?: (data: string) => void;
    onStderr?: (data: string) => void;
}): Process;
export declare const process: Process;
export default process;
//# sourceMappingURL=process.d.ts.map