/**
 * WebsocketJsonValue type.
 * @typedef {null | boolean | number | string | object} WebsocketJsonValue
 */
/**
 * WebsocketParams type.
 * @typedef {Record<string, WebsocketJsonValue>} WebsocketParams
 */
/**
 * Base class for app-defined 1:N pub/sub channels.
 *
 * Subclasses override:
 *  - `canSubscribe()` — subscribe-time auth (default `false`).
 *  - `subscribed()` / `unsubscribed()` — optional lifecycle hooks.
 *  - `matches(broadcastParams)` — broadcast routing filter.
 */
export default class VelociousWebsocketChannel {
    /**
     * Runs constructor.
     * @param {object} args
     * @param {string} args.subscriptionId - Client-assigned id, unique within the session.
     * @param {WebsocketParams} args.params - Subscribe params.
     * @param {import("./client/websocket-session.js").default} args.session - Owning session.
     */
    constructor({ subscriptionId, params, session }: {
        subscriptionId: string;
        params: WebsocketParams;
        session: import("./client/websocket-session.js").default;
    });
    subscriptionId: string;
    params: WebsocketParams;
    session: import("./client/websocket-session.js").default;
    _closed: boolean;
    /**
     * Subscribe-time auth. Default is `false` (deny). Channel authors
     * MUST override to allow subscriptions. Returning a Promise defers
     * the `channel-subscribed` confirmation until it resolves.
     * @returns {boolean | Promise<boolean>}
     */
    canSubscribe(): boolean | Promise<boolean>;
    /**
     * Optional — called once after `canSubscribe` resolves truthy and
     * before `channel-subscribed` is sent to the client. Use for
     * initial snapshot delivery.
     * @returns {void | Promise<void>}
     */
    subscribed(): void | Promise<void>;
    /**
     * Optional — called once when the subscription ends. Fires on
     * client-initiated `channel-unsubscribe` or on session teardown.
     * @returns {void | Promise<void>}
     */
    unsubscribed(): void | Promise<void>;
    /**
     * Called when the underlying socket drops and the session is
     * moved into the paused/grace registry. Either `onResume` fires
     * on successful client reconnect, or `unsubscribed()` fires when
     * the grace window expires.
     * @returns {void | Promise<void>}
     */
    onDisconnect(): void | Promise<void>;
    /**
     * Called after a client reconnect + `session-resume` rebinds this
     * subscription to a new socket.
     * @returns {void | Promise<void>}
     */
    onResume(): void | Promise<void>;
    /**
     * Called when the client sends updated metadata (e.g. after
     * sign-in / locale change). Override to react to session-level
     * metadata updates.
     * @param {WebsocketParams} _metadata - Updated metadata.
     * @returns {void | Promise<void>}
     */
    onMetadataChanged(_metadata: WebsocketParams): void | Promise<void>;
    /**
     * Broadcast routing filter. Called by `broadcastToChannel` for
     * each live subscription — returning true delivers the body via
     * `sendMessage`. Default matches all broadcasts regardless of
     * params; override for per-subscriber filtering.
     * @param {...WebsocketJsonValue} _broadcastArgs - Params forwarded from `broadcastToChannel` (ignored by default).
     * @returns {boolean} - True to deliver the broadcast to this subscriber.
     */
    matches(..._broadcastArgs: WebsocketJsonValue[]): boolean;
    /**
     * Returns sanitized diagnostics for debug snapshots.
     * Subclasses can override to expose non-sensitive routing details.
     * @returns {Record<string, ?>} Debug-safe subscription details.
     */
    debugSnapshot(): Record<string, unknown>;
    /**
     * Delivers a matched broadcast to this subscriber. Subclasses can
     * override when the outbound body must be tailored to subscription
     * params before sending.
     * @param {WebsocketJsonValue} body
     * @param {{eventId?: string}} [meta] - Optional event metadata.
     * @returns {void | Promise<void>}
     */
    deliverBroadcast(body: WebsocketJsonValue, meta?: {
        eventId?: string;
    }): void | Promise<void>;
    /**
     * Sends a `channel-message` frame to THIS subscriber only.
     * When `meta.eventId` is provided, the client receives it so it
     * can track its checkpoint for `lastEventId` replay on reconnect.
     * @param {WebsocketJsonValue} body
     * @param {{eventId?: string}} [meta] - Optional event metadata.
     * @returns {void}
     */
    sendMessage(body: WebsocketJsonValue, meta?: {
        eventId?: string;
    }): void;
    /**
     * Runs is closed.
      @returns {boolean} */
    isClosed(): boolean;
}
/**
 * WebsocketJsonValue type.
 */
export type WebsocketJsonValue = null | boolean | number | string | object;
/**
 * WebsocketParams type.
 */
export type WebsocketParams = Record<string, WebsocketJsonValue>;
//# sourceMappingURL=websocket-channel.d.ts.map