/** * The connection target shared by every URL builder in this module. * * @property host - The hostname or IP address of the homebridge-config-ui-x server. * @property port - The TCP port the server listens on. * @property tls - When `true`, URLs use the secure scheme (`https`/`wss`); when `false` or omitted, the plaintext scheme (`http`/`ws`). * * @category Log Client */ export interface EndpointTarget { readonly host: string; readonly port: number; readonly tls?: boolean; } /** * Build the HTTP(S) base URL (scheme + authority, no trailing slash) for the REST and auth endpoints. * * The returned string is the origin only - callers append the specific API path. We construct it through the platform `URL` so host and port are normalized and * encoded consistently, then read `URL.origin`, which yields the scheme + authority with no trailing slash, so callers can concatenate a leading-slash path without * producing a double slash. * * @param target - The connection target. See {@link EndpointTarget}. * * @returns The origin, e.g. `https://localhost:8581`, with no trailing slash. * * @category Log Client */ export declare function httpBaseUrl(target: EndpointTarget): string; /** * The connection target plus the raw handshake token, used to build the WebSocket connect URL. * * @property token - The raw JWT, passed verbatim in the query string. The server's WebSocket guard reads `client.handshake.query.token` with no `Bearer` prefix and no * fallback, so the token must be the bare JWT. * * @category Log Client */ export interface SocketTarget extends EndpointTarget { readonly token: string; } /** * Build the WebSocket connect URL for the live-log Socket.IO stream. * * The URL carries the Engine.IO version, the WebSocket transport selector, and the raw token in its query string; the server's handshake guard authenticates from that * token alone. We build through the platform `URL` and `searchParams` so the token is percent-encoded correctly (a JWT contains `.` and may carry `-`/`_` from base64url, * which are URL-safe, but routing through `searchParams` keeps encoding correct regardless of token shape). * * @param target - The connection target plus the raw token. See {@link SocketTarget}. * * @returns The full `ws(s)://host:port/socket.io/?EIO=4&transport=websocket&token=` connect URL. * * @category Log Client */ export declare function socketUrl(target: SocketTarget): string; //# sourceMappingURL=endpoints.d.ts.map