How can I extend third-party declaration files? for example, I want to extend Context from @types/koa and add an extra field(resource) to it.
Context
resource
You have to use module augmentation as described here:
import { Context } from "koa"; declare module "koa" { interface Context { resource: any; } }