// This Source Code Form is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/
import { EncodedFrame, protobufName as EncodedFrameProto, protobufPackage as EncodedFramePackage, } from "../protobuf.generated/EncodedFrame.js";
import { IMUData, protobufPackage } from "../protobuf.generated/IMUData.js";
import { ImageAnnotations, protobufName as ImageAnnotationsProto, protobufPackage as ImageAnnotationsPackage, } from "../protobuf.generated/ImageAnnotations.js";
import { ImgDetections, protobufName as ImgDetectionsProto, protobufPackage as ImgDetectionsPackage, } from "../protobuf.generated/ImgDetections.js";
import { ImgFrame, protobufName as ImgFrameProto, protobufPackage as ImgFramePackage, } from "../protobuf.generated/ImgFrame.js";
import { PointCloudData, protobufName as PointCloudDataProto, protobufPackage as PointCloudDataPackage, } from "../protobuf.generated/PointCloudData.js";
import { protobufName as SpatialImgDetectionsProto, protobufPackage as SpatialImgDetectionsPackage, SpatialImgDetections, } from "../protobuf.generated/SpatialImgDetections.js";
export const protobufs = {
    encodedFrame: {
        name: `${EncodedFramePackage}.${EncodedFrameProto}`,
        decoder: EncodedFrame,
        kind: "image",
    },
    imageFrame: {
        name: `${ImgFramePackage}.${ImgFrameProto}`,
        decoder: ImgFrame,
        kind: "image",
    },
    imageDetections: {
        name: `${ImgDetectionsPackage}.${ImgDetectionsProto}`,
        decoder: ImgDetections,
        kind: "annotations",
    },
    imageDetectionsCustom: {
        name: `${ImageAnnotationsPackage}.${ImageAnnotationsProto}`,
        decoder: ImageAnnotations,
        kind: "annotations",
    },
    imageDetectionsSpatial: {
        name: `${SpatialImgDetectionsPackage}.${SpatialImgDetectionsProto}`,
        decoder: SpatialImgDetections,
        kind: "annotations",
    },
    imu: {
        name: `${protobufPackage}.IMUData`,
        decoder: IMUData,
        kind: "imu",
    },
    pointCloud: {
        name: `${PointCloudDataPackage}.${PointCloudDataProto}`,
        decoder: PointCloudData,
        kind: "pointCloud",
    },
};
export function protobufSchemaNameToType(name) {
    switch (name) {
        case "imageFrame":
        case "encodedFrame":
            return "image";
        case "imageDetections":
        case "imageDetectionsCustom":
        case "imageDetectionsSpatial":
            return "annotations";
        case "imu":
            return "imu";
        case "pointCloud":
            return "pointCloud";
        default:
            throw new Error(`Unknown protobuf schema name: ${name}`);
    }
}
export const protobufsBySchema = Object.fromEntries(Object.entries(protobufs).map(([type, data]) => [data.name, { type, ...data }]));
//# sourceMappingURL=protobuf.js.map