/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { ValueSupervisor } from "#behavior/supervision/ValueSupervisor.js";
import { Bytes } from "#general";
import { DataModelPath } from "#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<T = unknown> {
    #private;
    constructor({ supervisor, js, json, tlv }: Envelope.Definition<T>);
    /**
     * 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<T = unknown> {
        id?: string;
        js?: T;
        json?: string;
        tlv?: Bytes;
    }
    interface Definition<T = unknown> extends Data<T> {
        supervisor: ValueSupervisor;
    }
}
//# sourceMappingURL=Envelope.d.ts.map