mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
[next] added QueryStringMapObect type
This commit is contained in:
Vendored
+10
-45
@@ -16,6 +16,11 @@ import * as url from "url";
|
||||
import { Response as NodeResponse } from "node-fetch";
|
||||
|
||||
declare namespace next {
|
||||
/** Map object used in query strings. */
|
||||
export interface QueryStringMapObject {
|
||||
[key: string]: string | string[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Context object used in methods like `getInitialProps()`
|
||||
* <<https://github.com/zeit/next.js/issues/1651>>
|
||||
@@ -24,15 +29,7 @@ declare namespace next {
|
||||
/** path section of URL */
|
||||
pathname: string;
|
||||
/** query string section of URL parsed as an object */
|
||||
query: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
};
|
||||
query: QueryStringMapObject;
|
||||
/** String of the actual path (including the query) shows in the browser */
|
||||
asPath: string;
|
||||
/** HTTP request object (server only) */
|
||||
@@ -101,15 +98,7 @@ declare namespace next {
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
pathname: string,
|
||||
query?: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
},
|
||||
query?: QueryStringMapObject,
|
||||
parsedUrl?: UrlLike
|
||||
): Promise<void>;
|
||||
renderError(
|
||||
@@ -117,15 +106,7 @@ declare namespace next {
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
pathname: string,
|
||||
query?: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
}
|
||||
query?: QueryStringMapObject
|
||||
): Promise<void>;
|
||||
render404(
|
||||
req: http.IncomingMessage,
|
||||
@@ -136,30 +117,14 @@ declare namespace next {
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
pathname: string,
|
||||
query?: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
}
|
||||
query?: QueryStringMapObject
|
||||
): Promise<string>;
|
||||
renderErrorToHTML(
|
||||
err: any,
|
||||
req: http.IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
pathname: string,
|
||||
query?: {
|
||||
[key: string]:
|
||||
| boolean
|
||||
| boolean[]
|
||||
| number
|
||||
| number[]
|
||||
| string
|
||||
| string[];
|
||||
}
|
||||
query?: QueryStringMapObject
|
||||
): Promise<string>;
|
||||
|
||||
serveStatic(
|
||||
|
||||
Reference in New Issue
Block a user