-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathindex.d.ts
61 lines (56 loc) · 2.12 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
import { Server } from 'restify';
export interface SwaggerPageOptions {
title: string;
version: string;
server: Server;
path: string;
description?: string;
tags?: SwaggerTag[];
host?: string;
schemes?: SwaggerScheme[];
apis?: string[];
definitions?: {[key: string]: any};
routePrefix?: string;
forceSecure?: boolean;
validatorUrl?: string;
supportedSubmitMethods?: SwaggerSupportedHttpMethods[];
securityDefinitions?: {[k: string]: SwaggerSecurityDefinition};
}
export type SwaggerScheme = 'http' | 'https' | 'ws' | 'wss';
export type SwaggerSupportedHttpMethods = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
export interface SwaggerTag {
name: string;
description: string;
}
interface SwaggerSecurityDefinitionBase {
description?: string;
}
interface SwaggerSecurityDefinitionBasic extends SwaggerSecurityDefinitionBase {
type: 'basic';
}
interface SwaggerSecurityDefinitionApiKey extends SwaggerSecurityDefinitionBase {
type: 'apiKey';
name: string;
in: 'query' | 'header';
}
interface SwaggerSecurityDefinitionOAuth2Base extends SwaggerSecurityDefinitionBase {
type: 'oauth2';
scopes: {[k: string]: string};
}
interface SwaggerSecurityDefinitionOauth2WithAuthorizationUrl extends SwaggerSecurityDefinitionOAuth2Base {
flow: 'implicit';
authorizationUrl: string;
}
interface SwaggerSecurityDefinitionOauth2WithTokenUrl extends SwaggerSecurityDefinitionOAuth2Base {
flow: 'password' | 'application';
tokenUrl: string;
}
interface SwaggerSecurityDefinitionOauth2WithAuthorizationAndTokenUrl extends SwaggerSecurityDefinitionOAuth2Base {
flow: 'accessCode';
authorizationUrl: string;
tokenUrl: string;
}
type SwaggerSecurityDefinitionOAuth2 = SwaggerSecurityDefinitionOauth2WithAuthorizationUrl |
SwaggerSecurityDefinitionOauth2WithTokenUrl | SwaggerSecurityDefinitionOauth2WithAuthorizationAndTokenUrl;
type SwaggerSecurityDefinition = SwaggerSecurityDefinitionBasic | SwaggerSecurityDefinitionApiKey | SwaggerSecurityDefinitionOAuth2;
export function createSwaggerPage(options: SwaggerPageOptions): void;