refactor(swagger-editor): enable isolated declarations (#1207)

pull/1206/head
Jonathan Haines 2025-06-09 19:49:27 +10:00 committed by GitHub
parent 1cdfdbd292
commit 0bda87e4ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/swagger-editor': patch
---
Add explicit `MiddlewareHandler` return type

View File

@ -1,4 +1,4 @@
import type { Context } from 'hono' import type { Context, MiddlewareHandler } from 'hono'
import type { CustomSwaggerUIOptions } from './types' import type { CustomSwaggerUIOptions } from './types'
const DEFAULT_VERSION = '4.13.1' const DEFAULT_VERSION = '4.13.1'
@ -136,7 +136,7 @@ export interface SwaggerEditorOptions extends CustomSwaggerUIOptions {
version?: string version?: string
} }
export function swaggerEditor(options: SwaggerEditorOptions = {}) { export function swaggerEditor(options: SwaggerEditorOptions = {}): MiddlewareHandler {
const url = getUrl() const url = getUrl()
options.layout = 'StandaloneLayout' options.layout = 'StandaloneLayout'

View File

@ -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"],