1.2.7 • Published 2 years ago

@types/koa-convert v1.2.7

Weekly downloads
7,820
License
MIT
Repository
github
Last release
2 years ago

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

// Type definitions for koa-convert 1.2
// Project: https://github.com/koajs/convert, https://github.com/gyson/koa-convert
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import {
  Middleware,
  Next,
  DefaultState,
  DefaultContext,
} 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: Thu, 06 Jan 2022 21:01:24 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by Daniel Byrne.