@dimchansky/meshpost 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ import { type Signaling, type WebSocketConstructor } from './signaling.js';
2
+ /** Built-in public port-443 Nostr WebSocket relays used by default. */
3
+ export declare const defaultNostrRelays: readonly string[];
4
+ export interface NostrSignalingOptions {
5
+ /** Nostr relay URLs (`wss://` or `ws://`) to connect to in parallel for redundancy. @default defaultNostrRelays */
6
+ urls?: readonly string[];
7
+ /** Application namespace mixed into the hashed room tag. */
8
+ appId?: string;
9
+ /** Optional shared password to encrypt signaling payloads with AES-256-GCM (requires secure context). */
10
+ password?: string;
11
+ /**
12
+ * Derive the Nostr room tag cryptographically from `password` so room activity is hidden from outsiders
13
+ * (disables `'decrypt-failed'` detection when a peer enters the wrong password).
14
+ * @default false
15
+ */
16
+ privateTopic?: boolean;
17
+ /** Maximum time in milliseconds to wait for WebSocket open -> REQ -> EOSE per relay. @default 10000 */
18
+ handshakeTimeoutMs?: number;
19
+ /** Optional custom `WebSocket` constructor for headless runtimes or custom transports. */
20
+ WebSocket?: WebSocketConstructor;
21
+ }
22
+ /**
23
+ * Zero-backend port-443 signaling over public (or custom) NIP-01 Nostr relays.
24
+ * Uses ephemeral events (`kind: 25050` — never persisted to disk by relays), pure-TS BIP-340 Schnorr
25
+ * signatures, multi-relay redundancy, and `AES-256-GCM` E2E encryption when `password` is provided.
26
+ */
27
+ export declare function nostrSignaling(options?: NostrSignalingOptions): Signaling;