import type { RpcCancelPacket, RpcRequestPacket, RpcResponsePacket, SpiderMeshNode } from '@spider-mesh/core'; export type RelayRawData = Uint8Array | ArrayBuffer | ArrayBufferView | string | RelayRawData[]; export type RelayRpcFrame = { type: 'rpc'; data: RpcRequestPacket | RpcResponsePacket | RpcCancelPacket; }; export type RelayPublishFrame = { type: 'publish'; topic: string; payload: Uint8Array; }; export type RelaySubscribeFrame = { type: 'subscribe'; topics: string[]; }; export type RelayUnsubscribeFrame = { type: 'unsubscribe'; topics: string[]; }; export type RelayHelloFrame = { type: 'hello'; me: SpiderMeshNode; target_id?: string; }; export type RelayOfflineFrame = { type: 'offline'; node_id: string; }; export type RelayFrame = RelayRpcFrame | RelayPublishFrame | RelaySubscribeFrame | RelayUnsubscribeFrame | RelayHelloFrame | RelayOfflineFrame; export declare function encodeRelayFrame(frame: RelayFrame): Uint8Array; export declare function decodeRelayFrame(raw: Uint8Array): RelayFrame | null; export declare function normalizeRelayRawData(raw: RelayRawData): Uint8Array;