/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { ValueSupervisor } from "#behavior/supervision/ValueSupervisor.js"; import { Bytes } from "@matter/general"; import { DataModelPath } from "@matter/model"; /** * Api data envelope packages used for request and response. * * This allows for transparent conversion between our three "native" formats -- JS values, serialized JSON and * serialized TLV. */ export declare class Envelope { #private; constructor({ supervisor, js, json, tlv }: Envelope.Definition); /** * Validate against the schema. Casts to appropriate types if necessary. */ validate(path?: DataModelPath): void; /** * Convert a {@link js} value to {@link JSON}. * * This acts as a deep copy and optimizes JSON access. If TLV becomes a priority then we can make this conversion * configurable. */ convertToJson(): void; /** * Native JS format. */ get js(): T; /** * JSON format. */ get json(): string; /** * Serialized TLV format. */ get tlv(): AllowSharedBufferSource; } export declare namespace Envelope { interface Data { id?: string; js?: T; json?: string; tlv?: Bytes; } interface Definition extends Data { supervisor: ValueSupervisor; } } //# sourceMappingURL=Envelope.d.ts.map