variable preview

Codec for <Preview>.

Examples

Build a <Preview> element

import { assertStringIncludes } from "@std/assert";
import { preview } from "@hertzg/reolink-api/protocol/params";

const xml = preview.encode({
  channelId: 0,
  handle: 0,
  streamType: "mainStream",
});

assertStringIncludes(xml, "<streamType>mainStream</streamType>");

Type

XmlParam<"Preview", Preview>

Usage

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