import { BRIDGE_PROTOCOL_VERSION, DEFAULT_BRIDGE_GLOBAL, DEFAULT_LAYOUT_BRIDGE_GLOBAL, DeckChannel } from '../shared/protocol.js'; import type { EventEnvelope, InvokeRequest, InvokeResponse, ProbeResponse, DeckBridge } from '../shared/protocol.js'; import type { LayoutBridge, SlotGrant } from '../client/layout-client.js'; export interface ExposeBridgeOptions { /** 暴露到 window 的全局名,默认 `__electronDeckBridge` */ readonly globalName?: string; } /** * 在 host preload 内调用,把 framework typed RPC + event push bridge 暴露到 * webview window: * * ```ts * import { contextBridge, ipcRenderer } from 'electron' * import { exposeDeckBridge } from '@dimina-kit/electron-deck/preload' * exposeDeckBridge() * ``` * * 见 `DeckBridge` 接口(`shared/protocol.ts`)。 * * `@experimental` No production consumer yet — pairs with `createDeckClient` / * `DeckConfig.hostServices` / `events`, which only `examples/` / `spike/` use; * no host in this repo calls `exposeDeckBridge`. Contract may change until a * second real consumer adopts it. */ export declare function exposeDeckBridge(options?: ExposeBridgeOptions): void; export interface ExposeLayoutBridgeOptions { /** 暴露到 window 的全局名,默认 `__electronDeckLayoutBridge` */ readonly globalName?: string; } /** * 在 host preload 内调用,把三条 slot-token LAYOUT channel(`slot-grant` PUSH / * `snapshot` send / `layout-subscribe` invoke)封装成一个 `LayoutBridge`-shaped * 对象暴露到 webview window,供 renderer: * * ```ts * import { exposeDeckLayoutBridge } from '@dimina-kit/electron-deck/preload' * exposeDeckLayoutBridge() * // renderer: * createDeckLayoutClient({ bridge: window.__electronDeckLayoutBridge }) * ``` * * channel 名一律取自框架 `DeckChannel`(不手抄字符串)。`onSlotGrant` 返回一个 * 纯 unsubscribe 函数(可跨 contextBridge),不是 Disposable 对象。 */ export declare function exposeDeckLayoutBridge(options?: ExposeLayoutBridgeOptions): void; export type { EventEnvelope, InvokeRequest, InvokeResponse, ProbeResponse, DeckBridge, LayoutBridge, SlotGrant, }; export { BRIDGE_PROTOCOL_VERSION, DEFAULT_BRIDGE_GLOBAL, DEFAULT_LAYOUT_BRIDGE_GLOBAL, DeckChannel }; //# sourceMappingURL=index.d.ts.map