{"version":3,"file":"cluster.types.cjs","sources":["../../../src/config/cluster.types.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** One selectable option produced by a cluster param resolver. */\nexport interface ClusterParamOption {\n  value: string;\n  label: string;\n  rawMode: number;\n}\n\n/** Resolver hooks for Matter attribute ↔ UI param conversion. */\nexport interface ClusterParamResolver {\n  decodeOptions: (supportedModes: unknown) => ClusterParamOption[];\n  decodeValue: (rawValue: unknown, rawModes?: Record<string, number>) => string;\n  encodeValue: (\n    uiValue: string,\n    rawModes?: Record<string, number>,\n  ) => number | Record<string, unknown> | null;\n}\n\n/** Component of the XY color pair an XY-backed hue/saturation param renders. */\nexport type XyColorComponent = \"hue\" | \"saturation\";\n\n/** Declarative param definition inside a cluster registry entry. */\nexport interface ClusterParamDefinition {\n  name: string;\n  type: string;\n  valueAttribute: number;\n  optionsAttribute: number;\n  uiType: string;\n  dataType: string;\n  resolver: ClusterParamResolver;\n  /** RainMaker param properties; defaults to read+write on server clusters. */\n  properties?: string[];\n  /** UI control bounds and display hints merged into param `bounds`. */\n  meta?: Record<string, unknown>;\n  /** When true, {@link ESPRMMatterDeviceParam.setValue} invokes a Matter command instead of writing an attribute. */\n  writeAsCommand?: boolean;\n  /** Matter command id for one-shot invoke params. */\n  matterCommandId?: number;\n  /**\n   * Marks a Color Control hue/saturation param as XY-capable. When attribute\n   * gating would drop it (its HS `valueAttribute` is not advertised) but the\n   * endpoint advertises the CurrentX/CurrentY pair (0x3/0x4) without either HS\n   * attribute (0x0/0x1), the param compiles XY-backed instead: its value\n   * derives from the (CurrentX, CurrentY) pair and writes invoke `MoveToColor`\n   * — `resolver`/`matterCommandId` are bypassed on that backing.\n   */\n  xyColorComponent?: XyColorComponent;\n}\n\n/** Registry entry for a Matter cluster that compiles to UI params. */\nexport interface ClusterRegistryEntry {\n  clusterId: number;\n  name: string;\n  params: ClusterParamDefinition[];\n  /** Used when options attribute is not yet available in node params. */\n  defaultOptions?: ClusterParamOption[];\n}\n\n/** App-provided cluster registry keyed by hex cluster id (e.g. `\"0x54\"`). */\nexport type ClusterConfigMap = Record<string, ClusterRegistryEntry>;\n\n/** Placeholder UI value when a cluster value cannot be resolved yet. */\nexport const MATTER_PARAM_VALUE_UNKNOWN = \"unknown\";\n"],"names":[],"mappings":";;AAAA;;;;AAIG;AA8DH;AACO,MAAM,0BAA0B,GAAG;;;;"}