import { Optional } from "./Types.js"; import { Identity } from "./Identity.js"; import { Uuid } from "./Uuid.js"; //#region src/types/Context.d.ts export interface EnvContext { readonly domain: string; readonly name: string; readonly host: string; readonly port: number; readonly app: string; get(key: string, alt?: string): Optional; } export declare class DotEnvContext implements EnvContext { readonly domain: string; readonly name: string; readonly host: string; readonly port: number; readonly app: string; readonly get: (key: string, alt?: string) => Optional; } export interface RequestContext { token?: any; identity?: Identity; jwt: string; correlationId?: Uuid; lastError?: string; lastErrorStack?: string; create: (f: () => void) => void; get(key: string): T; set(key: string, value: T): T; wrap(f: () => Promise): Promise; } export declare class BaseRequestContext implements RequestContext { private state; get token(): any; set token(token: any); get identity(): Identity; get jwt(): string; set jwt(jwt: string); get correlationId(): Uuid; set correlationId(id: Uuid); get lastError(): Optional; set lastError(error: Optional); get(key: string): T; set(key: string, value: T): T; readonly create: (f: () => void) => void; readonly wrap: (f: () => Promise) => Promise; } export declare class BaseContext extends BaseRequestContext {} export interface Contexts { env?: EnvContext; request?: RequestContext; other?: any; } export declare class Context { protected state: Contexts; constructor(state?: Contexts); get env(): EnvContext; set env(env: EnvContext); get request(): RequestContext; set request(request: RequestContext); get other(): any; } export declare const ctx: Context; //#endregion //# sourceMappingURL=Context.d.ts.map