/** * The Cotal join link — the onboarding half of the wire contract (v0). * * cotal://[token@]host[:port]/space[?channel=a,b] plaintext * cotals://[token@]host[:port]/space[?channel=a,b] TLS required * cotal://user:pass@host/space user/password auth * * One copy-pasteable string carries server + credentials + space, so a peer * joins with a single value. The nats.js client does NOT read credentials from * a URL, so we parse them out here and hand them to connect() as options. */ export interface JoinLink { /** nats:// server URL (auth is carried separately, never in this string). */ servers: string; space: string; /** Channels from the link, if any (?channel=a,b). */ channels?: string[]; /** Whether a TLS connection is required. */ tls: boolean; /** Bare token (userinfo without a password). */ token?: string; /** Username (userinfo with a password). */ user?: string; pass?: string; } /** Parse a `cotal://` / `cotals://` join link. Throws on anything malformed. */ export declare function parseJoinLink(link: string): JoinLink; /** Build a join link from its parts (for an operator handing one out). */ export declare function formatJoinLink(opts: { host: string; port?: number; space: string; token?: string; tls?: boolean; channels?: string[]; }): string; //# sourceMappingURL=link.d.ts.map