Skip to content
Myr

chore: update outdated links in JSDoc (#3089)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ryu · committed by GitHub · parent 7ba5866 · Browse files · 20 files+62 added−62 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

20 files+62 added−62 removed

  • other:+62 added−62 removed

20 files+62 added−62 removed

modified:src/middleware/basic-auth/index.ts+1 added-1 removed
modified:src/middleware/bearer-auth/index.ts+1 added-1 removed
29 unmodified lines
3031/**32 * Bearer Auth Middleware for Hono.33 *34 * @see {@link https://hono.dev/middleware/builtin/bearer-auth}34 * @see {@link https://hono.dev/docs/middleware/builtin/bearer-auth}35 *36 * @param {BearerAuthOptions} options - The options for the bearer authentication middleware.37 * @param {string | string[]} [options.token] - The string or array of strings to validate the incoming bearer token against.38 * @param {Function} [options.verifyToken] - The function to verify the token.
87 unmodified lines
modified:src/middleware/body-limit/index.ts+1 added-1 removed
23 unmodified lines
2425/**26 * Body Limit Middleware for Hono.27 *28 * @see {@link https://hono.dev/middleware/builtin/body-limit}28 * @see {@link https://hono.dev/docs/middleware/builtin/body-limit}29 *30 * @param {BodyLimitOptions} options - The options for the body limit middleware.31 * @param {number} options.maxSize - The maximum body size allowed.32 * @param {OnError} [options.onError] - The error handler to be invoked if the specified body size is exceeded.
83 unmodified lines
modified:src/middleware/cache/index.ts+1 added-1 removed
7 unmodified lines
89/**10 * Cache Middleware for Hono.11 *12 * @see {@link https://hono.dev/middleware/builtin/cache}12 * @see {@link https://hono.dev/docs/middleware/builtin/cache}13 *14 * @param {Object} options - The options for the cache middleware.15 * @param {string | Function} options.cacheName - The name of the cache. Can be used to store multiple caches with different identifiers.16 * @param {boolean} [options.wait=false] - A boolean indicating if Hono should wait for the Promise of the `cache.put` function to resolve before continuing with the request. Required to be true for the Deno environment.
111 unmodified lines
modified:src/middleware/compress/index.ts+1 added-1 removed
modified:src/middleware/cors/index.ts+1 added-1 removed
16 unmodified lines
1718/**19 * CORS Middleware for Hono.20 *21 * @see {@link https://hono.dev/middleware/builtin/cors}21 * @see {@link https://hono.dev/docs/middleware/builtin/cors}22 *23 * @param {CORSOptions} [options] - The options for the CORS middleware.24 * @param {string | string[] | ((origin: string, c: Context) => string | undefined | null)} [options.origin='*'] - The value of "Access-Control-Allow-Origin" CORS header.25 * @param {string[]} [options.allowMethods=['GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH']] - The value of "Access-Control-Allow-Methods" CORS header.
116 unmodified lines
modified:src/middleware/csrf/index.ts+1 added-1 removed
17 unmodified lines
1819/**20 * CSRF Protection Middleware for Hono.21 *22 * @see {@link https://hono.dev/middleware/builtin/csrf}22 * @see {@link https://hono.dev/docs/middleware/builtin/csrf}23 *24 * @param {CSRFOptions} [options] - The options for the CSRF protection middleware.25 * @param {string|string[]|(origin: string, context: Context) => boolean} [options.origin] - Specify origins.26 * @returns {MiddlewareHandler} The middleware handler function.
64 unmodified lines
modified:src/middleware/etag/index.ts+1 added-1 removed
31 unmodified lines
3233/**34 * ETag Middleware for Hono.35 *36 * @see {@link https://hono.dev/middleware/builtin/etag}36 * @see {@link https://hono.dev/docs/middleware/builtin/etag}37 *38 * @param {ETagOptions} [options] - The options for the ETag middleware.39 * @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value.40 * @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response.
48 unmodified lines
modified:src/middleware/jsx-renderer/index.ts+1 added-1 removed
72 unmodified lines
7374/**75 * JSX Renderer Middleware for hono.76 *77 * @see {@link{https://hono.dev/middleware/builtin/jsx-renderer}}77 * @see {@link{https://hono.dev/docs/middleware/builtin/jsx-renderer}}78 *79 * @param {ComponentWithChildren} [component] - The component to render, which can accept children and props.80 * @param {RendererOptions} [options] - The options for the JSX renderer middleware.81 * @param {boolean | string} [options.docType=true] - The DOCTYPE to be added at the beginning of the HTML. If set to false, no DOCTYPE will be added.
76 unmodified lines
modified:src/middleware/jwt/jwt.ts+1 added-1 removed
17 unmodified lines
1819/**20 * JWT Auth Middleware for Hono.21 *22 * @see {@link https://hono.dev/middleware/builtin/jwt}22 * @see {@link https://hono.dev/docs/middleware/builtin/jwt}23 *24 * @param {object} options - The options for the JWT middleware.25 * @param {string} [options.secret] - A value of your secret key.26 * @param {string} [options.cookie] - If this value is set, then the value is retrieved from the cookie header using that value as a key, which is then validated as a token.
110 unmodified lines
modified:src/middleware/logger/index.ts+1 added-1 removed
61 unmodified lines
6263/**64 * Logger Middleware for Hono.65 *66 * @see {@link https://hono.dev/middleware/builtin/logger}66 * @see {@link https://hono.dev/docs/middleware/builtin/logger}67 *68 * @param {PrintFunc} [fn=console.log] - Optional function for customized logging behavior.69 * @returns {MiddlewareHandler} The middleware handler function.70 *
23 unmodified lines
modified:src/middleware/method-override/index.ts+1 added-1 removed
33 unmodified lines
3435/**36 * Method Override Middleware for Hono.37 *38 * @see {@link https://hono.dev/middleware/builtin/method-override}38 * @see {@link https://hono.dev/docs/middleware/builtin/method-override}39 *40 * @param {MethodOverrideOptions} options - The options for the method override middleware.41 * @param {Hono} options.app - The instance of Hono is used in your application.42 * @param {string} [options.form=_method] - Form key with a value containing the method name.
104 unmodified lines
modified:src/middleware/pretty-json/index.ts+1 added-1 removed
10 unmodified lines
1112/**13 * Pretty JSON Middleware for Hono.14 *15 * @see {@link https://hono.dev/middleware/builtin/pretty-json}15 * @see {@link https://hono.dev/docs/middleware/builtin/pretty-json}16 *17 * @param {prettyOptions} [options] - The options for the pretty JSON middleware.18 * @param {number} [options.space=2] - Number of spaces for indentation.19 * @returns {MiddlewareHandler} The middleware handler function.
21 unmodified lines
modified:src/middleware/secure-headers/secure-headers.ts+1 added-1 removed
131 unmodified lines
132133/**134 * Secure Headers Middleware for Hono.135 *136 * @see {@link https://hono.dev/middleware/builtin/secure-headers}136 * @see {@link https://hono.dev/docs/middleware/builtin/secure-headers}137 *138 * @param {Partial<SecureHeadersOptions>} [customOptions] - The options for the secure headers middleware.139 * @param {ContentSecurityPolicyOptions} [customOptions.contentSecurityPolicy] - Settings for the Content-Security-Policy header.140 * @param {overridableHeader} [customOptions.crossOriginEmbedderPolicy=false] - Settings for the Cross-Origin-Embedder-Policy header.
126 unmodified lines
modified:src/middleware/timing/timing.ts+1 added-1 removed
35 unmodified lines
3637/**38 * Server-Timing Middleware for Hono.39 *40 * @see {@link https://hono.dev/middleware/builtin/timing}40 * @see {@link https://hono.dev/docs/middleware/builtin/timing}41 *42 * @param {TimingOptions} [config] - The options for the timing middleware.43 * @param {boolean} [config.total=true] - Show the total response time.44 * @param {boolean | ((c: Context) => boolean)} [config.enabled=true] - Whether timings should be added to the headers or not.
181 unmodified lines
modified:src/middleware/trailing-slash/index.ts+2 added-2 removed
6 unmodified lines
78/**9 * Trailing Slash Middleware for Hono.10 *11 * @see {@link https://hono.dev/middleware/builtin/trailing-slash}11 * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash}12 *13 * @returns {MiddlewareHandler} The middleware handler function.14 *15 * @example
25 unmodified lines
41/**42 * Append trailing slash middleware for Hono.43 * Append a trailing slash to the URL if it doesn't have one. For example, `/path/to/page` will be redirected to `/path/to/page/`.44 *45 * @see {@link https://hono.dev/middleware/builtin/trailing-slash}45 * @see {@link https://hono.dev/docs/middleware/builtin/trailing-slash}46 *47 * @returns {MiddlewareHandler} The middleware handler function.48 *49 * @example
22 unmodified lines
modified:src/context.ts+16 added-16 removed
240 unmodified lines
241 #req: HonoRequest<P, I['out']> | undefined242 /**243 * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.244 *245 * @see {@link https://hono.dev/api/context#env}245 * @see {@link https://hono.dev/docs/api/context#env}246 *247 * @example248 * ```ts249 * // Environment object for Cloudflare Workers
7 unmodified lines
257 finalized: boolean = false258 /**259 * `.error` can get the error object from the middleware if the Handler throws an error.260 *261 * @see {@link https://hono.dev/api/context#error}261 * @see {@link https://hono.dev/docs/api/context#error}262 *263 * @example264 * ```ts265 * app.use('*', async (c, next) => {
44 unmodified lines
310 return this.#req311 }312313 /**314 * @see {@link https://hono.dev/api/context#event}314 * @see {@link https://hono.dev/docs/api/context#event}315 * The FetchEvent associated with the current request.316 *317 * @throws Will throw an error if the context does not have a FetchEvent.318 */
5 unmodified lines
324 }325 }326327 /**328 * @see {@link https://hono.dev/api/context#executionctx}328 * @see {@link https://hono.dev/docs/api/context#executionctx}329 * The ExecutionContext associated with the current request.330 *331 * @throws Will throw an error if the context does not have an ExecutionContext.332 */
5 unmodified lines
338 }339 }340341 /**342 * @see {@link https://hono.dev/api/context#res}342 * @see {@link https://hono.dev/docs/api/context#res}343 * The Response object for the current request.344 */345 get res(): Response {346 this.#isFresh = false
27 unmodified lines
374375 /**376 * `.render()` can create a response within a layout.377 *378 * @see {@link https://hono.dev/api/context#render-setrenderer}378 * @see {@link https://hono.dev/docs/api/context#render-setrenderer}379 *380 * @example381 * ```ts382 * app.get('/', (c) => {
29 unmodified lines
412413 /**414 * `.setRenderer()` can set the layout in the custom middleware.415 *416 * @see {@link https://hono.dev/api/context#render-setrenderer}416 * @see {@link https://hono.dev/docs/api/context#render-setrenderer}417 *418 * @example419 * ```tsx420 * app.use('*', async (c, next) => {
16 unmodified lines
437438 /**439 * `.header()` can set headers.440 *441 * @see {@link https://hono.dev/api/context#body}441 * @see {@link https://hono.dev/docs/api/context#body}442 *443 * @example444 * ```ts445 * app.get('/welcome', (c) => {
51 unmodified lines
497498 /**499 * `.set()` can set the value specified by the key.500 *501 * @see {@link https://hono.dev/api/context#set-get}501 * @see {@link https://hono.dev/docs/api/context#set-get}502 *503 * @example504 * ```ts505 * app.use('*', async (c, next) => {
10 unmodified lines
516517 /**518 * `.get()` can use the value specified by the key.519 *520 * @see {@link https://hono.dev/api/context#set-get}520 * @see {@link https://hono.dev/docs/api/context#set-get}521 *522 * @example523 * ```ts524 * app.get('/', (c) => {
8 unmodified lines
533534 /**535 * `.var` can access the value of a variable.536 *537 * @see {@link https://hono.dev/api/context#var}537 * @see {@link https://hono.dev/docs/api/context#var}538 *539 * @example540 * ```ts541 * const result = c.var.client.oneMethod()
77 unmodified lines
619 * `.body()` can return the HTTP response.620 * You can set headers with `.header()` and set HTTP status code with `.status`.621 * This can also be set in `.text()`, `.json()` and so on.622 *623 * @see {@link https://hono.dev/api/context#body}623 * @see {@link https://hono.dev/docs/api/context#body}624 *625 * @example626 * ```ts627 * app.get('/welcome', (c) => {
20 unmodified lines
648649 /**650 * `.text()` can render text as `Content-Type:text/plain`.651 *652 * @see {@link https://hono.dev/api/context#text}652 * @see {@link https://hono.dev/docs/api/context#text}653 *654 * @example655 * ```ts656 * app.get('/say', (c) => {
24 unmodified lines
681682 /**683 * `.json()` can render JSON as `Content-Type:application/json`.684 *685 * @see {@link https://hono.dev/api/context#json}685 * @see {@link https://hono.dev/docs/api/context#json}686 *687 * @example688 * ```ts689 * app.get('/api', (c) => {
48 unmodified lines
738739 /**740 * `.redirect()` can Redirect, default status code is 302.741 *742 * @see {@link https://hono.dev/api/context#redirect}742 * @see {@link https://hono.dev/docs/api/context#redirect}743 *744 * @example745 * ```ts746 * app.get('/redirect', (c) => {
15 unmodified lines
762763 /**764 * `.notFound()` can return the Not Found Response.765 *766 * @see {@link https://hono.dev/api/context#notfound}766 * @see {@link https://hono.dev/docs/api/context#notfound}767 *768 * @example769 * ```ts770 * app.get('/notfound', (c) => {
9 unmodified lines
modified:src/hono-base.ts+11 added-11 removed
49 unmodified lines
50export type HonoOptions<E extends Env> = {51 /**52 * `strict` option specifies whether to distinguish whether the last path is a directory or not.53 *54 * @see {@link https://hono.dev/api/hono#strict-mode}54 * @see {@link https://hono.dev/docs/api/hono#strict-mode}55 *56 * @default true57 */58 strict?: boolean59 /**60 * `router` option specifices which router to use.61 *62 * @see {@link https://hono.dev/api/hono#router-option}62 * @see {@link https://hono.dev/docs/api/hono#router-option}63 *64 * @example65 * ```ts66 * const app = new Hono({ router: new RegExpRouter() })
2 unmodified lines
69 router?: Router<[H, RouterRoute]>70 /**71 * `getPath` can handle the host header value.72 *73 * @see {@link https://hono.dev/api/routing#routing-with-host-header-value}73 * @see {@link https://hono.dev/docs/api/routing#routing-with-host-header-value}74 *75 * @example76 * ```ts77 * const app = new Hono({
110 unmodified lines
188189 /**190 * `.route()` allows grouping other Hono instance in routes.191 *192 * @see {@link https://hono.dev/api/routing#grouping}192 * @see {@link https://hono.dev/docs/api/routing#grouping}193 *194 * @param {string} path - base Path195 * @param {Hono} app - other Hono instance196 * @returns {Hono} routed Hono instance
34 unmodified lines
231232 /**233 * `.basePath()` allows base paths to be specified.234 *235 * @see {@link https://hono.dev/api/routing#base-path}235 * @see {@link https://hono.dev/docs/api/routing#base-path}236 *237 * @param {string} path - base Path238 * @returns {Hono} changed Hono instance239 *
10 unmodified lines
250251 /**252 * `.onError()` handles an error and returns a customized Response.253 *254 * @see {@link https://hono.dev/api/hono#error-handling}254 * @see {@link https://hono.dev/docs/api/hono#error-handling}255 *256 * @param {ErrorHandler} handler - request Handler for error257 * @returns {Hono} changed Hono instance258 *
12 unmodified lines
271272 /**273 * `.notFound()` allows you to customize a Not Found Response.274 *275 * @see {@link https://hono.dev/api/hono#not-found}275 * @see {@link https://hono.dev/docs/api/hono#not-found}276 *277 * @param {NotFoundHandler} handler - request handler for not-found278 * @returns {Hono} changed Hono instance279 *
11 unmodified lines
291292 /**293 * `.mount()` allows you to mount applications built with other frameworks into your Hono application.294 *295 * @see {@link https://hono.dev/api/hono#mount}295 * @see {@link https://hono.dev/docs/api/hono#mount}296 *297 * @param {string} path - base Path298 * @param {Function} applicationHandler - other Request Handler299 * @param {MountOptions} [options] - options of `.mount()`
157 unmodified lines
457458 /**459 * `.fetch()` will be entry point of your app.460 *461 * @see {@link https://hono.dev/api/hono#fetch}461 * @see {@link https://hono.dev/docs/api/hono#fetch}462 *463 * @param {Request} request - request Object of request464 * @param {Env} Env - env Object465 * @param {ExecutionContext} - context of execution
17 unmodified lines
483 * const res = await app.request('/hello')484 * expect(res.status).toBe(200)485 * })486 * ```487 * @see https://hono.dev/api/hono#request487 * @see https://hono.dev/docs/api/hono#request488 */489 request = (490 input: RequestInfo | URL,491 requestInit?: RequestInit,
14 unmodified lines
506507 /**508 * `.fire()` automatically adds a global fetch event listener.509 * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.510 * @see https://hono.dev/api/hono#fire510 * @see https://hono.dev/docs/api/hono#fire511 * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API512 * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/513 */514 fire = (): void => {
9 unmodified lines
modified:src/http-exception.ts+1 added-1 removed
18 unmodified lines
1920/**21 * `HTTPException` must be used when a fatal error such as authentication failure occurs.22 *23 * @see {@link https://hono.dev/api/exception}23 * @see {@link https://hono.dev/docs/api/exception}24 *25 * @param {StatusCode} status - status code of HTTPException26 * @param {HTTPExceptionOptions} options - options of HTTPException27 * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
51 unmodified lines
modified:src/request.ts+17 added-17 removed
25 unmodified lines
26export class HonoRequest<P extends string = '/', I extends Input['out'] = {}> {27 /**28 * `.raw` can get the raw Request object.29 *30 * @see {@link https://hono.dev/api/request#raw}30 * @see {@link https://hono.dev/docs/api/request#raw}31 *32 * @example33 * ```ts34 * // For Cloudflare Workers
10 unmodified lines
45 routeIndex: number = 046 /**47 * `.path` can get the pathname of the request.48 *49 * @see {@link https://hono.dev/api/request#path}49 * @see {@link https://hono.dev/docs/api/request#path}50 *51 * @example52 * ```ts53 * app.get('/about/me', (c) => {
17 unmodified lines
7172 /**73 * `.req.param()` gets the path parameters.74 *75 * @see {@link https://hono.dev/api/routing#path-parameter}75 * @see {@link https://hono.dev/docs/api/routing#path-parameter}76 *77 * @example78 * ```ts79 * const name = c.req.param('name')
38 unmodified lines
118119 /**120 * `.query()` can get querystring parameters.121 *122 * @see {@link https://hono.dev/api/request#query}122 * @see {@link https://hono.dev/docs/api/request#query}123 *124 * @example125 * ```ts126 * // Query params
15 unmodified lines
142143 /**144 * `.queries()` can get multiple querystring parameter values, e.g. /search?tags=A&tags=B145 *146 * @see {@link https://hono.dev/api/request#queries}146 * @see {@link https://hono.dev/docs/api/request#queries}147 *148 * @example149 * ```ts150 * app.get('/search', (c) => {
10 unmodified lines
161162 /**163 * `.header()` can get the request header value.164 *165 * @see {@link https://hono.dev/api/request#header}165 * @see {@link https://hono.dev/docs/api/request#header}166 *167 * @example168 * ```ts169 * app.get('/', (c) => {
17 unmodified lines
187188 /**189 * `.parseBody()` can parse Request body of type `multipart/form-data` or `application/x-www-form-urlencoded`190 *191 * @see {@link https://hono.dev/api/request#parsebody}191 * @see {@link https://hono.dev/docs/api/request#parsebody}192 *193 * @example194 * ```ts195 * app.post('/entry', async (c) => {
32 unmodified lines
228229 /**230 * `.json()` can parse Request body of type `application/json`231 *232 * @see {@link https://hono.dev/api/request#json}232 * @see {@link https://hono.dev/docs/api/request#json}233 *234 * @example235 * ```ts236 * app.post('/entry', async (c) => {
7 unmodified lines
244245 /**246 * `.text()` can parse Request body of type `text/plain`247 *248 * @see {@link https://hono.dev/api/request#text}248 * @see {@link https://hono.dev/docs/api/request#text}249 *250 * @example251 * ```ts252 * app.post('/entry', async (c) => {
7 unmodified lines
260261 /**262 * `.arrayBuffer()` parse Request body as an `ArrayBuffer`263 *264 * @see {@link https://hono.dev/api/request#arraybuffer}264 * @see {@link https://hono.dev/docs/api/request#arraybuffer}265 *266 * @example267 * ```ts268 * app.post('/entry', async (c) => {
12 unmodified lines
281 * app.post('/entry', async (c) => {282 * const body = await c.req.blob();283 * });284 * ```285 * @see https://hono.dev/api/request#blob285 * @see https://hono.dev/docs/api/request#blob286 */287 blob(): Promise<Blob> {288 return this.cachedBody('blob')289 }
5 unmodified lines
295 * app.post('/entry', async (c) => {296 * const body = await c.req.formData();297 * });298 * ```299 * @see https://hono.dev/api/request#formdata299 * @see https://hono.dev/docs/api/request#formdata300 */301 formData(): Promise<FormData> {302 return this.cachedBody('formData')303 }
13 unmodified lines
317 *318 * @param target - The target of the validation.319 * @returns The validated data.320 *321 * @see https://hono.dev/api/request#valid321 * @see https://hono.dev/docs/api/request#valid322 */323 valid<T extends keyof I & keyof ValidationTargets>(target: T): InputToDataByTarget<I, T>324 valid(target: keyof ValidationTargets) {325 return this.#validatedData[target] as unknown
1 unmodified line
327328 /**329 * `.url()` can get the request url strings.330 *331 * @see {@link https://hono.dev/api/request#url}331 * @see {@link https://hono.dev/docs/api/request#url}332 *333 * @example334 * ```ts335 * app.get('/about/me', (c) => {
8 unmodified lines
344345 /**346 * `.method()` can get the method name of the request.347 *348 * @see {@link https://hono.dev/api/request#method}348 * @see {@link https://hono.dev/docs/api/request#method}349 *350 * @example351 * ```ts352 * app.get('/about/me', (c) => {
7 unmodified lines
360361 /**362 * `.matchedRoutes()` can return a matched route in the handler363 *364 * @see {@link https://hono.dev/api/request#matchedroutes}364 * @see {@link https://hono.dev/docs/api/request#matchedroutes}365 *366 * @example367 * ```ts368 * app.use('*', async function logger(c, next) {
18 unmodified lines
387388 /**389 * `routePath()` can retrieve the path registered within the handler390 *391 * @see {@link https://hono.dev/api/request#routepath}391 * @see {@link https://hono.dev/docs/api/request#routepath}392 *393 * @example394 * ```ts395 * app.get('/posts/:id', (c) => {
8 unmodified lines