/** * @license * Copyright 2025-2026 Open Home Foundation * SPDX-License-Identifier: Apache-2.0 */ import { AttributeId, ClusterId } from "@matter/main"; import { ClusterModel, ValueModel } from "@matter/main/model"; import { EndpointNumber } from "@matter/main/types"; /** Convert stringified numbers in hex and normal style to either number or bigint. */ export declare function parseNumber(number: string): number | bigint; /** * Converts tag-based WebSocket data (with numeric keys) back to Matter.js data format (with camelCased names). * This is the reverse of convertMatterToWebSocketTagBased. */ export declare function convertWebSocketTagBasedToMatter(value: unknown, model: ValueModel | undefined, clusterModel: ClusterModel): unknown; /** * Converts camelized name-based WebSocket data to Matter.js data format. Mainly to ensure binary and epoch data */ export declare function convertCommandDataToMatter(value: unknown, model: ValueModel | undefined, clusterModel: ClusterModel): unknown; /** * Uses the matter.js Model to convert the response data for read, subscribe and invoke into a tag-based response * including conversion of data types. * * Model classification and struct member info are cached in WeakMaps so that repeated calls * for the same model (e.g. across 160 nodes with identical clusters) skip the metabase traversal. */ export declare function convertMatterToWebSocketTagBased(value: unknown, model: ValueModel | undefined, clusterModel: ClusterModel | undefined): unknown; /** * Same as convertMatterToWebSocketTagBased but uses camelCase names instead of numeric tag IDs for struct keys. * Used for command (invoke) responses to match Python Matter Server behavior. */ export declare function convertMatterToWebSocketNameBased(value: unknown, model: ValueModel | undefined, clusterModel: ClusterModel | undefined): unknown; /** * Serialize to JSON with BigInt support. * - BigInt values within safe integer range are converted to numbers * - Large BigInt values are output as raw decimal numbers (not quoted strings) */ export declare function toBigIntAwareJson(object: object, spaces?: number): string; /** * Parse JSON with BigInt support for large numbers that exceed JavaScript precision. * Numbers with 15+ digits that exceed MAX_SAFE_INTEGER are converted to BigInt. * * This function carefully avoids modifying numbers that appear inside string values. */ export declare function parseBigIntAwareJson(json: string): unknown; /** Use the matter.js model to convert the incoming data for write and invoke commands into the expected format. */ export declare function convertWebsocketDataToMatter(value: any, model: ValueModel): any; export declare function getDateAsString(date: Date): string; export declare function buildAttributePath(endpointId: number, clusterId: number, attributeId: number): string; /** * Parse an attribute path string into its components. * Supports wildcards (*) for endpoint, cluster, and attribute IDs. * Non-numeric values are treated as wildcards and returned as undefined. * * @param path - Attribute path string in format "endpoint/cluster/attribute" * @returns Object with endpointId, clusterId, attributeId - each undefined if wildcard */ export declare function splitAttributePath(path: string): { endpointId: EndpointNumber | undefined; clusterId: ClusterId | undefined; attributeId: AttributeId | undefined; }; //# sourceMappingURL=Converters.d.ts.map