@types/swagger-ui-express
Advanced tools
Comparing version
@@ -1,87 +0,108 @@ | ||
// Type definitions for swagger-ui-express 3.0 | ||
// Type definitions for swagger-ui-express 4.1 | ||
// Project: https://github.com/scottie1984/swagger-ui-express | ||
// Definitions by: Dmitry Rogozhny <https://github.com/dmitryrogozhny> | ||
// Florian Keller <https://github.com/ffflorian> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.8 | ||
import { RequestHandler } from "express"; | ||
import { ServeStaticOptions } from "serve-static"; | ||
import { RequestHandler } from 'express'; | ||
import { ServeStaticOptions } from 'serve-static'; | ||
interface JsonObject { [key: string]: any; } | ||
interface SwaggerUiOptions { [key: string]: any; } | ||
interface SwaggerOptions { [key: string]: any; } | ||
export interface JsonObject { | ||
[key: string]: any; | ||
} | ||
interface SwaggerUiExpress { | ||
/** | ||
* Creates a middleware function that returns the pre-generated html file for the Swagger UI page. | ||
* | ||
* @param swaggerDoc json object with the API schema. | ||
* @param opts swagger-ui-express options. | ||
* @param options custom swagger options. | ||
* @param customCss string with a custom css to embed into the page. | ||
* @param customfavIcon link to a custom favicon. | ||
* @param swaggerUrl Url of the swagger API schema, can be specified instead of the swaggerDoc. | ||
* @param customeSiteTitle custom title for a page | ||
* @returns an express middleware function that returns the generated html page. | ||
*/ | ||
setup(swaggerDoc?: JsonObject | null, | ||
opts?: SwaggerUiOptions | false | null, | ||
options?: SwaggerOptions, | ||
customCss?: string | false | null, | ||
customfavIcon?: string | false | null, | ||
swaggerUrl?: string | false | null, | ||
customeSiteTitle?: string | false | null): RequestHandler; | ||
export interface SwaggerOptions { | ||
[key: string]: any; | ||
} | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes custom initialization js file and static files of Swagger UI. | ||
* | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
serve: RequestHandler[]; | ||
export interface SwaggerUiOptions { | ||
customCss?: string; | ||
customCssUrl?: string; | ||
customfavIcon?: string; | ||
customJs?: string; | ||
customSiteTitle?: string; | ||
isExplorer?: boolean; | ||
options?: SwaggerOptions; | ||
swaggerUrl?: string; | ||
swaggerUrls?: string[]; | ||
} | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes custom initialization js file and static files of Swagger UI. | ||
* Additional options are passed to the express.static middleware. | ||
* | ||
* @param options options object that is passed to the express.static middleware. | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
serveWithOptions(options: ServeStaticOptions): RequestHandler[]; | ||
/** | ||
* Creates a middleware function that returns the pre-generated HTML file for the Swagger UI page. | ||
* | ||
* @param swaggerDoc JSON object with the API schema. | ||
* @param opts swagger-ui-express options. | ||
* @param options custom Swagger options. | ||
* @param customCss string with a custom CSS to embed into the page. | ||
* @param customfavIcon link to a custom favicon. | ||
* @param swaggerUrl URL of the Swagger API schema, can be specified instead of the swaggerDoc. | ||
* @param customSiteTitle custom title for a page. | ||
* @returns an express middleware function that returns the generated HTML page. | ||
*/ | ||
export function setup( | ||
swaggerDoc?: JsonObject, | ||
opts?: SwaggerUiOptions, | ||
options?: SwaggerOptions, | ||
customCss?: string, | ||
customfavIcon?: string, | ||
swaggerUrl?: string, | ||
customSiteTitle?: string, | ||
): RequestHandler; | ||
/** | ||
* Generates the custom html page for the UI API. | ||
* | ||
* @param swaggerDoc json object with the API schema. | ||
* @param opts swagger-ui-express options. | ||
* @param options custom swagger options. | ||
* @param customCss string with a custom css to embed into the page. | ||
* @param customfavIcon link to a custom favicon. | ||
* @param swaggerUrl Url of the swagger API schema, can be specified instead of the swaggerDoc. | ||
* @param customeSiteTitle custom title for a page | ||
* @returns the generated html page. | ||
*/ | ||
generateHTML(swaggerDoc?: JsonObject | null, | ||
opts?: SwaggerUiOptions | false | null, | ||
options?: SwaggerOptions, | ||
customCss?: string | false | null, | ||
customfavIcon?: string | false | null, | ||
swaggerUrl?: string | false | null, | ||
customeSiteTitle?: string | false | null): string; | ||
/** @deprecated */ | ||
export function setup(swaggerDoc?: JsonObject, isExplorer?: boolean): RequestHandler; | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes custom initialization js file and static files of Swagger UI. | ||
* Additional options object is passed to Swagger UI. | ||
* | ||
* @param swaggerDoc json object with the Swagger API schema. | ||
* @param opts options to pass to Swagger UI. | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
serveFiles(swaggerDoc?: JsonObject, opts?: SwaggerUiOptions): RequestHandler[]; | ||
} | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes the custom initialization JS file and static files of Swagger UI. | ||
* | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
export const serve: RequestHandler[]; | ||
declare const swaggerUiExpress: SwaggerUiExpress; | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes custom initialization js file and static files of Swagger UI. | ||
* Additional options are passed to the `express.static` middleware. | ||
* | ||
* @param options options object that is passed to the `express.static` middleware. | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
export function serveWithOptions(options: ServeStaticOptions): RequestHandler[]; | ||
export = swaggerUiExpress; | ||
/** | ||
* Generates the custom HTML page for the UI API. | ||
* | ||
* @param swaggerDoc JSON object with the API schema. | ||
* @param opts swagger-ui-express options. | ||
* @param options custom Swagger options. | ||
* @param customCss string with a custom CSS to embed into the page. | ||
* @param customfavIcon link to a custom favicon. | ||
* @param swaggerUrl URL of the Swagger API schema, can be specified instead of the swaggerDoc. | ||
* @param customSiteTitle custom title for a page. | ||
* @returns the generated HTML page. | ||
*/ | ||
export function generateHTML( | ||
swaggerDoc?: JsonObject, | ||
opts?: SwaggerUiOptions, | ||
options?: SwaggerOptions, | ||
customCss?: string, | ||
customfavIcon?: string, | ||
swaggerUrl?: string, | ||
customSiteTitle?: string, | ||
): string; | ||
/** @deprecated */ | ||
export function generateHTML(swaggerDoc?: JsonObject, isExplorer?: boolean): RequestHandler; | ||
/** | ||
* Returns handlers for serving Swagger UI files. | ||
* This includes custom initialization js file and static files of Swagger UI. | ||
* Additional options object is passed to Swagger UI. | ||
* | ||
* @param swaggerDoc JSON object with the Swagger API schema. | ||
* @param opts options to pass to Swagger UI. | ||
* @returns Express handlers that process requests and return files for Swagger UI. | ||
*/ | ||
export function serveFiles(swaggerDoc?: JsonObject, opts?: SwaggerUiOptions): RequestHandler[]; |
{ | ||
"name": "@types/swagger-ui-express", | ||
"version": "3.0.1", | ||
"version": "4.1.0", | ||
"description": "TypeScript definitions for swagger-ui-express", | ||
@@ -11,6 +11,11 @@ "license": "MIT", | ||
"githubUsername": "dmitryrogozhny" | ||
}, | ||
{ | ||
"name": "Florian Keller", | ||
"url": "https://github.com/ffflorian", | ||
"githubUsername": "ffflorian" | ||
} | ||
], | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -26,4 +31,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "9b9c71e3454174d72b0ac5c3bc86d983680389b6247944161a57c91d1b90e30d", | ||
"typesPublisherContentHash": "4a3766b37b321cb97d145eb490aa2f9f90a14f5d01ff818805f08e4cb65b9ae8", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -5,13 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for swagger-ui-express ( https://github.com/scottie1984/swagger-ui-express ). | ||
This package contains type definitions for swagger-ui-express (https://github.com/scottie1984/swagger-ui-express). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-ui-express | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-ui-express. | ||
Additional Details | ||
* Last updated: Mon, 10 Jun 2019 19:43:40 GMT | ||
* Dependencies: @types/express, @types/serve-static | ||
### Additional Details | ||
* Last updated: Mon, 11 Nov 2019 19:33:41 GMT | ||
* Dependencies: [@types/express](https://npmjs.com/package/@types/express), [@types/serve-static](https://npmjs.com/package/@types/serve-static) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Dmitry Rogozhny <https://github.com/dmitryrogozhny>. | ||
These definitions were written by Dmitry Rogozhny (https://github.com/dmitryrogozhny), and Florian Keller (https://github.com/ffflorian). |
6697
6.47%97
24.36%