-
Notifications
You must be signed in to change notification settings - Fork 49
/
types.ts
119 lines (116 loc) · 2.98 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import type { OpenAPIV3 } from 'openapi-types'
import type { ReferenceConfiguration } from '@scalar/types'
import type { SwaggerUIOptions } from './swagger/types'
export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
/**
* Customize Swagger config, refers to Swagger 2.0 config
*
* @see https://swagger.io/specification/v2/
*/
documentation?: Omit<
Partial<OpenAPIV3.Document>,
| 'x-express-openapi-additional-middleware'
| 'x-express-openapi-validation-strict'
>
/**
* Choose your provider, Scalar or Swagger UI
*
* @default 'scalar'
* @see https://github.com/scalar/scalar
* @see https://github.com/swagger-api/swagger-ui
*/
provider?: 'scalar' | 'swagger-ui'
/**
* Version to use for Scalar cdn bundle
*
* @default 'latest'
* @see https://github.com/scalar/scalar
*/
scalarVersion?: string
/**
* Optional override to specifying the path for the Scalar bundle
*
* Custom URL or path to locally hosted Scalar bundle
*
* Lease blank to use default jsdeliver.net CDN
*
* @default ''
* @example 'https://unpkg.com/@scalar/[email protected]/dist/browser/standalone.js'
* @example '/public/standalone.js'
* @see https://github.com/scalar/scalar
*/
scalarCDN?: string
/**
* Scalar configuration to customize scalar
*'
* @see https://github.com/scalar/scalar/blob/main/documentation/configuration.md
*/
scalarConfig?: ReferenceConfiguration
/**
* Version to use for swagger cdn bundle
*
* @see unpkg.com/swagger-ui-dist
*
* @default 4.18.2
*/
version?: string
/**
* Determine if Swagger should exclude static files.
*
* @default true
*/
excludeStaticFile?: boolean
/**
* The endpoint to expose Swagger
*
* @default '/swagger'
*/
path?: Path
/**
* Paths to exclude from Swagger endpoint
*
* @default []
*/
exclude?: string | RegExp | (string | RegExp)[]
/**
* Options to send to SwaggerUIBundle
* Currently, options that are defined as functions such as requestInterceptor
* and onComplete are not supported.
*/
swaggerOptions?: Omit<
Partial<SwaggerUIOptions>,
| 'dom_id'
| 'dom_node'
| 'spec'
| 'url'
| 'urls'
| 'layout'
| 'pluginsOptions'
| 'plugins'
| 'presets'
| 'onComplete'
| 'requestInterceptor'
| 'responseInterceptor'
| 'modelPropertyMacro'
| 'parameterMacro'
>
/**
* Custom Swagger CSS
*/
theme?: string | {
light: string
dark: string
}
/**
* Using poor man dark mode 😭
*/
autoDarkMode?: boolean
/**
* Exclude methods from Swagger
*/
excludeMethods?: string[]
/**
* Exclude tags from Swagger or Scalar
*/
excludeTags?: string[]
}