mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 08:17:54 +08:00
21 lines
463 B
TypeScript
21 lines
463 B
TypeScript
import swaggerSailsHook = require("swagger-sails-hook");
|
|
import * as express from "express";
|
|
|
|
const mockSailsApp = {
|
|
models: {},
|
|
conf: {},
|
|
sockets: {},
|
|
hooks: {},
|
|
lift: () => { /* do nothing */ }
|
|
};
|
|
|
|
// create and register hook
|
|
const swaggerHookRef = swaggerSailsHook(mockSailsApp);
|
|
if (typeof swaggerHookRef.routes.after['/*'] === 'function') {
|
|
// right type
|
|
}
|
|
|
|
swaggerHookRef.initialize(() => {
|
|
// do something, when initialized
|
|
});
|