// Generated by bynkc — do not edit by hand.
// context demo

import { Ok, Err, Some, None, type Result, type Option, type ValidationError, type JsonValue, type BoundaryError, type ServiceBinding, callService, boundaryError } from "../../runtime.js";

export interface Logger {
  info(message: string): Promise<void>;
}

export const LoggerToken: unique symbol = Symbol("Logger");

export interface Store {
  put(key: string): Promise<void>;
  get(key: string): Promise<void>;
}

export const StoreToken: unique symbol = Symbol("Store");

export class ConsoleLogger implements Logger {
  async info(message: string): Promise<void> {
    return undefined;
  }
}

export const ConsoleLoggerProvider = { token: LoggerToken, factory: () => new ConsoleLogger() };

export class LoggingStore implements Store {
  constructor(private deps: { Logger: Logger }) {}
  async put(key: string): Promise<void> {
    const __r0 = await this.deps.Logger.info("put");
    return undefined;
  }
  async get(key: string): Promise<void> {
    const __r0 = await this.deps.Logger.info("get");
    return undefined;
  }
}

export const LoggingStoreProvider = { token: StoreToken, factory: (deps: any) => new LoggingStore(deps) };

export const api = {
  async call(key: string, deps: { Store: Store }): Promise<void> {
    const __r0 = await deps.Store.put(key);
    return undefined;
  },
};

