refactor(swagger-ui): enable isolated declarations (#1208)

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

View File

@ -0,0 +1,5 @@
---
'@hono/swagger-ui': patch
---
Add explicit return types

View File

@ -40,7 +40,7 @@ type OriginalSwaggerUIOptions = {
type SwaggerUIOptions = OriginalSwaggerUIOptions & DistSwaggerUIOptions
const SwaggerUI = (options: SwaggerUIOptions) => {
const SwaggerUI = (options: SwaggerUIOptions): string => {
const asset = remoteAssets({ version: options?.version })
delete options.version

View File

@ -123,7 +123,7 @@ const RENDER_TYPE_MAP = {
(typeof RENDER_TYPE)[keyof typeof RENDER_TYPE]
>
export const renderSwaggerUIOptions = (options: DistSwaggerUIOptions) => {
export const renderSwaggerUIOptions = (options: DistSwaggerUIOptions): string => {
const optionsStrings = Object.entries(options)
.map(([k, v]) => {
const key = k as keyof typeof RENDER_TYPE_MAP

View File

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