import { ESPCDFAPIResponse, ESPCDFPaginatedAPIResponse, ESPCDFAPIDataResponse, ESPCDFSceneCreateInput } from "../types"; import { ESPCDFGroupOperationType, ESPCDFGroupInterface, ESPCDFGroupOperation, ESPCDFGroupSharingInfoInterface, ESPCDFScheduleCreateInput, ESPCDFAutomationCreateInput, ESPCDFIssueUserNoCResponse, ESPCDFIssueNodeNoCRequest, ESPCDFMatterCommissioningRequest, ESPCDFCommissioningProgress, ESPCDFMatterFabricDetails } from "../types"; import { ESPCDFNode } from "./ESPCDFNode"; import { ESPCDFScene } from "./ESPCDFScene"; import { ESPCDFSchedule } from "./ESPCDFSchedule"; import { ESPCDFAutomation } from "./ESPCDFAutomation"; import { ESPCDFDevice } from "./ESPCDFDevice"; import { ESPCDFOperationEventEmitter, ESPCDFOperationListener } from "../utils/OperationEventEmitter"; export declare class ESPCDFGroup implements ESPCDFGroupInterface { identifier: string; name: string; id: string; nodeIds: string[]; nodeDetails?: ESPCDFNode[]; subGroups?: ESPCDFGroup[]; isPrimaryUser?: boolean; accessType?: string; totalNodes?: number; parentId?: string; type?: string; mutuallyExclusive?: boolean; description?: string; metadata?: Record; customData?: Record; isMatter?: boolean; fabricId?: string; fabricDetails?: ESPCDFMatterFabricDetails; _raw: any; operations: ESPCDFGroupOperation; readonly events: ESPCDFOperationEventEmitter; constructor(groupData: ESPCDFGroupInterface); /** * Subscribe to all operation events * @param listener - The callback function to register * @returns Unsubscribe function */ subscribe(listener: ESPCDFOperationListener): () => void; /** * Remove all listeners and clean up */ dispose(): void; /** * Internal method to emit callbacks after operations */ private emit; /** * Wraps an operation with consistent event emission logic */ private runAndEmit; /** * Takes over the scalar data and SDK bindings of a freshly transformed group * while this instance (the one the store and the UI hold) stays the same object. * `subGroups` and `nodeDetails` are merged by the group store, which knows the * existing instances to keep. */ adoptFrom(incoming: ESPCDFGroup): void; /** * Fetches this group's nodes into the store ({@link nodeDetails}; a home's * rooms are filled from the same reply). Concurrent calls share one fetch. */ getNodes(): Promise; getSubGroups(): Promise; createSubGroup(options: Record): Promise; createScene(sceneData: ESPCDFSceneCreateInput): Promise; /** * Lists devices in this group that can participate in scenes (nodes exposing the scenes service), * one row per device with params, plus whether the node has reached its max scene count. * * Used for scene device selection / provisioning flows — not a raw node list. * @returns Promise> * @throws Error if the adaptor does not implement this operation * @example * const rows = await group.getSceneCapableDevices(); */ getSceneCapableDevices(): Promise<{ node: ESPCDFNode; device: ESPCDFDevice; isMaxSceneReached: boolean; }[]>; /** * Lists devices in this group that can participate in schedules (nodes exposing the schedules service), * one row per device with params, plus whether the node has reached its max schedule count * (same shape as scene rows: `isMaxSceneReached` is reused for the schedule service bound). * * Used for schedule device selection / provisioning flows. * @returns Promise> * @throws Error if the adaptor does not implement this operation * @example * const rows = await group.getScheduleCapableDevices(); */ getScheduleCapableDevices(): Promise<{ node: ESPCDFNode; device: ESPCDFDevice; isMaxSceneReached: boolean; }[]>; getScenes(): Promise; createSchedule(scheduleData: ESPCDFScheduleCreateInput): Promise; /** * Gets all schedules associated with nodes in this group (including subgroups) * * Fetches nodes from the group and extracts schedule configurations from their * services. Returns an array of ESPCDFSchedule entities that can be stored in ScheduleStore. * @returns Promise Array of schedule entities for this group's nodes * @throws Error if operation not supported or schedule extraction fails * @example * const schedules = await group.getSchedules(); * // Schedules will be automatically added to scheduleStore via callback */ getSchedules(): Promise; createAutomation(automationData: ESPCDFAutomationCreateInput): Promise; /** * Gets all automations associated with nodes in this group (including subgroups) * * Fetches nodes from the group and extracts automation configurations from their * services. Returns an array of ESPCDFAutomation entities that can be stored in AutomationStore. * @returns Promise Array of automation entities for this group's nodes * @throws Error if operation not supported or automation extraction fails * @example * const automations = await group.getAutomations(); * // Automations will be automatically added to automationStore via callback */ getAutomations(): Promise>; share(params: Record): Promise; removeSharingFor(username: string): Promise; transfer(params: Record): Promise; getSharingInfo(options: Record): Promise>; delete(): Promise; updateMetadata(metadata: Record): Promise; updateGroupInfo(updates: Record): Promise; addNodes(nodeIds: string[]): Promise; removeNodes(nodeIds: string[]): Promise; leave(): Promise; /** * Loads Matter fabric credentials from the cloud and updates {@link fabricDetails}. * Call only when {@link isMatter} is true (after {@link convertToMatterFabric} if needed). * @returns Fabric credentials for commissioning */ getFabricDetails(): Promise; /** * Converts this home to a Matter fabric when it is not Matter-enabled yet. * @returns Updated Matter fabric group (new instance when conversion occurred) */ convertToMatterFabric(): Promise; issueUserNoC(): Promise; /** * Issues a Matter node NoC for this fabric (`ESPRMFabric.issueNodeNoC`). * Call when {@link isMatter} is true. */ issueNodeNoC(request: ESPCDFIssueNodeNoCRequest): Promise; /** * Loads fabric nodes with full details (`ESPRMFabric.getNodesWithDetails`). * Call when {@link isMatter} is true. */ getNodesWithDetails(): Promise; startCommissioning(qrData: string, onProgress?: (message: ESPCDFCommissioningProgress) => void): Promise<() => void>; /** * Publishes param values through the adaptor group-level `setParams` path when supported. * @param payload The payload contains the value to publish and the target objects which represent the row of device and param that should receive the broadcast value for the given param. * @returns Adaptor-specific result. * @throws Error when the adaptor does not implement {@link ESPCDFGroupOperation.setParams}. */ setParams(payload: Record>): Promise; }