/** * Typed wrapper for the host mesh extension (`window.host.ext.mesh`). */ import type { HostEventMap } from "./types.js"; import type { MeshCapability, MeshControlEnvelope, MeshObjectResult, MeshOpaqueHandle, MeshPrivateObjectRef } from "../events.js"; type Unsub = () => void; export declare const transport: { publish(topic: string, dataBase64: string): Promise; subscribe(topic: string): Promise; heartbeat(streamId: string, authorId: string, earliestRetainedSeq: number, latestAvailableSeq: number): Promise; }; export declare const objects: { put(path: string, dataBase64: string, retentionUntilMs?: number): Promise; get(path: string): Promise; getResult(path: string): Promise; }; export declare const query: { request(path: string, dataBase64: string): Promise; scopedRequest(request: { requestId: string; requesterId: string; path: string; dataBase64: string; capability: { capabilityId: string; pathPrefix: string; targetId: string; expiresAtMs: number; maxUses: number; }; }): Promise; respond(requestId: string, dataBase64: string): Promise; scopedRespond(reply: { requestId: string; responderId: string; dataBase64: string; capabilityId: string; }): Promise; }; export declare function status(): Promise<{ health: string; transport: string; pendingPublishes: number; pendingQueries: number; retainedObjects: number; repairableObjects: number; expiringObjects: number; nextExpiryMs?: number | null; lastError: string | null; }>; export declare function onTopic(cb: (p: HostEventMap["meshTopic"]) => void): Unsub; export declare function onQuery(cb: (p: HostEventMap["meshQuery"]) => void): Unsub; export declare function onReply(cb: (p: HostEventMap["meshReply"]) => void): Unsub; export declare function onScopedQuery(cb: (p: HostEventMap["meshScopedQuery"]) => void): Unsub; export declare function onScopedReply(cb: (p: HostEventMap["meshScopedReply"]) => void): Unsub; export declare function onPresence(cb: (p: HostEventMap["meshPresence"]) => void): Unsub; export declare function onHeartbeat(cb: (p: HostEventMap["meshHeartbeat"]) => void): Unsub; export declare const privateObjects: { put(dataBase64: string, policy?: { expiresAtMs?: number; suppressPreviews?: boolean; }): Promise; get(handle: MeshOpaqueHandle, capability: MeshCapability): Promise; }; export declare const privateQuery: { request(handle: MeshOpaqueHandle, capability: MeshCapability, dataBase64: string): Promise; }; export declare const privateControl: { publish(capability: MeshCapability, envelope: MeshControlEnvelope): Promise; subscribe(capability: MeshCapability): Promise; }; export declare const privateReceipts: { publish(capability: MeshCapability, dataBase64: string): Promise; subscribe(capability: MeshCapability): Promise; }; export declare function onPrivateControl(cb: (p: HostEventMap["meshPrivateControl"]) => void): Unsub; export declare function onPrivateReceipt(cb: (p: HostEventMap["meshPrivateReceipt"]) => void): Unsub; export {}; //# sourceMappingURL=mesh.d.ts.map