/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { StreamApiEventDispatcher } from "../stream/dispatcher";
export class CameraRenderResult {
    constructor(stream, decodeFrame, { animationId, correlationId }, timeout) {
        this.data = undefined;
        this.onAnimationCompleted = new StreamApiEventDispatcher(stream, (msg) => { var _a, _b, _c; return ((_c = (_b = (_a = msg.event) === null || _a === void 0 ? void 0 : _a.animationCompleted) === null || _b === void 0 ? void 0 : _b.animationId) === null || _c === void 0 ? void 0 : _c.hex) === animationId; }, (msg) => { var _a, _b, _c; return ((_c = (_b = (_a = msg.event) === null || _a === void 0 ? void 0 : _a.animationCompleted) === null || _b === void 0 ? void 0 : _b.animationId) === null || _c === void 0 ? void 0 : _c.hex) || undefined; }, timeout);
        this.onFrameReceived = new StreamApiEventDispatcher(stream, (msg) => {
            var _a, _b, _c;
            return !!((_c = (_b = (_a = msg.request) === null || _a === void 0 ? void 0 : _a.drawFrame) === null || _b === void 0 ? void 0 : _b.frameCorrelationIds) === null || _c === void 0 ? void 0 : _c.some((id) => id === correlationId));
        }, (msg) => {
            var _a;
            return ((_a = msg.request) === null || _a === void 0 ? void 0 : _a.drawFrame) != null
                ? decodeFrame(msg.request.drawFrame)
                : undefined;
        }, timeout);
    }
}
//# sourceMappingURL=cameraRenderResult.js.map
