-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
index.d.ts
122 lines (108 loc) · 2.68 KB
/
index.d.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
120
121
122
// Type definitions for express-jsdoc-swagger
// Project: https://github.com/BRIKEV/express-jsdoc-swagger
// Definitions by: Kevin MArtínez <https://github.com/kevinccbsg>
// Definitions: https://github.com/BRIKEV/express-jsdoc-swagger/index.d.ts
// TypeScript Version: 3.9.7
import { EventEmitter } from "events";
import express from "express";
import { SwaggerUiOptions } from "swagger-ui-express";
interface ContactObject {
name: string;
url?: string;
email?: string;
}
interface LicenseObject {
name: string;
url?: string;
email?: string;
}
interface InfoObject {
title: string;
version: string;
description?: string;
termsOfService?: string;
contact?: ContactObject;
license?: LicenseObject;
}
interface FlowObjectDefaults {
refreshUrl?: string
scopes: { [key: string]: string }
}
type SecurityObject =
| {
description?: string
} & (
| {
type: "mutualTLS"
}
| {
type: "apiKey"
name: string
in: "query" | "header" | "cookie"
}
| {
type: "http"
scheme:
| "basic"
| "digest"
| "dpop"
| "hoba"
| "mutual"
| "negotiate"
| "oauth"
| "scram-sha-1"
| "scram-sha-256"
| "vapid"
}
| {
type: "http"
scheme: "bearer"
bearerFormat: string
}
| {
type: "oauth2"
flows: {
implicit?: FlowObjectDefaults & {
authorizationUrl: string
}
password?: FlowObjectDefaults & {
tokenUrl: string
}
clientCredentials?: FlowObjectDefaults & {
tokenUrl: string
}
authorizationCode?: FlowObjectDefaults & {
authorizationUrl: string
tokenUrl: string
}
}
}
| {
type: "openIdConnect"
openIdConnectUrl: string
}
)
interface Security {
[key: string]: SecurityObject;
}
interface Servers {
url: string;
description: string;
variables?: object;
}
interface Options {
info: InfoObject;
baseDir: string;
filesPattern: string | string[];
security?: Security;
servers?: string[] | Servers[];
exposeSwaggerUI?: boolean;
swaggerUIPath?: string;
exposeApiDocs?: boolean;
apiDocsPath?: string;
swaggerUiOptions?: SwaggerUiOptions;
notRequiredAsNullable?: boolean;
}
type UserSwagger = Record<string, unknown>;
type EventEmiterHandler = (options: Options, userSwagger?: UserSwagger) => EventEmitter;
export default function expressJSDocSwagger(app: express.Application): EventEmiterHandler;