refactor(hello): enable isolated declarations (#1198)
parent
ab390305fb
commit
e1eae2078f
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@hono/hello': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add explicit `MiddlewareHandler` return type
|
|
@ -1,6 +1,7 @@
|
||||||
|
import type { MiddlewareHandler } from 'hono'
|
||||||
import { createMiddleware } from 'hono/factory'
|
import { createMiddleware } from 'hono/factory'
|
||||||
|
|
||||||
export const hello = (message: string = 'Hello!') => {
|
export const hello = (message: string = 'Hello!'): MiddlewareHandler => {
|
||||||
return createMiddleware(async (c, next) => {
|
return createMiddleware(async (c, next) => {
|
||||||
await next()
|
await next()
|
||||||
c.res.headers.append('X-Message', message)
|
c.res.headers.append('X-Message', message)
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
||||||
"emitDeclarationOnly": false
|
"emitDeclarationOnly": false,
|
||||||
|
"isolatedDeclarations": true
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts"],
|
"include": ["src/**/*.ts"],
|
||||||
"exclude": ["**/*.test.ts"],
|
"exclude": ["**/*.test.ts"],
|
||||||
|
|
Loading…
Reference in New Issue