/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
class Schema {
  /** Encodes the value using the schema. */
  encode(value) {
    this.validate(value);
    return this.encodeInternal(value);
  }
  /** Decodes the encoded data using the schema. */
  decode(encoded, validate = true) {
    const result = this.decodeInternal(encoded);
    if (validate) {
      this.validate(result);
    }
    return result;
  }
  /** Optional validator that can be used to enforce constraints on the data before encoding / after decoding. */
  validate(_value) {
  }
}
export {
  Schema
};
//# sourceMappingURL=Schema.js.map
