@types/swagger-ui-express

  • Version 4.1.7
  • Published
  • 6.59 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/swagger-ui-express
yarn add @types/swagger-ui-express
pnpm add @types/swagger-ui-express

Overview

TypeScript definitions for swagger-ui-express

Index

Variables

variable serve

const serve: 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.

Functions

function generateHTML

generateHTML: {
(
swaggerDoc?: JsonObject,
opts?: SwaggerUiOptions,
options?: SwaggerOptions,
customCss?: string,
customfavIcon?: string,
swaggerUrl?: string,
customSiteTitle?: string
): string;
(swaggerDoc?: JsonObject, isExplorer?: boolean): RequestHandler;
};
  • Generates the custom HTML page for the UI API.

    Parameter swaggerDoc

    JSON object with the API schema.

    Parameter opts

    swagger-ui-express options.

    Parameter options

    custom Swagger options.

    Parameter customCss

    string with a custom CSS to embed into the page.

    Parameter customfavIcon

    link to a custom favicon.

    Parameter swaggerUrl

    URL of the Swagger API schema, can be specified instead of the swaggerDoc.

    Parameter customSiteTitle

    custom title for a page.

    Returns

    the generated HTML page.

  • Deprecated

function serveFiles

serveFiles: (
swaggerDoc?: JsonObject,
opts?: SwaggerUiOptions
) => 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.

    Parameter swaggerDoc

    JSON object with the Swagger API schema.

    Parameter opts

    options to pass to Swagger UI.

    Returns

    Express handlers that process requests and return files for Swagger UI.

function serveWithOptions

serveWithOptions: (options: ServeStaticOptions) => RequestHandler[];
  • 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.

    Parameter options

    options object that is passed to the express.static middleware.

    Returns

    Express handlers that process requests and return files for Swagger UI.

function setup

setup: {
(
swaggerDoc?: JsonObject,
opts?: SwaggerUiOptions,
options?: SwaggerOptions,
customCss?: string,
customfavIcon?: string,
swaggerUrl?: string,
customSiteTitle?: string
): RequestHandler;
(swaggerDoc?: JsonObject, isExplorer?: boolean): RequestHandler;
};
  • Creates a middleware function that returns the pre-generated HTML file for the Swagger UI page.

    Parameter swaggerDoc

    JSON object with the API schema.

    Parameter opts

    swagger-ui-express options.

    Parameter options

    custom Swagger options.

    Parameter customCss

    string with a custom CSS to embed into the page.

    Parameter customfavIcon

    link to a custom favicon.

    Parameter swaggerUrl

    URL of the Swagger API schema, can be specified instead of the swaggerDoc.

    Parameter customSiteTitle

    custom title for a page.

    Returns

    an express middleware function that returns the generated HTML page.

  • Deprecated

Interfaces

interface JsonObject

interface JsonObject {}

    index signature

    [key: string]: any;

      interface SwaggerOptions

      interface SwaggerOptions {}

        index signature

        [key: string]: any;

          interface SwaggerUiOptions

          interface SwaggerUiOptions {}

            property customCss

            customCss?: string | undefined;

              property customCssUrl

              customCssUrl?: string | undefined;

                property customfavIcon

                customfavIcon?: string | undefined;

                  property customJs

                  customJs?: string | string[] | undefined;

                    property customSiteTitle

                    customSiteTitle?: string | undefined;

                      property explorer

                      explorer?: boolean | undefined;

                        property isExplorer

                        isExplorer?: boolean | undefined;

                          property swaggerOptions

                          swaggerOptions?: SwaggerOptions | undefined;

                            property swaggerUrl

                            swaggerUrl?: string | undefined;

                              property swaggerUrls

                              swaggerUrls?: string[] | undefined;

                                Package Files (1)

                                Dependencies (2)

                                Dev Dependencies (0)

                                No dev dependencies.

                                Peer Dependencies (0)

                                No peer dependencies.

                                Badge

                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/swagger-ui-express.

                                • Markdown
                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/swagger-ui-express)
                                • HTML
                                  <a href="https://www.jsdocs.io/package/@types/swagger-ui-express"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>