import WarpError from "../errors/WarpError.js";
export const CURRENT_ATTACHMENT_SCHEMA_VERSION = 1;
/** Runtime-backed version for graph attachment records. */
export default class AttachmentSchemaVersion {
    value;
    constructor(value) {
        this.value = requireSchemaVersionValue(value);
        Object.freeze(this);
    }
    /** Returns the numeric attachment schema version. */
    toNumber() {
        return this.value;
    }
    /** Compares two attachment schema versions by runtime value. */
    equals(other) {
        return this.value === other.value;
    }
    /** Returns the current attachment schema version. */
    static current() {
        return new AttachmentSchemaVersion(CURRENT_ATTACHMENT_SCHEMA_VERSION);
    }
}
/** Validates an attachment schema version carrier. */
function requireSchemaVersionValue(value) {
    if (!Number.isInteger(value) || value <= 0) {
        throw new WarpError('AttachmentSchemaVersion must be a positive integer', 'E_VALIDATION');
    }
    return value;
}
