/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Bytes } from "@matter/general"; /** Define a schema to encode / decode convert type T to type E. */ export declare abstract class Schema { /** Encodes the value using the schema. */ encode(value: T): E; /** Decodes the encoded data using the schema. */ decode(encoded: E, validate?: boolean): T; protected abstract encodeInternal(value: T): E; protected abstract decodeInternal(encoded: E): T; /** Optional validator that can be used to enforce constraints on the data before encoding / after decoding. */ validate(_value: T): void; } export type SchemaType = S extends Schema ? T : never; export type SchemaEncodedType = S extends Schema ? E : never; //# sourceMappingURL=Schema.d.ts.map