@types/koa
Advanced tools
Comparing version 2.13.4 to 2.14.0
@@ -1,14 +0,1 @@ | ||
// Type definitions for Koa 2.13.1 | ||
// Project: http://koajs.com | ||
// Definitions by: DavidCai1993 <https://github.com/DavidCai1993> | ||
// jKey Lu <https://github.com/jkeylu> | ||
// Brice Bernard <https://github.com/brikou> | ||
// harryparkdotio <https://github.com/harryparkdotio> | ||
// Wooram Jun <https://github.com/chatoo2412> | ||
// Christian Vaagland Tellnes <https://github.com/tellnes> | ||
// Piotr Kuczynski <https://github.com/pkuczynski> | ||
// vnoder <https://github.com/vnoder> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 3.0 | ||
/* =================== USAGE =================== | ||
@@ -25,15 +12,16 @@ | ||
/// <reference types="node" /> | ||
import * as accepts from 'accepts'; | ||
import * as Cookies from 'cookies'; | ||
import { EventEmitter } from 'events'; | ||
import { IncomingMessage, ServerResponse, Server, IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; | ||
import { Http2ServerRequest, Http2ServerResponse } from 'http2'; | ||
import httpAssert = require('http-assert'); | ||
import * as HttpErrors from 'http-errors'; | ||
import * as Keygrip from 'keygrip'; | ||
import * as compose from 'koa-compose'; | ||
import { Socket, ListenOptions } from 'net'; | ||
import * as url from 'url'; | ||
import * as contentDisposition from 'content-disposition'; | ||
import { ParsedUrlQuery } from 'querystring'; | ||
import * as accepts from "accepts"; | ||
import { AsyncLocalStorage } from "async_hooks"; | ||
import * as Cookies from "cookies"; | ||
import { EventEmitter } from "events"; | ||
import { IncomingHttpHeaders, IncomingMessage, OutgoingHttpHeaders, Server, ServerResponse } from "http"; | ||
import { Http2ServerRequest, Http2ServerResponse } from "http2"; | ||
import httpAssert = require("http-assert"); | ||
import * as contentDisposition from "content-disposition"; | ||
import * as HttpErrors from "http-errors"; | ||
import * as Keygrip from "keygrip"; | ||
import * as compose from "koa-compose"; | ||
import { ListenOptions, Socket } from "net"; | ||
import { ParsedUrlQuery } from "querystring"; | ||
import * as url from "url"; | ||
@@ -338,3 +326,3 @@ declare interface ContextDelegatedRequest { | ||
*/ | ||
vary(field: string): void; | ||
vary(field: string | string[]): void; | ||
@@ -448,3 +436,3 @@ /** | ||
StateT = Application.DefaultState, | ||
ContextT = Application.DefaultContext | ||
ContextT = Application.DefaultContext, | ||
> extends EventEmitter { | ||
@@ -454,3 +442,3 @@ proxy: boolean; | ||
maxIpsCount: number; | ||
middleware: Application.Middleware<StateT, ContextT>[]; | ||
middleware: Array<Application.Middleware<StateT, ContextT>>; | ||
subdomainOffset: number; | ||
@@ -463,5 +451,5 @@ env: string; | ||
keys: Keygrip | string[]; | ||
ctxStorage: AsyncLocalStorage<Application.Context> | undefined; | ||
/** | ||
* | ||
* @param {object} [options] Application options | ||
@@ -474,11 +462,12 @@ * @param {string} [options.env='development'] Environment | ||
* @param {number} [options.maxIpsCount] Max IPs read from proxy IP header, default to 0 (means infinity) | ||
* | ||
* @param {boolean} [options.asyncLocalStorage] Enable AsyncLocalStorage | ||
*/ | ||
constructor(options?: { | ||
env?: string | undefined, | ||
keys?: string[] | undefined, | ||
proxy?: boolean | undefined, | ||
subdomainOffset?: number | undefined, | ||
proxyIpHeader?: string | undefined, | ||
maxIpsCount?: number | undefined | ||
env?: string | undefined; | ||
keys?: string[] | undefined; | ||
proxy?: boolean | undefined; | ||
subdomainOffset?: number | undefined; | ||
proxyIpHeader?: string | undefined; | ||
maxIpsCount?: number | undefined; | ||
asyncLocalStorage?: boolean | undefined; | ||
}); | ||
@@ -519,3 +508,3 @@ | ||
use<NewStateT = {}, NewContextT = {}>( | ||
middleware: Application.Middleware<StateT & NewStateT, ContextT & NewContextT> | ||
middleware: Application.Middleware<StateT & NewStateT, ContextT & NewContextT>, | ||
): Application<StateT & NewStateT, ContextT & NewContextT>; | ||
@@ -527,3 +516,3 @@ | ||
*/ | ||
callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => void; | ||
callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => Promise<void>; | ||
@@ -546,2 +535,7 @@ /** | ||
onerror(err: Error): void; | ||
/** | ||
* return currnect contenxt from async local storage | ||
*/ | ||
readonly currentContext: Application.Context | undefined; | ||
} | ||
@@ -564,3 +558,3 @@ | ||
*/ | ||
[key: string]: any; | ||
[key: PropertyKey]: any; | ||
} | ||
@@ -746,6 +740,7 @@ | ||
type ParameterizedContext<StateT = DefaultState, ContextT = DefaultContext, ResponseBodyT = unknown> = ExtendableContext | ||
& { state: StateT; } | ||
type ParameterizedContext<StateT = DefaultState, ContextT = DefaultContext, ResponseBodyT = unknown> = | ||
& ExtendableContext | ||
& { state: StateT } | ||
& ContextT | ||
& { body: ResponseBodyT; response: { body: ResponseBodyT }; }; | ||
& { body: ResponseBodyT; response: { body: ResponseBodyT } }; | ||
@@ -752,0 +747,0 @@ interface Context extends ParameterizedContext {} |
{ | ||
"name": "@types/koa", | ||
"version": "2.13.4", | ||
"description": "TypeScript definitions for Koa", | ||
"version": "2.14.0", | ||
"description": "TypeScript definitions for koa", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa", | ||
@@ -9,40 +9,35 @@ "license": "MIT", | ||
{ | ||
"name": "DavidCai1993", | ||
"url": "https://github.com/DavidCai1993", | ||
"githubUsername": "DavidCai1993" | ||
}, | ||
{ | ||
"name": "jKey Lu", | ||
"url": "https://github.com/jkeylu", | ||
"githubUsername": "jkeylu" | ||
"githubUsername": "jkeylu", | ||
"url": "https://github.com/jkeylu" | ||
}, | ||
{ | ||
"name": "Brice Bernard", | ||
"url": "https://github.com/brikou", | ||
"githubUsername": "brikou" | ||
"githubUsername": "brikou", | ||
"url": "https://github.com/brikou" | ||
}, | ||
{ | ||
"name": "harryparkdotio", | ||
"url": "https://github.com/harryparkdotio", | ||
"githubUsername": "harryparkdotio" | ||
"githubUsername": "harryparkdotio", | ||
"url": "https://github.com/harryparkdotio" | ||
}, | ||
{ | ||
"name": "Wooram Jun", | ||
"url": "https://github.com/chatoo2412", | ||
"githubUsername": "chatoo2412" | ||
"githubUsername": "chatoo2412", | ||
"url": "https://github.com/chatoo2412" | ||
}, | ||
{ | ||
"name": "Christian Vaagland Tellnes", | ||
"url": "https://github.com/tellnes", | ||
"githubUsername": "tellnes" | ||
"githubUsername": "tellnes", | ||
"url": "https://github.com/tellnes" | ||
}, | ||
{ | ||
"name": "Piotr Kuczynski", | ||
"url": "https://github.com/pkuczynski", | ||
"githubUsername": "pkuczynski" | ||
"githubUsername": "pkuczynski", | ||
"url": "https://github.com/pkuczynski" | ||
}, | ||
{ | ||
"name": "vnoder", | ||
"url": "https://github.com/vnoder", | ||
"githubUsername": "vnoder" | ||
"githubUsername": "vnoder", | ||
"url": "https://github.com/vnoder" | ||
} | ||
@@ -68,4 +63,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "1bacf51a315ca77670b0db1e3aee560f76efccc3ea88f59dd323f8ccf34b6a33", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "ea3e87a04337431bd14788b80d9cb269e572086b53c8a5add6be83f96fbc1e04", | ||
"typeScriptVersion": "4.6" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Koa (http://koajs.com). | ||
This package contains type definitions for koa (http://koajs.com). | ||
@@ -12,7 +12,6 @@ # Details | ||
### Additional Details | ||
* Last updated: Tue, 06 Jul 2021 22:02:37 GMT | ||
* Dependencies: [@types/accepts](https://npmjs.com/package/@types/accepts), [@types/cookies](https://npmjs.com/package/@types/cookies), [@types/http-assert](https://npmjs.com/package/@types/http-assert), [@types/http-errors](https://npmjs.com/package/@types/http-errors), [@types/keygrip](https://npmjs.com/package/@types/keygrip), [@types/koa-compose](https://npmjs.com/package/@types/koa-compose), [@types/content-disposition](https://npmjs.com/package/@types/content-disposition), [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
* Last updated: Tue, 09 Jan 2024 10:36:31 GMT | ||
* Dependencies: [@types/accepts](https://npmjs.com/package/@types/accepts), [@types/content-disposition](https://npmjs.com/package/@types/content-disposition), [@types/cookies](https://npmjs.com/package/@types/cookies), [@types/http-assert](https://npmjs.com/package/@types/http-assert), [@types/http-errors](https://npmjs.com/package/@types/http-errors), [@types/keygrip](https://npmjs.com/package/@types/keygrip), [@types/koa-compose](https://npmjs.com/package/@types/koa-compose), [@types/node](https://npmjs.com/package/@types/node) | ||
# Credits | ||
These definitions were written by [DavidCai1993](https://github.com/DavidCai1993), [jKey Lu](https://github.com/jkeylu), [Brice Bernard](https://github.com/brikou), [harryparkdotio](https://github.com/harryparkdotio), [Wooram Jun](https://github.com/chatoo2412), [Christian Vaagland Tellnes](https://github.com/tellnes), [Piotr Kuczynski](https://github.com/pkuczynski), and [vnoder](https://github.com/vnoder). | ||
These definitions were written by [jKey Lu](https://github.com/jkeylu), [Brice Bernard](https://github.com/brikou), [harryparkdotio](https://github.com/harryparkdotio), [Wooram Jun](https://github.com/chatoo2412), [Christian Vaagland Tellnes](https://github.com/tellnes), [Piotr Kuczynski](https://github.com/pkuczynski), and [vnoder](https://github.com/vnoder). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25452
663
16