@types/koa-convert
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

Installation

npm install --save @types/koa-convert

Summary

This package contains type definitions for koa-convert (https://github.com/koajs/convert).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-convert.

index.d.ts

import { DefaultContext, DefaultState, Middleware, Next } from "koa";

type MW<State, Context> = ((next: any) => Generator) | (Middleware<State, Context>);

declare namespace KoaConvert {
    interface convert {
        <State = DefaultState, Context = DefaultContext>(
            mw: MW<State, Context>,
        ): Middleware<State, Context>;

        compose<State = DefaultState, Context = DefaultContext>(
            ...mw: Array<MW<State, Context>>
        ): Middleware<State, Context>;

        back<State = DefaultState, Context = DefaultContext>(
            mw: MW<State, Context>,
        ): Middleware<State, Context>;
    }
}

declare const convert: KoaConvert.convert;

export = convert;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/koa

Credits

These definitions were written by Daniel Byrne.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/koa-convert

Weekly Downloads

3,256

Version

1.2.7

License

MIT

Unpacked Size

4.03 kB

Total Files

5

Last publish

Collaborators

  • types