/** * A sample export document, shared by the tests and the preview script. * * Shaped to cover the cases that have actually caused trouble: a spanning tile, * an empty cell, a tile pinned to a quality versus one left on auto, a disabled * camera (which must not appear in the picker), a camera with only a substream, * and a legacy slots-only layout that has to be upgraded on open. */ import type { ExportDoc } from "./types.ts" export function sampleDoc(): ExportDoc { return { config_path: "/tmp/rtsp-streamer-preview.yaml", max_tiles: 16, max_grid_dim: 8, qualities: ["high", "medium", "low"], daemon_running: true, config: { controller: { host: "192.168.1.1", username: "viewer", rtsp_port: 7441 }, display: {}, player: {}, cameras: [ { id: "c1", name: "Driveway", streams: { high: "rtsps://x/dw-hi", low: "rtsps://x/dw-lo" } }, { id: "c2", name: "Front Door", streams: { high: "rtsps://x/fd-hi", low: "rtsps://x/fd-lo" } }, { id: "c3", name: "Back Yard", streams: { low: "rtsps://x/by-lo" } }, { id: "c4", name: "Side Gate", streams: { high: "rtsps://x/sg-hi" }, disabled: true }, { name: "Shed (manual)", rtsp: "rtsp://10.0.0.9:554/stream1" }, ], layouts: [ { name: "main-plus", grid: "4x3", tiles: [ // A 3x2 hero tile with a column of small tiles down the right. { camera: "Driveway", col: 0, row: 0, colspan: 3, rowspan: 2, quality: "high" }, { camera: "Front Door", col: 3, row: 0, colspan: 1, rowspan: 1, quality: "low" }, { camera: "Back Yard", col: 3, row: 2, colspan: 1, rowspan: 1 }, // (3,1) and the bottom-left cells stay empty on purpose. ], }, { name: "quad", grid: "2x2", tiles: [{ camera: "Driveway", col: 0, row: 0 }] }, // Legacy row-major form; openEditor() upgrades it to tiles. { name: "legacy", grid: "2x1", slots: ["Front Door", "Back Yard"] }, ], active_layout: "main-plus", clock: {}, }, } }