0.1.5Updated 6 months ago
declare namespace Infinity {
  interface Context {
    uuid: string
    start: Date

    cookie_uuid: string
    cookie_existed: boolean
  
    notifications: InfinityNotification[]
  
    user: import("@infinity-beyond/modules/security/draco/draco_user.ts").DracoUser | null
  }

  type Events = {
    request: [request: Request, ctx: InfinityContext],
    response: [response: Response, ctx: InfinityContext],
  }

  interface ListenOptions {
    port?: number
  }
}

type InfinityContext<T extends Record<string, any> = Record<string, any>> = Omit<import("$fresh/server.ts").FreshContext<Infinity.Context>, 'params'> & { params: T }

type With<T, K extends Record<string, any>> = T & { [P in keyof K]: K[P] }