import { SimpleType } from '../internal/responseHandler'; /** * The type of arguments that can be passed in a {@link PluginMessage}. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export type PluginMessageArg = SimpleType; /** * Indicates whether the plugin capability is available in the current host. * * @remarks * This API validates SDK initialization and then checks runtime capability flags * for `supports.plugins`. * * @returns `true` if the host reports plugin support; otherwise `false`. * * @throws Error if {@linkcode app.initialize} has not successfully completed. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export declare function isSupported(): boolean; /** * Canonical message envelope used for plugin send/receive operations. * * @remarks * Messages are used to communicate between plugin and host. * * @property func - Function/event name for the message. * @property args - Optional JSON payload. * @property correlationId - Optional ID for request/response correlation. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export type PluginMessage = { func: string; args?: PluginMessageArg; correlationId?: string; }; /** * Sends a plugin message to the host. * * @remarks * The message payload is serialized before transmission to the host. * All payload data must be JSON-safe (see {@link JsonValue}). * * @returns A promise that resolves when the host acknowledges the message. * * @throws Error if SDK initialization has not completed, if the host returns * an error response, or if `func` is missing. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export declare function sendPluginMessage(message: PluginMessage): Promise; /** * Handler signature for incoming plugin messages. * * @param message - Normalized plugin message envelope. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export type ReceiveMessageHandler = (message: PluginMessage) => void; /** * Registers a handler to receive plugin messages from the host. * * @remarks * This API registers the callback under the `plugin.receiveMessage` handler name. * When the host dispatches a plugin message, the supplied handler is invoked with * the received JSON payload. * * @param handler - Callback invoked for each incoming plugin message payload. * * @throws Error if plugin messaging is not supported by the current host. * * @hidden * @internal * Limited to Microsoft-internal use * @beta */ export declare function registerPluginMessage(handler: ReceiveMessageHandler): void;