variable cropSnap

Codec for <CropSnap>.

Examples

Read a <CropSnap> element

import { assertEquals } from "@std/assert";
import { parse } from "@std/xml";
import { cropSnap } from "@hertzg/reolink-api/protocol/params";

const root = parse(
  '<CropSnap version="1.1"><channelId>0</channelId><width>640</width>' +
    "<heigth>360</heigth></CropSnap>",
).root;

assertEquals(cropSnap.decode(root).heigth, 360);

Type

XmlParam<"CropSnap", CropSnap>

Usage

import { cropSnap } from "protocol/params/mod.ts";