import { TypedEventTarget } from "../../../deps/jsr.io/@derzade/typescript-event-target/1.1.1/mod.js";
import type { BlockDetails, TxDetails } from "../../types/explorer/responses.js";
import type { BaseExchangeResponse } from "../../types/exchange/responses.js";
/** Response to subscribe to or unsubscribe from an event. */
interface SubscriptionResponse {
    /** Type of subscription operation. */
    method: "subscribe" | "unsubscribe";
    /** Original subscription request. */
    subscription: unknown;
}
/** Response to post request. */
interface PostResponse {
    /** Unique request identifier. */
    id: number;
    /** Server response. */
    response: 
    /** Response containing requested information. */
    {
        /** Indicates that this is an informational response. */
        type: "info";
        /** Contains the information data. */
        payload: {
            /** Type of information being returned. */
            type: string;
            /** Information specific data. */
            data: unknown;
        };
    }
    /** Response containing action result. */
     | {
        /** Indicates that this is an action response. */
        type: "action";
        /** Action result. */
        payload: BaseExchangeResponse;
    };
}
/** Base system events and dynamic channel events for Hyperliquid WebSocket API. */
interface HyperliquidEventMap {
    subscriptionResponse: CustomEvent<SubscriptionResponse>;
    post: CustomEvent<PostResponse>;
    error: CustomEvent<string>;
    pong: CustomEvent<undefined>;
    _explorerBlock: CustomEvent<Omit<BlockDetails, "txs">[]>;
    _explorerTxs: CustomEvent<TxDetails[]>;
    [key: string]: CustomEvent<any>;
}
/** Listens for WebSocket messages and sends them as Hyperliquid typed events. */
export declare class HyperliquidEventTarget extends TypedEventTarget<HyperliquidEventMap> {
    constructor(socket: WebSocket);
}
export {};
//# sourceMappingURL=_hyperliquid_event_target.d.ts.map