Skip to content
File

Blob: src/worker/types.ts

typescript30 lines
1import type { Context } from "hono";
2 
3export interface HostInfo {
4 kind: "control" | "subject" | "unknown";
5 originalHost: string;
6 normalizedHost: string;
7 controlPlaneHost: string;
8 subjectHostSuffix: string;
9 hostLabel?: string;
10}
11 
12export type AppVariables = {
13 requestId: string;
14 hostInfo: HostInfo;
15 session?: AuthenticatedSession;
16};
17 
18export interface AuthenticatedSession {
19 subjectId: string;
20 storageId: string;
21 sessionId: string;
22}
23 
24export type AppEnv = {
25 Bindings: Env;
26 Variables: AppVariables;
27};
28 
29export type AppContext = Context<AppEnv>;