import type { Dispatcher, ErrorInfo, RuntimeTrace, SubscribeCallbackParams } from '@devvit/multiplatform/ui-shared-shared.js';
import { JsDispatcherImpl } from '@devvit/multiplatform/ui-shared-shared.js';
import type { Effect, Metadata, UIEnvironment } from '@devvit/protos';
import type { LiteLoadResponse } from '@devvit/runtime-lite/client/ClientShared.js';
import type { PluginCallback } from '@devvit/runtime-lite/runtime/RuntimeLite.js';
import type { UIProps, UIState, WrappedEvent, WrappedRequest, WrappedResponse } from './mappers.js';
import { LocalRuntime, RemoteRuntime } from './runtimes.js';
type PerformanceTracker = (runtimeTrace: RuntimeTrace) => void;
type ErrorTracker = (errorTrace: ErrorInfo) => void;
type KMPDispatcher = JsDispatcherImpl<WrappedEvent>;
export type DispatcherConfig = {
    useSpeculativeExecution: boolean;
    performanceTracker: PerformanceTracker;
    errorTracker: ErrorTracker;
};
export declare class WebDispatcher {
    #private;
    /**
     * Has the post rendered at least once.
     *
     * The new dispatcher doesn't provide a method to let us know if it has been rendered or not.
     * We set it in here to allow to prevent the willUpdate method from submitting infinite
     * render events.
     */
    hasRendered: boolean;
    onUserAction?: ((fx: Effect) => void) | undefined;
    onWebViewMessage?: ((fx: Effect) => void) | undefined;
    onError?: (error: Error) => void | undefined;
    get state(): KMPDispatcher['state'];
    constructor(initialState: Record<string, unknown>, env: UIEnvironment, config: DispatcherConfig);
    set metadata(metadata: Readonly<Metadata> | undefined);
    set onPluginCall(cb: PluginCallback);
    set runtimeDebugLogging(runtimeDebugLogging: boolean);
    subscribe(cb: (p: SubscribeCallbackParams<WrappedRequest, WrappedResponse>) => void): void;
    submit(...args: Parameters<Dispatcher<UIState, WrappedEvent, unknown>['submit']>): void;
    unsubscribe(): void;
    init(): void;
    togglePause(pause: boolean): void;
    resetAppState(): void;
    setEnv(env: UIEnvironment): void;
    setProps(props: UIProps): void;
    remoteLoad(...args: Parameters<RemoteRuntime['load']>): void;
    localLoad(...args: Parameters<LocalRuntime['load']>): Promise<LiteLoadResponse | undefined>;
    localLoadWorker(...args: Parameters<LocalRuntime['setLocalSrc']>): void;
}
export {};
//# sourceMappingURL=webDispatcher.d.ts.map