/** * window.host bridge factory. * * Creates an HostBridge object that can be assigned to window.host (or any * comparable injection point). The bridge translates between the binary * adapter API and the string-oriented API that guest apps consume. * * @example * ```ts * import { createWindowHostBridge } from "@polkadot-apps/host-sdk/bridge"; * * window.host = createWindowHostBridge({ adapter, encoding }); * ``` */ import type { CreateWindowHostBridgeOptions, HostBridge } from "./types.js"; /** * Create a HostBridge backed by the given adapter and encoding utilities. * * The returned object is suitable for assignment to window.host, a webview * postMessage bridge, or any injection point that guest apps will call. */ export declare function createWindowHostBridge(options: CreateWindowHostBridgeOptions): HostBridge; /** * Normalize a .dot domain name into the canonical app ID used for * Statement Store namespacing (the `decryption_key` field). * * All hosts MUST use this function to derive the app ID so that * statements published by one host are visible to all others. * * Rules: * - Strip trailing `.dot` suffix (case-insensitive) * - Lowercase * - Trim whitespace * * Examples: * "voxchat.dot" → "voxchat" * "VoxChat.DOT" → "voxchat" * "voxchat" → "voxchat" * "my-app.dot" → "my-app" */ export declare function normalizeAppId(name: string): string; /** * Reset module-scoped rate limiter state. * * @internal Intended for use in tests only. Not part of the public API. */ export declare function __resetRateLimiterForTesting(): void; export type { BridgeStatement, BridgeUnsubscribe, BridgeEncodingUtils, HostBridgeAdapter, HostStoreStatus, CreateWindowHostBridgeOptions, StatementEventPayload, HostBridge, } from "./types.js"; export { HostError, isHostError } from "../errors.js"; export type { HostErrorCode } from "../errors.js"; export { BRIDGE_ERROR_CODES, BRIDGE_EVENT_NAMES, BRIDGE_EXPERIMENTAL_SURFACE, BRIDGE_STABLE_SURFACE, BRIDGE_VERSION, DEFAULT_BRIDGE_PROFILE, createBridgeMetadata, } from "./contract.js"; export type { BridgeErrorCode, BridgeEventName, BridgeExperimentalSurfaceEntry, BridgeProfile, BridgeStableSurfaceEntry, BridgeExtensionCapabilities, BridgeCapabilities, BridgeMetadata, BridgeMetadataOptions, } from "./contract.js"; //# sourceMappingURL=index.d.ts.map