import type { IMain } from "pg-promise";
import type { ISettingsService } from "../services/settings";
import type WhatsappService from "../services/whatsapp";
import type SignaldService from "../services/signald";
import type { IAppConfig } from "../../config";
import type { AppDatabase } from "@digiresilience/metamigo-db";

// add your service interfaces here

// extend the hapi types with our services and config
declare module "@hapi/hapi" {
  export interface Request {
    db(): AppDatabase;
    pgp: IMain;
  }
  export interface Server {
    config(): IAppConfig;
    db(): AppDatabase;
    pgp: IMain;
  }
}

declare module "@hapipal/schmervice" {
  interface AppServices {
    settingsService: ISettingsService;
    whatsappService: WhatsappService;
    signaldService: SignaldService;
  }

  interface SchmerviceDecorator {
    (namespace: "app"): AppServices;
  }
  type ServiceFunctionalInterface = { name: string };
}
