// Generated by bynkc — do not edit by hand.
// context ops.metrics

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

import * as platform_time from "../platform/time.js";

export interface Stamp {
  make(): Promise<number>;
}

export const StampToken: unique symbol = Symbol("Stamp");

export class ClockStamp implements Stamp {
  constructor(private deps: { Clock: platform_time.Clock }) {}
  async make(): Promise<number> {
    const t = await this.deps.Clock.now();
    return t;
  }
}

export const ClockStampProvider = { token: StampToken, factory: (deps: any) => new ClockStamp(deps) };

export const report = {
  async call(deps: { Stamp: Stamp }): Promise<number> {
    const s = await deps.Stamp.make();
    return s;
  },
};

export interface OpsMetricsDeps {
  readonly Stamp: Stamp;
}

export function makeSurface(deps: OpsMetricsDeps) {
  return {
    async report(): Promise<number> {
      return report.call(deps);
    },
  };
}

