refactor(swagger-ui): enable isolated declarations (#1208)
parent
0bda87e4ee
commit
b8802e01b7
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/swagger-ui': patch
|
||||
---
|
||||
|
||||
Add explicit return types
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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