/** * Pure payload normalisation. * * API and event-stream payloads are coerced through here before they reach * any component, so an unfamiliar shape — `null`, a missing field, or a * field of the wrong type — produces a well-formed, renderable value * instead of reaching a component and throwing (design.md D23). This is * what the error boundary (task 1.0) is a backstop for, not a substitute * for. * * Every function here is a pure coercion: given anything, it returns * something safe to render (or, for the event stream, `null` to mean * "ignore this event"). None of them throw. */ import type { Automation, AutomationRelationships, Capability, DeviceDescriptor, ExecutionRecord, HomekitStatus, LogEntry, Room, RoomWithMembers, StateMap, StatusChecks, StatusData, StreamEvent, TriggerDef } from "../types.js"; export declare function asString(value: unknown, fallback?: string): string; export declare function asNumber(value: unknown, fallback?: number): number; export declare function asNullableNumber(value: unknown): number | null; export declare function asBoolean(value: unknown, fallback?: boolean): boolean; export declare function asArray(value: unknown): T[]; export declare function asRecord(value: unknown): Record; export declare function normalizeStatusChecks(value: unknown): StatusChecks; export declare function normalizeStatus(value: unknown): StatusData; export declare function normalizeTrigger(value: unknown): TriggerDef; export declare function normalizeAutomation(value: unknown): Automation; export declare function normalizeLogEntry(value: unknown): LogEntry; export declare function normalizeState(value: unknown): StateMap; export declare function normalizeHomekitStatus(value: unknown): HomekitStatus | null; export declare function normalizeCapability(value: unknown): Capability; export declare function normalizeCapabilities(value: unknown): Capability[]; export declare function normalizeDeviceDescriptor(value: unknown): DeviceDescriptor; export declare function normalizeDeviceDescriptors(value: unknown): DeviceDescriptor[]; export declare function normalizeRoom(value: unknown): Room; export declare function normalizeRoomWithMembers(value: unknown): RoomWithMembers; export declare function normalizeRoomsWithMembers(value: unknown): RoomWithMembers[]; export declare function normalizeExecutionRecord(value: unknown): ExecutionRecord; export declare function normalizeExecutionHistory(value: unknown): ExecutionRecord[]; export declare function normalizeAutomationRelationships(value: unknown): AutomationRelationships; /** * Normalises one decoded SSE payload. An unrecognised or malformed category * — a future server version, a corrupt frame — degrades to `{category: * "unknown"}` rather than throwing (design.md D23), so the data layer can * unconditionally ignore anything it does not recognise. */ export declare function normalizeStreamEvent(value: unknown): StreamEvent; //# sourceMappingURL=normalize.d.ts.map