Skip to content

Commit

Permalink
Merge pull request #11 from EdamAme-x/jsdoc-options
Browse files Browse the repository at this point in the history
docs: change jsdoc of hono-options
  • Loading branch information
EdamAme-x authored May 30, 2024
2 parents 5e1af0f + ac7c7b8 commit 225a968
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/hono-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,28 @@ type GetPath<E extends Env> = (request: Request, options?: { env?: E['Bindings']
export type HonoOptions<E extends Env> = {
/**
* `strict` option specifies whether to distinguish whether the last path is a directory or not.
*
* @see {@link https://hono.dev/api/hono#strict-mode}
*
* @default true
* @see https://hono.dev/api/hono#strict-mode
*/
strict?: boolean
/**
* `router` option specifices which router to use.
*
* @see {@link https://hono.dev/api/hono#router-option}
*
* @example
* ```ts
* const app = new Hono({ router: new RegExpRouter() })
* ```
* @see https://hono.dev/api/hono#router-option
*/
router?: Router<[H, RouterRoute]>
/**
* `getPath` can handle the host header value.
*
* @see {@link https://hono.dev/api/routing#routing-with-host-header-value}
*
* @example
* ```ts
* const app = new Hono({
Expand All @@ -76,7 +84,6 @@ export type HonoOptions<E extends Env> = {
* // headers: { host: 'www1.example.com' },
* // })
* ```
* @see https://hono.dev/api/routing#routing-with-host-header-value
*/
getPath?: GetPath<E>
}
Expand Down Expand Up @@ -469,10 +476,9 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
/**
* `.fire()` automatically adds a global fetch event listener.
* This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.
*
* @see {@link https://hono.dev/api/hono#fire}
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API}
* @see {@link https://developers.cloudflare.com/workers/reference/migrate-to-module-workers}
* @see https://hono.dev/api/hono#fire
* @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
* @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
*/
fire = () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down

0 comments on commit 225a968

Please sign in to comment.