mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
fix(vue-app): fix context req
and res
types (#5560)
This commit is contained in:
parent
30c2b9542e
commit
ccf23a07ed
19
packages/vue-app/types/index.d.ts
vendored
19
packages/vue-app/types/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter, { Route } from 'vue-router'
|
||||
import { Store } from 'vuex'
|
||||
import { IncomingMessage, ServerResponse } from 'http'
|
||||
|
||||
// augment typings of NodeJS.Process
|
||||
import './process'
|
||||
@ -17,15 +18,15 @@ export interface Context {
|
||||
/**
|
||||
* @deprecated Use process.client instead
|
||||
*/
|
||||
isClient: boolean;
|
||||
isClient: boolean
|
||||
/**
|
||||
* @deprecated Use process.server instead
|
||||
*/
|
||||
isServer: boolean;
|
||||
isServer: boolean
|
||||
/**
|
||||
* @deprecated Use process.static instead
|
||||
*/
|
||||
isStatic: boolean;
|
||||
isStatic: boolean
|
||||
isDev: boolean
|
||||
isHMR: boolean
|
||||
route: Route
|
||||
@ -34,13 +35,13 @@ export interface Context {
|
||||
params: Route['params']
|
||||
payload: any
|
||||
query: Route['query']
|
||||
req: Request
|
||||
res: Response
|
||||
redirect (status: number, path: string, query?: Route['query']): void
|
||||
redirect (path: string, query?: Route['query']): void
|
||||
error (params: ErrorParams): void
|
||||
req: IncomingMessage
|
||||
res: ServerResponse
|
||||
redirect(status: number, path: string, query?: Route['query']): void
|
||||
redirect(path: string, query?: Route['query']): void
|
||||
error(params: ErrorParams): void
|
||||
nuxtState: NuxtState
|
||||
beforeNuxtRender (fn: (params: { Components: VueRouter['getMatchedComponents'], nuxtState: NuxtState }) => void): void
|
||||
beforeNuxtRender(fn: (params: { Components: VueRouter['getMatchedComponents'], nuxtState: NuxtState }) => void): void
|
||||
}
|
||||
|
||||
export type Middleware = string | ((ctx: Context, cb: Function) => Promise<void> | void)
|
||||
|
Loading…
Reference in New Issue
Block a user