UNPKG

homebridge

Version:
67 lines 2.21 kB
/** * Fabric Manager * * Handles fabric info queries, commissioned status checks, * and fabric removal operations. */ import type { ServerNode } from '@matter/main'; export interface FabricInfo { fabricIndex: number; fabricId: string; nodeId: string; rootVendorId: number; label?: string; } export interface CommissioningSnapshot { commissioned: boolean; fabricCount: number; fabrics: FabricInfo[]; } export declare class FabricManager { private readonly getServerNode; private readonly getMatterStoragePath; constructor(getServerNode: () => ServerNode | null, getMatterStoragePath: () => string | undefined); /** * Get fabric information for commissioned controllers */ getFabricInfo(): FabricInfo[]; /** * Whether the running server node is actually reporting its fabric list. * * `getFabricInfo()` returns `[]` both for "no controller is paired" and for * "the list could not be read", and the two need different answers. When the * operational credentials cluster hands back an array — even an empty one — * that array is the truth. */ private hasLiveFabricList; /** * Read fabric information from storage files */ private readFabricsFromStorage; /** * Check if the server is commissioned */ isCommissioned(): boolean; /** * Get the number of commissioned fabrics */ getCommissionedFabricCount(): number; /** * Get commissioned/fabricCount/fabrics in a single pass. * * Coalesces what would otherwise be three separate getFabricInfo() calls * (one each from isCommissioned, getCommissionedFabricCount, getFabricInfo). * In the cold path that means one sync filesystem scan instead of three. * Preserves the serverNode.state fast-path that isCommissioned() uses. */ getCommissioningSnapshot(): CommissioningSnapshot; /** * Remove a specific fabric (controller) from the bridge */ removeFabric(fabricIndex: number): Promise<void>; /** * Check if a specific fabric exists */ hasFabric(fabricIndex: number): boolean; } //# sourceMappingURL=FabricManager.d.ts.map