mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Update `TypeScript Version`s to be at least as high as dependencies' versions * Run through again
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
// Type definitions for Swagger-JSDoc
|
|
// Project: https://github.com/surnet/swagger-jsdoc
|
|
// Definitions by: Daniel Grove <https://github.com/drGrove>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.2
|
|
|
|
/* =================== USAGE ===================
|
|
|
|
import * as express from "express"
|
|
import swaggerJSDoc = require('swagger-jsdoc');
|
|
const app = express()
|
|
|
|
let options = {
|
|
swaggerDefinition: {
|
|
info: {
|
|
title: 'Hello World',
|
|
version: '1.0.0',
|
|
description: 'A sample API'
|
|
},
|
|
host: 'localhost:3000',
|
|
basePath: '/'
|
|
},
|
|
apis: [
|
|
'./example/routes*.js',
|
|
'./example/parameters.yaml'
|
|
]
|
|
}
|
|
};
|
|
|
|
var spec = swaggerJSDoc(options);
|
|
|
|
app.get('/api-docs.json', function(req, res) {
|
|
res.setHeader('Content-Type', 'application/json');
|
|
res.send(spec);
|
|
});
|
|
|
|
=============================================== */
|
|
|
|
declare module "swagger-jsdoc" {
|
|
function swaggerJSDoc(options?: any): any;
|
|
export = swaggerJSDoc;
|
|
}
|