import { Exception } from '@api-client/core/exceptions/exception.js';
import { type IoEvent, type IoCommand, type IoNotification } from './PlatformBindings.js';
/**
 * The base IO thread class containing the communication logic with the clients.
 */
export declare abstract class IoThread {
    /**
     * Initializes the communication channel with the clients.
     */
    abstract initialize(): Promise<void>;
    /**
     * The IO thread must implement this method to send the message to the client with
     * their particular implementation of message passing.
     *
     * @param message The message to send.
     */
    abstract postMessage(message: IoNotification | IoEvent): void;
    /**
     * To be called by the IO thread implementation when receiving a message from the client.
     */
    protected handleMessage(event: IoCommand | IoEvent): void;
    protected notifyError(id: number, error: Exception): void;
    protected getFunction(fn: string): Function | undefined;
    /**
     * Calls the function on self, creates a response event, and dispatches it.
     *
     * @param fnName The function name to call.
     * @param id The request id sent back to the client.
     * @param args The function arguments.
     */
    protected call(callable: Function, id: number, args: any[]): Promise<void>;
    /**
     * Sends a message to the clients that is a request to send a client DOM event.
     *
     * @param eventPath The path in the `Events` prototype.
     * @param args The arguments to call the event with.
     */
    protected notifyClients(eventPath: string, ...args: any[]): void;
}
//# sourceMappingURL=IoThread.d.ts.map