/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Bytes } from "#general";
/** Define a schema to encode / decode convert type T to type E. */
export declare abstract class Schema<T, E = Bytes> {
    /** 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> = S extends Schema<infer T, any> ? T : never;
export type SchemaEncodedType<S> = S extends Schema<any, infer E> ? E : never;
//# sourceMappingURL=Schema.d.ts.map