// Minimal ambient types for the `uhppoted` CommonJS module (no bundled types). // Only the surface we use; extend as we adopt more of the API. // Upstream: https://github.com/uhppoted/uhppoted-lib-nodejs declare module "uhppoted" { export class Config { constructor( name?: string, bindAddr?: string, broadcastAddr?: string, listenAddr?: string, timeout?: number, controllers?: unknown[], debug?: boolean, ); } /** Either a bare controller serial, or an addressable descriptor. */ export type Controller = | number | { id: number; address?: string; protocol?: "udp" | "tcp" }; export interface Ctx { config: Config; locale?: string; } export interface DiscoveredController { deviceId: number; device: { serialNumber: number; address: string; netmask: string; gateway: string; MAC: string; version: string; date: string; }; } /** UDP broadcast discovery — returns every controller answering on the LAN. */ export function getDevices(ctx: Ctx): Promise; export function openDoor( ctx: Ctx, controller: Controller, door: number, ): Promise<{ deviceId: number; opened: boolean }>; export function getStatus( ctx: Ctx, controller: Controller, ): Promise>; export function getEvent( ctx: Ctx, controller: Controller, index: number, ): Promise>; export function getEventIndex( ctx: Ctx, controller: Controller, ): Promise<{ deviceId: number; index: number }>; export function setListener( ctx: Ctx, controller: Controller, address: string, port: number, ): Promise; // CommonJS default export (module.exports = { ... }). Destructure from this. const uhppoted: { Config: typeof Config; getDevices: typeof getDevices; openDoor: typeof openDoor; getStatus: typeof getStatus; getEvent: typeof getEvent; getEventIndex: typeof getEventIndex; setListener: typeof setListener; }; export default uhppoted; }