import { z } from "zod";
export declare const BROWSER_ID: RegExp;
declare const schemas: {
    1: z.ZodObject<{
        browserId: z.ZodString;
        v: z.ZodLiteral<1>;
        pid: z.ZodNumber;
        session: z.ZodString;
        cwd: z.ZodString;
        engine: z.ZodLiteral<"chromium">;
        headless: z.ZodBoolean;
        playwright: z.ZodString;
    }, z.core.$strip>;
    2: z.ZodObject<{
        browserId: z.ZodString;
        pageId: z.ZodString;
        url: z.ZodString;
        title: z.ZodString;
        width: z.ZodNumber;
        height: z.ZodNumber;
    }, z.core.$strip>;
    3: z.ZodObject<{
        browserId: z.ZodString;
        pageId: z.ZodString;
        t: z.ZodNumber;
        width: z.ZodNumber;
        height: z.ZodNumber;
    }, z.core.$strip>;
    4: z.ZodObject<{
        browserId: z.ZodString;
        pageId: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
    5: z.ZodObject<{
        browserId: z.ZodOptional<z.ZodString>;
        session: z.ZodOptional<z.ZodString>;
        reason: z.ZodString;
        timeout: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
    16: z.ZodIntersection<z.ZodObject<{
        browserId: z.ZodString;
        pageId: z.ZodString;
    }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
        event: z.ZodLiteral<"click">;
        x: z.ZodNumber;
        y: z.ZodNumber;
    }, z.core.$strip>, z.ZodObject<{
        event: z.ZodLiteral<"wheel">;
        x: z.ZodNumber;
        y: z.ZodNumber;
        dx: z.ZodNumber;
        dy: z.ZodNumber;
    }, z.core.$strip>, z.ZodObject<{
        event: z.ZodLiteral<"text">;
        text: z.ZodString;
    }, z.core.$strip>, z.ZodObject<{
        event: z.ZodLiteral<"key">;
        key: z.ZodEnum<{
            ArrowDown: "ArrowDown";
            ArrowLeft: "ArrowLeft";
            ArrowRight: "ArrowRight";
            ArrowUp: "ArrowUp";
            Backspace: "Backspace";
            Enter: "Enter";
            Escape: "Escape";
            Tab: "Tab";
        }>;
    }, z.core.$strip>], "event">>;
    18: z.ZodObject<{
        browserId: z.ZodString;
    }, z.core.$strip>;
    19: z.ZodObject<{
        outcome: z.ZodEnum<{
            done: "done";
            ended: "ended";
            "no-browser": "no-browser";
            timeout: "timeout";
        }>;
    }, z.core.$strip>;
};
export type Hello = z.infer<typeof schemas[1]>;
export type PageInfo = z.infer<typeof schemas[2]>;
export type FrameInfo = z.infer<typeof schemas[3]>;
export type Ask = z.infer<typeof schemas[5]>;
export type BrowserInput = z.infer<typeof schemas[16]>;
export type BrowserOutcome = z.infer<typeof schemas[19]>["outcome"];
export type ProducerMessage = {
    type: 1;
    data: Hello;
} | {
    type: 2;
    data: PageInfo;
} | {
    type: 3;
    data: FrameInfo;
    jpeg: Buffer;
} | {
    type: 4;
    data: z.infer<typeof schemas[4]>;
};
export type BrowserMessage = ProducerMessage | {
    type: 5;
    data: Ask;
} | {
    type: 16;
    data: BrowserInput;
} | {
    type: 18;
    data: z.infer<typeof schemas[18]>;
} | {
    type: 19;
    data: z.infer<typeof schemas[19]>;
};
export declare function browserWire(type: number, data: unknown): Buffer;
export declare const MAX_BROWSER_MESSAGE: number;
/** Incremental framing; reject lengths before allocating the claimed body. */
export declare class BrowserMessageReader {
    private buffer;
    push(chunk: Buffer): BrowserMessage[];
}
export {};
