UNPKG

homebridge

Version:
88 lines 3.32 kB
import type { MacAddress } from '@homebridge/hap-nodejs'; import type { ChildProcessLoadEventData, ChildProcessPortAllocatedEventData } from './childBridgeService.js'; import { ChildProcessMessageEventType } from './childBridgeService.js'; import 'source-map-support/register.js'; export declare class ChildBridgeFork { private bridgeService; private api; private pluginManager; private externalPortService; private matterManager?; private matterMessageHandler?; private type; private plugin; private identifier; private pluginConfig; private bridgeConfig; private bridgeOptions; private portRequestCallback; constructor(); sendMessage<T = unknown>(type: ChildProcessMessageEventType, data?: T): void; loadPlugin(data: ChildProcessLoadEventData): Promise<void>; startBridge(): Promise<void>; /** * Decide whether to publish the HAP bridge based on the bridge's `hap` * config block. Three branches: * - HAP enabled and not externalsOnly → publishBridge() * - externalsOnly: true → log externalsOnly notice, externals will publish via their own path * - hap.enabled: false → log disabled notice (warn if Matter is also inactive, * since the child bridge then advertises nothing at all) * * Public for testability (the bridgeService dependency is set up in startBridge, * so direct invocation from tests is straightforward with a mocked bridgeService). */ publishHapIfEnabled(): void; /** * Request the next available external HAP port from the parent process * @param username */ requestExternalPort(username: MacAddress): Promise<number | undefined>; /** * Request the next available Matter port from the parent process * @param uniqueId - MAC-derived identifier (without colons) */ requestMatterPort(uniqueId: string): Promise<number | undefined>; /** * Handles the port allocation response message from the parent process * @param data */ handleExternalResponse(data: ChildProcessPortAllocatedEventData): void; /** * Tell the parent process to release a previously allocated Matter port. * Fire-and-forget; the parent's allocator will reclaim the slot. */ releaseMatterPort(uniqueId: string): void; /** * Sends the current pairing status of the child bridge to the parent process */ sendPairedStatusEvent(): void; /** * Handle start Matter monitoring request from parent process */ handleStartMatterMonitoring(): void; /** * Handle stop Matter monitoring request from parent process */ handleStopMatterMonitoring(): void; /** * Handle get Matter accessories request from parent process */ handleGetMatterAccessories(): void; /** * Handle get Matter accessory info request from parent process */ handleGetMatterAccessoryInfo(data: { uuid: string; }): void; /** * Handle Matter accessory control request from parent process */ handleMatterAccessoryControl(data: { uuid: string; cluster: string; attributes: Record<string, unknown>; partId?: string; }): void; shutdown(): void; } //# sourceMappingURL=childBridgeFork.d.ts.map