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'
|
||||
|
||||
export const hello = (message: string = 'Hello!') => {
|
||||
export const hello = (message: string = 'Hello!'): MiddlewareHandler => {
|
||||
return createMiddleware(async (c, next) => {
|
||||
await next()
|
||||
c.res.headers.append('X-Message', message)
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
|
||||
"emitDeclarationOnly": false
|
||||
"emitDeclarationOnly": false,
|
||||
"isolatedDeclarations": true
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["**/*.test.ts"],
|
||||
|
|
Loading…
Reference in New Issue