Skip to Content
Types (TypeScript only)Overview

Types (TypeScript only)

Path: hono-backend/src/types/index.ts

TypeScript types exist only while you code. They disappear when JavaScript runs.
They help your editor autocomplete and catch mistakes early.

Important exports

HonoEnv

Tells Hono that after authMiddleware:

c.get('userId') // string c.get('user') // AuthUser

Routers use:

new Hono<HonoEnv>()

AuthUser

Safe user snapshot on the context (not the full Mongo document).

GooglePayload / IGoogleService / ITokenService

Contracts implemented by google.service.ts and token.service.ts — useful for tests and swapping mocks.

AppContext

Shorthand type alias for Context + HonoEnv (see source file).

No runtime code in this file — safe to import anywhere.

Last updated on