// Generated by bynkc — do not edit by hand.
// commons opacity.methods

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "./runtime.js";

export type Timestamp = number & { readonly __brand: "Timestamp" };

export const Timestamp = {
  of(value: number): Result<Timestamp, ValidationError> {
    if (!Number.isInteger(value)) {
      return Err({ field: "Timestamp", message: "must be an integer", value });
    }
    return Ok(value as Timestamp);
  },
  unsafe(value: number): Timestamp {
    return value as Timestamp;
  },
  before(self: Timestamp, other: Timestamp): boolean {
    return (self as number) < (other as number);
  },
  equals(self: Timestamp, other: Timestamp): boolean {
    return self === other;
  },
};

