import dgram from "dgram"; import { Pilot as BulbPilot } from "../accessories/WizLight/pilot"; import { Pilot as SocketPilot } from "../accessories/WizSocket/pilot"; import { Device } from "../types"; import HomebridgeWizLan from "../wiz"; /** Same floor, in the seconds unit `discoveryInterval` is configured in. */ export declare const MIN_DISCOVERY_INTERVAL_SECONDS: number; export interface GetPilotOptions { /** * Arm the retransmit for this probe. Pass true only when the caller has no * cached state to fall back on, i.e. when HomeKit is genuinely blocked on * the reply — otherwise the extra copy is invisible and only adds load. */ retransmit?: boolean; /** * Invoked synchronously immediately before the probe is put on the wire. * Probes can be deferred by the rate limiter, so callers that need to * snapshot state "as of transmission" (see writeGeneration in the accessory * layer) must do it here rather than when they call getPilot. */ onTransmit?: () => void; } export declare function getPilot(wiz: HomebridgeWizLan, device: Device, callback: (error: Error | null, pilot: T) => void, options?: GetPilotOptions): void; /** * True when a probe for this device already exists — either on the wire or * deferred by the rate limiter — so a getPilot call would coalesce onto it * rather than transmit a new packet. */ export declare function hasInFlightGetPilot(mac: string): boolean; export declare function setPilot(wiz: HomebridgeWizLan, device: Device, pilot: Partial | Partial, callback: (error: Error | null) => void): void; export declare function createSocket(wiz: HomebridgeWizLan): dgram.Socket; export declare function bindSocket(wiz: HomebridgeWizLan, onReady: () => void): void; export declare function registerDiscoveryHandler(wiz: HomebridgeWizLan, addDevice: (device: Device) => void): void; export declare function sendDiscoveryBroadcast(service: HomebridgeWizLan): void; /** * Clears the rate limiter's memory of what was sent when. Exists for tests: * the throttles are keyed on wall-clock time in module scope, so without this * one test's transmissions would silence the next one's. */ export declare function resetRateLimitsForTesting(): void;