/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
import type { MatterClient } from "@matter-server/ws-client";
import { LitElement } from "lit";
import "./ha-svg-icon.js";
export declare const CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_ID = 1361;
export declare const AVSM_FEAT_WMARK: number;
export declare const AVSM_FEAT_OSD: number;
export declare const AVSM_FEATURE_MAP_ATTR_ID = 65532;
type StreamState = "idle" | "connecting" | "streaming" | "error";
export declare class WebRtcStreamView extends LitElement {
    client?: MatterClient;
    nodeId: number | bigint;
    endpointId: number;
    resolution: {
        width: number;
        height: number;
    } | null;
    watermarkEnabled: boolean;
    osdEnabled: boolean;
    private _state;
    private _errorMessage;
    snapshotResolution: {
        width: number;
        height: number;
    } | null;
    private _snapshotStreamId;
    private _snapshotResolution;
    /** True when we allocated this stream ourselves and must Deallocate it on stop. False when reusing an existing allocation. */
    private _videoStreamOwned;
    private _audioStreamOwned;
    private _snapshotStreamOwned;
    private _video?;
    private _pc;
    private _localIceQueue;
    private _answerReceived;
    private _webRtcSessionId;
    private _videoStreamId;
    private _audioStreamId;
    private _unsubscribe;
    private _stopping;
    private _endReceivedFromPeer;
    private _preSessionQueue;
    get state(): StreamState;
    get videoStreamId(): number | null;
    get muted(): boolean;
    setMuted(muted: boolean): void;
    disconnectedCallback(): void;
    render(): import("lit-html").TemplateResult<1>;
    start(): Promise<void>;
    stop(): Promise<void>;
    takeSnapshot(): Promise<{
        dataUri: string;
        resolution: {
            width: number;
            height: number;
        };
    }>;
    private _readAvsmFeatures;
    deallocateSnapshot(): Promise<void>;
    /**
     * Search AllocatedVideoStreams (attr 0x000F) for an entry whose advertised
     * capability ranges cover our requested params. Spec §11.2.1.2.1 says the
     * camera SHALL reuse a matching stream — reading first avoids creating
     * duplicates when a server's reuse logic is buggy or matching is too strict.
     */
    private _findMatchingVideoStream;
    private _findMatchingAudioStream;
    private _findMatchingSnapshotStream;
    private _ensureSnapshotStream;
    private _onWebRtcCallback;
    private _handleAnswer;
    /**
     * Some Matter cameras (notably the matter.js camera-controller example app) answer
     * `a=sendrecv` on audio m-lines even when our offer is `a=recvonly`. Per RFC 3264 the
     * only valid mirror of recvonly is sendonly; sendrecv triggers
     * "Answer tried to set recv when offer did not set send" in setRemoteDescription.
     * We add both video and audio transceivers as recvonly, so any sendrecv answer must
     * be coerced to sendonly to apply cleanly.
     */
    private _sanitizeAnswerSdp;
    private _handleRemoteIceCandidates;
    private _handleEnd;
    private _sendLocalIceCandidates;
    private _fireStateChange;
    static styles: import("lit").CSSResult;
}
declare global {
    interface HTMLElementTagNameMap {
        "webrtc-stream-view": WebRtcStreamView;
    }
}
export {};
//# sourceMappingURL=webrtc-stream-view.d.ts.map