# @types/swagger-sails-hook

> TypeScript definitions for swagger-sails-hook

Latest version **0.7.13** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/swagger-sails-hook
pnpm add @types/swagger-sails-hook
yarn add @types/swagger-sails-hook
bun add @types/swagger-sails-hook
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.7.13 |
| Published | 2023-11-07 |
| First published | 2017-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/swagger-sails-hook
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-sails-hook
- npm.io page: https://npm.io/package/@types/swagger-sails-hook

## Dependencies (1)

- [@types/swagger-node-runner](https://npm.io/package/@types/swagger-node-runner.md) *

## Recent versions

- 0.7.13 (latest) — 2023-11-07
- 0.7.10 (ts3.0) — 2020-05-15
- 0.7.9 (ts2.4) — 2018-10-22
- 0.7.4 (ts2.0) — 2017-10-25
- 0.7.12 — 2023-10-18
- 0.7.11 — 2023-09-25
- 0.7.8 — 2018-02-26
- 0.7.7 — 2018-02-10
- 0.7.6 — 2018-01-03
- 0.7.5 — 2017-11-09
- 0.7.3 — 2017-08-21
- 0.7.2 — 2017-03-31
- 0.7.1 — 2017-03-28
- 0.7.0 — 2017-01-02

## README

# Installation
> `npm install --save @types/swagger-sails-hook`

# Summary
This package contains type definitions for swagger-sails-hook (https://github.com/apigee-127/swagger-sails#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-sails-hook.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-sails-hook/index.d.ts)
````ts
/* =================== USAGE ===================
// Registers itself as sails hook, when added to the project via `npm install swagger-sails-hook`.
// see http://sailsjs.com/documentation/concepts/extending-sails/hooks
 =============================================== */

import { Config, SailsMiddleware } from "swagger-node-runner";

export = SwaggerHook;

/**
 * Create a new `swagger-sails-hook` sails hook and register it with `sails`
 * @param sails - reference to the running sails instance
 * @returns SailsHook - `swagger-sails-hook` object implementing the Sails' hook specification.
 */
declare function SwaggerHook(sails: any): SwaggerHook.SailsHook;

declare namespace SwaggerHook {
    /**
     * `swagger-sails-hook` object implementing the Sails' hook specification.
     *
     * @see {@link http://sailsjs.com/documentation/concepts/extending-sails/hooks/hook-specification|Sails Hook Docs}
     * @see {@link http://sailsjs.com/documentation/anatomy/api/hooks/my-hook/index-js|Sails Hook Example}
     */
    interface SailsHook {
        /**
         * Perform startup tasks.
         * All Sails configuration is guaranteed to be completed before a hook’s initialize function runs.
         * @param done - called when `swagger-sails-hook`'s startup tasks have finished.
         */
        initialize(done: () => any): void;

        /**
         * `swagger-sails-hook` specific route bound to a Sails app at load time.
         *
         * It handles any unhandled requests (any routes that aren't bound in the app via a
         * custom route configuration or a blueprint) via the swagger middleware.
         */
        routes: {
            /** routes specified in the `after` object will be bound after custom and blueprint routes */
            after: {
                /**
                 * This route will match any routes that aren't bound in the app via a custom route configuration
                 * or a blueprint.
                 */
                "/*"(req: any, res: any, next: () => any): any;
            };
        };
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/swagger-node-runner](https://npmjs.com/package/@types/swagger-node-runner)

# Credits
These definitions were written by [Michael Mrowetz](https://github.com/micmro).

---
_Source: https://npm.io/package/@types/swagger-sails-hook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
