import type { Dispatcher, ErrorInfo, RuntimeTrace, SubscribeCallbackParams } from '@devvit/multiplatform/ui-shared-shared.js'; import { JsDispatcherImpl } from '@devvit/multiplatform/ui-shared-shared.js'; import type { Metadata } from '@devvit/protos/lib/Types.js'; import type { UIEnvironment } from '@devvit/protos/types/devvit/ui/block_kit/v1beta/ui.js'; import type { Effect } from '@devvit/protos/types/devvit/ui/effects/v1alpha/effect.js'; 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; 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, env: UIEnvironment, config: DispatcherConfig); set metadata(metadata: Readonly | undefined); set onPluginCall(cb: PluginCallback); set runtimeDebugLogging(runtimeDebugLogging: boolean); subscribe(cb: (p: SubscribeCallbackParams) => void): void; submit(...args: Parameters['submit']>): void; unsubscribe(): void; init(): void; togglePause(pause: boolean): void; resetAppState(): void; setEnv(env: UIEnvironment): void; setProps(props: UIProps): void; remoteLoad(...args: Parameters): void; localLoad(...args: Parameters): Promise; localLoadWorker(...args: Parameters): void; } export {}; //# sourceMappingURL=webDispatcher.d.ts.map