Skip to content

Commit a313f3e

Browse files
committed
fix: 为 json-schema-generator 库添加类型定义
1 parent 9e5c6e1 commit a313f3e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/generateRequestPayloadType.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { JSONSchema4 } from 'json-schema'
2-
// @ts-ignore
32
import jsonSchemaGenerator from 'json-schema-generator'
43
import JSON5 from 'json5'
54
import { Api, Method, Required, RequestBodyType, RequestFormItemType, PropDefinition } from './types'

src/thirdParties.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
declare module 'json-schema-generator' {
2+
import { JSONSchema4 } from 'json-schema'
3+
4+
function jsonSchemaGenerator(json: object): JSONSchema4
5+
6+
export default jsonSchemaGenerator
7+
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
]
1818
},
1919
"include": [
20-
"src"
20+
"src",
2121
]
2222
}

0 commit comments

Comments
 (0)