# @types/nut-pipe

> TypeScript definitions for nut-pipe

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

## Install

```sh
npm install @types/nut-pipe
pnpm add @types/nut-pipe
yarn add @types/nut-pipe
bun add @types/nut-pipe
```

## Health

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

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2023-11-07 |
| First published | 2021-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [@types/aws-lambda](https://npm.io/package/@types/aws-lambda.md) *

## Recent versions

- 1.1.5 (latest) — 2023-11-07
- 1.1.2 (ts3.7) — 2021-09-07
- 1.1.1 (ts3.5) — 2021-05-10
- 1.1.4 — 2023-10-18
- 1.1.3 — 2023-09-23
- 1.1.0 — 2021-03-30

## README

# Installation
> `npm install --save @types/nut-pipe`

# Summary
This package contains type definitions for nut-pipe (https://github.com/nodejs-projects-kenanhancer/nut-pipe).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nut-pipe.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nut-pipe/index.d.ts)
````ts
import {
    APIGatewayProxyEventV2,
    APIGatewayProxyHandlerV2,
    APIGatewayProxyStructuredResultV2,
    Context,
} from "aws-lambda";

export type AsyncBasicHandler<TContext = any, TResult = any> = (context: TContext) => Promise<TResult | Error>;

export type AsyncBasicMiddleware<T extends AsyncBasicHandler = AsyncBasicHandler> = T extends
    AsyncBasicHandler<infer TContext, infer TResult>
    ? (context: TContext, next: AsyncBasicHandler<TContext, TResult>) => Promise<TResult>
    : never;

export type AsyncLambdaHandler<
    TEvent = APIGatewayProxyEventV2,
    TContext = Context,
    TResult = APIGatewayProxyStructuredResultV2,
> = (event: TEvent, context: TContext) => Promise<TResult | Error>;

export type AsyncLambdaMiddleware<T extends AsyncLambdaHandler = AsyncLambdaHandler> = T extends
    AsyncLambdaHandler<infer TEvent, infer TContext, infer TResult>
    ? (event: TEvent, context: TContext, next: T) => Promise<TResult | Error>
    : never;

export type AsyncBasicMiddlewareWithServices<T extends AsyncBasicHandler = AsyncBasicHandler> = T extends
    AsyncBasicHandler<infer TContext, infer TResult> ? (
        context: TContext,
        services: Record<string, any>,
        next: AsyncBasicHandler<TContext, TResult>,
    ) => Promise<TResult | Error>
    : never;

export type AsyncLambdaMiddlewareWithServices<T extends AsyncLambdaHandler = AsyncLambdaHandler> = T extends
    AsyncLambdaHandler<infer TEvent, infer TContext, infer TResult>
    ? (event: TEvent, context: TContext, services: Record<string, any>, next: T) => Promise<TResult | Error>
    : never;

export type AsyncHandler = AsyncBasicHandler & AsyncLambdaHandler;

export type AsyncMiddleware<T = never> =
    | AsyncBasicMiddleware
    | AsyncBasicMiddlewareWithServices
    | AsyncLambdaMiddleware
    | AsyncLambdaMiddlewareWithServices
    | T;

export function buildPipeline(
    functions: Array<AsyncMiddleware<any>>,
    services?: Record<string, any>,
    index?: number,
): AsyncHandler;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/aws-lambda](https://npmjs.com/package/@types/aws-lambda)

# Credits
These definitions were written by [kenan hancer](https://github.com/kenanhancer).

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