TypeDoc converts comments in TypeScript source code into rendered HTML documentation or a JSON model. It is extensible and supports a variety of configurations. Available as a CLI or Node module.
TypeDoc documentation is comprehensive. Let’s now focus on how this is used in @vercel/edge.
export interface ModifiedRequest { /** * If set, overwrites the incoming headers to the origin request. * * This is useful when you want to pass data between a Middleware and a * Serverless or Edge Function. * * @example * <caption>Add a `x-user-id` header and remove the `Authorization` header</caption> * * ```ts * import { rewrite } from '@vercel/edge'; * export default async function middleware(request: Request): Promise<Response> { * const newHeaders = new Headers(request.headers); * newHeaders.set('x-user-id', 'user_123'); * newHeaders.delete('authorization'); * return rewrite(request.url, { * request: { headers: newHeaders } * }) * } * ``` */ headers?: Headers;}
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.