# @types/overload-protection

> TypeScript definitions for overload-protection

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

## Install

```sh
npm install @types/overload-protection
pnpm add @types/overload-protection
yarn add @types/overload-protection
bun add @types/overload-protection
```

## 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.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2023-11-07 |
| First published | 2020-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.2.4 (latest) — 2023-11-07
- 1.2.2 (ts4.3) — 2023-09-03
- 1.2.1 (ts3.6) — 2021-07-08
- 1.2.0 (ts2.8) — 2020-03-09
- 1.2.3 — 2023-10-18

## README

# Installation
> `npm install --save @types/overload-protection`

# Summary
This package contains type definitions for overload-protection (https://github.com/davidmarkclements/overload-protection).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/overload-protection.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/overload-protection/index.d.ts)
````ts
declare namespace protect {
    type KoaFrameworkSelection = "koa";
    type HttpFrameworkSelection = "express" | "http" | "restify";

    interface ProtectionConfig {
        production?: boolean | undefined;
        clientRetrySecs?: number | undefined;
        sampleInterval?: number | undefined;
        maxEventLoopDelay?: number | undefined;
        maxHeapUsedBytes?: number | undefined;
        maxRssBytes?: number | undefined;
        errorPropagationMode?: boolean | undefined;
        logging?: boolean | string | ((msg: string) => void) | undefined;
        logStatsOnReq?: false | undefined;
    }

    interface ProtectionInstance {
        overload: boolean;
        eventLoopOverload: boolean;
        heapUsedOverload: boolean;
        rssOverload: boolean;
        eventLoopDelay: number;
        maxEventLoopDelay: number;
        maxHeapUsedBytes: number;
        maxRssBytes: number;
    }

    interface KoaProtectionInstance extends ProtectionInstance {
        (ctx: object, next: () => any): any;
    }

    interface HttpProtectionInstance extends ProtectionInstance {
        (req: object, res: object, next: () => any): any;
    }
}

declare function protect(
    framework: protect.KoaFrameworkSelection,
    config?: protect.ProtectionConfig,
): protect.KoaProtectionInstance;
declare function protect(
    framework: protect.HttpFrameworkSelection,
    config?: protect.ProtectionConfig,
): protect.HttpProtectionInstance;

export = protect;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Daniel Hirth](https://github.com/dornfeder).

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