# @types/statuses

> TypeScript definitions for statuses

Latest version **2.0.6** (published 2025-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/statuses
pnpm add @types/statuses
yarn add @types/statuses
bun add @types/statuses
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2025-06-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51429 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.6 (latest) — 2025-06-07
- 2.0.5 (ts5.0) — 2024-03-08
- 2.0.0 (ts3.8) — 2020-06-24
- 1.5.0 (ts2.7) — 2018-12-25
- 1.5.4 — 2025-06-07
- 1.5.3 — 2023-11-07
- 2.0.4 — 2023-11-07
- 1.5.2 — 2023-10-18
- 2.0.3 — 2023-10-18
- 2.0.2 — 2023-09-25
- 2.0.1 — 2023-01-12
- 1.5.1 — 2020-06-24
- 1.3.0 — 2017-08-14
- 1.2.28 — 2016-09-19
- 1.2.27 — 2016-07-14
- … 9 more at https://npm.io/package/@types/statuses/versions

## README

# Installation
> `npm install --save @types/statuses`

# Summary
This package contains type definitions for statuses (https://github.com/jshttp/statuses).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/statuses.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/statuses/index.d.ts)
````ts
type NumericAscii = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0";
type NonNumericAscii<S> = S extends `${NumericAscii}` ? never : any;

type IsNumericString<S extends string> = S extends `${number}` ? any : never;

type IsNonNumericString<S extends string> = S extends `${NonNumericAscii<S>}${infer _}` ? any : never;

export = status;

declare const status: status;

interface status {
    (code: number): string;
    <S extends string>(code: S): status.Result<S>;

    codes: number[];
    code: { [msg: string]: number | undefined };
    empty: { [code: number]: boolean | undefined };
    message: { [code: number]: string | undefined };
    redirect: { [code: number]: boolean | undefined };
    retry: { [code: number]: boolean | undefined };
}

declare namespace status {
    type Result<S extends string> = S extends IsNumericString<S> ? string
        : S extends IsNonNumericString<S> ? number
        : string | number;
}

````

### Additional Details
 * Last updated: Sat, 07 Jun 2025 02:15:25 GMT
 * Dependencies: none

# Credits
These definitions were written by [Tanguy Krotoff](https://github.com/tkrotoff), [BendingBender](https://github.com/BendingBender), and [Sebastian Beltran](https://github.com/bjohansebas).

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