import type { NapiNode, NapiPeer, NapiNodeIdentity } from '@vibecook/truffle'; export interface UseMeshResult { /** All known peers (from Tailscale discovery). */ peers: NapiPeer[]; /** Local node identity (id, hostname, name, ip). */ localInfo: NapiNodeIdentity | null; /** Whether the node has been started. */ isStarted: boolean; /** Send a namespaced JSON message to a specific peer. */ send: (peerId: string, namespace: string, payload: unknown) => Promise; /** Broadcast a namespaced JSON message to all connected peers. */ broadcast: (namespace: string, payload: unknown) => Promise; } /** * React hook for Truffle mesh networking. * * Provides reactive peer state and messaging helpers built on the new * Node API (RFC 012). The NapiNode must already be started. When using * `createMeshNode()` from `@vibecook/truffle`, pass `mesh.native` — this * hook consumes the raw NAPI event shape. * * @example * ```tsx * const { peers, send, broadcast } = useMesh(node); * * await send('peer-id', 'chat', { text: 'hello' }); * await broadcast('chat', { text: 'hello everyone' }); * ``` */ export declare function useMesh(node: NapiNode | null): UseMeshResult; //# sourceMappingURL=use-mesh.d.ts.map