import type { NobjcObject } from "objc-js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSString } from "../Foundation/NSString.js";
export declare class _WKWebExtensionMessagePort extends _NSObject {
    static alloc(): _WKWebExtensionMessagePort;
    static new(): _WKWebExtensionMessagePort;
    init(): _WKWebExtensionMessagePort;
    /**
     * Sends a message to the connected web extension. The JSON-serializable message to be sent. An optional block to be invoked after the message is sent, taking an optional error. The message must be JSON-serializable according to ``NSJSONSerialization``.
     */
    sendMessage$completionHandler$(message: NobjcObject | null, completionHandler: ((error: _NSError) => void) | null): void;
    /** Disconnects the port, terminating all further messages. */
    disconnect(): void;
    /**
     * Disconnects the port, terminating all further messages with an optional error. An optional error indicating the reason for disconnection.
     */
    disconnectWithError$(error: _NSError | null): void;
    /**
     * The unique identifier for the app to which this port should be connected. This identifier is provided by the web extension and may or may not be used by the app. It's up to the app to decide how to interpret this identifier.
     */
    applicationIdentifier(): _NSString | null;
    /**
     * The block to be executed when a message is received from the web extension. An optional block to be invoked when a message is received, taking two parameters: the message and an optional error.
     */
    messageHandler(): ((arg0: NobjcObject, arg1: _NSError) => void) | null;
    setMessageHandler$(value: ((arg0: NobjcObject, arg1: _NSError) => void) | null): void;
    /**
     * The block to be executed when the port disconnects. An optional block to be invoked when the port disconnects, taking an optional error that indicates if the disconnection was caused by an error.
     */
    disconnectHandler(): ((arg0: _NSError) => void) | null;
    setDisconnectHandler$(value: ((arg0: _NSError) => void) | null): void;
    /** Indicates whether the message port is disconnected. */
    disconnected(): boolean;
}
