# @types/microrouter

> TypeScript definitions for microrouter

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

## Install

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

## 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 | 3.1.6 |
| Published | 2023-11-07 |
| First published | 2017-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

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

## Dependencies (3)

- [@types/node](https://npm.io/package/@types/node.md) *
- [url-pattern](https://npm.io/package/url-pattern.md) ^1.0.3
- [@types/micro](https://npm.io/package/@types/micro.md) ^7.3.7

## Recent versions

- 3.1.6 (latest) — 2023-11-07
- 3.1.3 (ts4.2) — 2023-02-09
- 3.1.2 (ts4.0) — 2022-06-14
- 3.1.1 (ts2.2) — 2019-09-30
- 2.2.0 (ts2.0) — 2017-08-01
- 3.1.5 — 2023-10-18
- 3.1.4 — 2023-09-27
- 3.1.0 — 2018-06-18
- 2.2.2 — 2018-03-15
- 2.2.1 — 2017-11-09

## README

# Installation
> `npm install --save @types/microrouter`

# Summary
This package contains type definitions for microrouter (https://github.com/pedronauck/micro-router#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/microrouter.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/microrouter/index.d.ts)
````ts
/// <reference types="node"/>

import { IncomingMessage, Server, ServerResponse as HttpServerResponse } from "http";
import { RequestHandler } from "micro";
import UrlPattern = require("url-pattern");

export type ServerResponse = HttpServerResponse;
export type ServerRequest = IncomingMessage & {
    params: { [key: string]: string };
    query: { [key: string]: string };
};
export type AugmentedRequestHandler = (
    req: ServerRequest,
    res: ServerResponse,
) => any;

export type RouteHandler = (path: string | UrlPattern, handler: AugmentedRequestHandler) => RequestHandler;

export function router(...routes: RequestHandler[]): RequestHandler;
export function withNamespace(namespace: string): (...routes: RequestHandler[]) => RequestHandler;

export const get: RouteHandler;
export const post: RouteHandler;
export const put: RouteHandler;
export const patch: RouteHandler;
export const del: RouteHandler;
export const head: RouteHandler;
export const options: RouteHandler;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/micro](https://npmjs.com/package/@types/micro), [@types/node](https://npmjs.com/package/@types/node), [url-pattern](https://npmjs.com/package/url-pattern)

# Credits
These definitions were written by [Mathieu Dutour](https://github.com/mathieudutour).

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