/// <reference lib="dom" />
import type { LinkedBundle, Metadata } from '@devvit/protos';
import type { CallResponse, PluginOptions } from '../runtime/RuntimeLite.js';
import type { LiteLoadResponse } from './ClientShared.js';
export type WorkerErrorType = 'Error' | 'MessageError' | 'UnhandledRejection';
export type ErrorCallback = (type: WorkerErrorType, err: unknown) => void;
export type LiteClient = {
    call(method: string, args: unknown, meta: Metadata | undefined): Promise<unknown>;
    loadBundle(app: Readonly<LinkedBundle>): Promise<LiteLoadResponse>;
    onPluginResponse(id: number, result: CallResponse): void;
    runtimeDebugLogging: boolean;
    quit(): void;
    ready: boolean;
};
/**
 * Wraps worker, runtime lifecycles, and call un/packing.
 *
 * Used by Shreddit via devvit-custom-post. A feed would have one client per
 * post. Not used by native mobile apps which doesn't have workers.
 *
 * Web workers can run code from data URI or URL of window origin.
 */
export declare class BrowserLiteClient implements LiteClient {
    #private;
    /** @arg onError Worker error event handler. */
    constructor(workerCode: Blob, onError?: ErrorCallback, pluginOptions?: PluginOptions);
    get ready(): boolean;
    get runtimeDebugLogging(): boolean;
    set runtimeDebugLogging(on: boolean);
    /**
     * This function doesn't actually load a bundle by itself. It creates a new
     * worker, evaluates the entrypoint, and waits for ActorResponse.READY which
     * eventually kicks off a bundle load.
     */
    loadBundle(bundle: LinkedBundle): Promise<LiteLoadResponse>;
    call(method: string, args: unknown, meta: Metadata | undefined): Promise<unknown>;
    onPluginResponse(id: number, result: CallResponse): void;
    /** Call this method before repeating a call to loadBundle(). */
    quit(): void;
}
//# sourceMappingURL=BrowserLiteClient.d.ts.map