/**
 * #post_message.ts
 *
 * @packageDocumentation
 */
import _m0 from "protobufjs/minimal.js";
import { RealtimeSubscriptionsEffect } from "../../../effect_types/v1alpha/realtime_subscription.js";
export declare enum WebViewInternalMessageScope {
    /** CLIENT - Message is intended for the client only */
    CLIENT = 0,
    UNRECOGNIZED = -1
}
export declare function webViewInternalMessageScopeFromJSON(object: any): WebViewInternalMessageScope;
export declare function webViewInternalMessageScopeToJSON(object: WebViewInternalMessageScope): number;
/** Devvit internal message, sent via postMessage */
export interface WebViewInternalMessage {
    /** type: devvit-internal */
    type: string;
    /** Scope of the message, used to determine where the message should be sent */
    scope: WebViewInternalMessageScope;
    /** Origin: devvit-analytics */
    analytics?: {
        [key: string]: any;
    } | undefined;
    /** Origin: devvit-client */
    effect?: {
        [key: string]: any;
    } | undefined;
    /** Origin: devvit-client */
    realtimeEffect?: RealtimeSubscriptionsEffect | undefined;
    id?: string | undefined;
}
/** Structure of messages sent via postMessage */
export interface WebViewPostMessage {
    /** See comments for each message */
    type: string;
    /** One of the following messages converted to a Struct */
    data?: {
        [key: string]: any;
    } | undefined;
}
/**
 * Arbitrary message, sent by app via effect
 * type: devvit-message
 */
export interface WebViewAppMessage {
    /**
     * Any serializable value given to postMessage in a WebView
     * @deprecated Use json_string instead
     */
    message?: any | undefined;
    /** JSON string payload */
    jsonString?: string | undefined;
}
/**
 * Used to pass stateful data into a WebView
 * type: devvit-state
 * @deprecated
 */
export interface WebViewStateMessage {
    state?: {
        [key: string]: any;
    } | undefined;
}
export interface WebViewPostMessageEffect {
    /** ID of the WebView block */
    webViewId: string;
    app?: WebViewAppMessage | undefined;
    /**
     * WebViewUIEventMessage event = 4;
     * WebViewUIEnvironmentMessage environment = 5;
     */
    state?: WebViewStateMessage | undefined;
}
export declare const WebViewInternalMessage: {
    $type: "devvit.ui.effects.web_view.v1alpha.WebViewInternalMessage";
    encode(message: WebViewInternalMessage, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): WebViewInternalMessage;
    fromJSON(object: any): WebViewInternalMessage;
    toJSON(message: WebViewInternalMessage): unknown;
    create(base?: DeepPartial<WebViewInternalMessage>): WebViewInternalMessage;
    fromPartial(object: DeepPartial<WebViewInternalMessage>): WebViewInternalMessage;
};
export declare const WebViewPostMessage: {
    $type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessage";
    encode(message: WebViewPostMessage, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): WebViewPostMessage;
    fromJSON(object: any): WebViewPostMessage;
    toJSON(message: WebViewPostMessage): unknown;
    create(base?: DeepPartial<WebViewPostMessage>): WebViewPostMessage;
    fromPartial(object: DeepPartial<WebViewPostMessage>): WebViewPostMessage;
};
export declare const WebViewAppMessage: {
    $type: "devvit.ui.effects.web_view.v1alpha.WebViewAppMessage";
    encode(message: WebViewAppMessage, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): WebViewAppMessage;
    fromJSON(object: any): WebViewAppMessage;
    toJSON(message: WebViewAppMessage): unknown;
    create(base?: DeepPartial<WebViewAppMessage>): WebViewAppMessage;
    fromPartial(object: DeepPartial<WebViewAppMessage>): WebViewAppMessage;
};
export declare const WebViewStateMessage: {
    $type: "devvit.ui.effects.web_view.v1alpha.WebViewStateMessage";
    encode(message: WebViewStateMessage, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): WebViewStateMessage;
    fromJSON(object: any): WebViewStateMessage;
    toJSON(message: WebViewStateMessage): unknown;
    create(base?: DeepPartial<WebViewStateMessage>): WebViewStateMessage;
    fromPartial(object: DeepPartial<WebViewStateMessage>): WebViewStateMessage;
};
export declare const WebViewPostMessageEffect: {
    $type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessageEffect";
    encode(message: WebViewPostMessageEffect, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): WebViewPostMessageEffect;
    fromJSON(object: any): WebViewPostMessageEffect;
    toJSON(message: WebViewPostMessageEffect): unknown;
    create(base?: DeepPartial<WebViewPostMessageEffect>): WebViewPostMessageEffect;
    fromPartial(object: DeepPartial<WebViewPostMessageEffect>): WebViewPostMessageEffect;
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export {};
//# sourceMappingURL=post_message.d.ts.map