import type { ESPCDFGroup, ESPCDFUser, ESPCDFNode } from "../entities"; import type { ESPCDFCreateGroupRequest } from "../types/entities/user"; /** * Checks if a group is a valid home group (type home and mutuallyExclusive). */ export declare function isHome(group: ESPCDFGroup): boolean; /** * Returns only valid home groups from a list. */ export declare function getValidHomes(groups: ESPCDFGroup[]): ESPCDFGroup[]; /** * Finds a home by preferredId, then preferredName, then first valid home. */ export declare function findHomeGroup(groups: ESPCDFGroup[], options?: { preferredId?: string | null; preferredName?: string | null; }): ESPCDFGroup | null; /** * Finds a group by id, recursing into subGroups. */ export declare function findGroupById(groups: ESPCDFGroup[], groupId: string): ESPCDFGroup | undefined; /** * Ensures all home groups have mutuallyExclusive set to true (updates via API). */ export declare function ensureHomesAreMutuallyExclusive(groups: ESPCDFGroup[], needManualUpdate?: boolean): Promise; /** * Splits groups into primary (isPrimaryUser) and shared. */ export declare function categorizeGroupsByOwnership(groups: ESPCDFGroup[]): { primaryGroups: ESPCDFGroup[]; sharedGroups: ESPCDFGroup[]; }; /** * Returns a unique default home name (Home, Home 1, Home 2, ... or fallback with random suffix). */ export declare function getUniqueDefaultHomeName(existingGroups: ESPCDFGroup[]): string; /** * Builds a create-group payload for a home. */ export declare function createHomePayload(nodeIds?: string[]): ESPCDFCreateGroupRequest; /** * Creates a default home with a unique name (new user or migration). */ export declare function ensureDefaultHomeForNewOrMigratedUser(user: ESPCDFUser | null, nodeIds: string[], existingGroups: ESPCDFGroup[]): Promise; /** * Returns node IDs that are not assigned to any group and not matter types. */ export declare function getUnassignedNodes(allNodes: ESPCDFNode[], groups: ESPCDFGroup[]): string[]; /** * Fetches nodes for a group if nodeDetails is empty. */ export declare function fetchNodesIfEmpty(group: ESPCDFGroup | null): Promise; /** * Fetches nodes for all given homes and their rooms (fire-and-forget friendly). */ export declare function fetchNodesForAllValidHomes(validHomes: ESPCDFGroup[]): Promise;