mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(types): add missing ssrContext
and next
typings to Context
(#8302)
closes #8296
This commit is contained in:
parent
2712eb3fde
commit
005daebfce
30
packages/types/app/index.d.ts
vendored
30
packages/types/app/index.d.ts
vendored
@ -1,8 +1,10 @@
|
||||
import { ServerResponse } from 'http'
|
||||
import { IncomingMessage } from 'connect'
|
||||
import { IncomingMessage, NextFunction } from 'connect'
|
||||
import Vue, { ComponentOptions } from 'vue'
|
||||
import VueRouter, { Location, Route } from 'vue-router'
|
||||
import { Store } from 'vuex'
|
||||
|
||||
import { NuxtOptions } from '../config'
|
||||
import { NuxtRuntimeConfig } from '../config/runtime'
|
||||
|
||||
// augment typings of Vue.js
|
||||
@ -39,11 +41,37 @@ export interface Context {
|
||||
params: Route['params']
|
||||
payload: any
|
||||
query: Route['query']
|
||||
next?: NextFunction
|
||||
req: IncomingMessage
|
||||
res: ServerResponse
|
||||
redirect(status: number, path: string, query?: Route['query']): void
|
||||
redirect(path: string, query?: Route['query']): void
|
||||
redirect(location: Location): void
|
||||
ssrContext?: {
|
||||
req: Context['req']
|
||||
res: Context['res']
|
||||
url: string
|
||||
target: NuxtOptions['target']
|
||||
spa?: boolean
|
||||
modern: boolean
|
||||
runtimeConfig: {
|
||||
public: NuxtRuntimeConfig
|
||||
private: NuxtRuntimeConfig
|
||||
}
|
||||
redirected: boolean
|
||||
next: NextFunction
|
||||
beforeRenderFns: Array<() => any>
|
||||
nuxt: {
|
||||
layout: string
|
||||
data: Array<Record<string, any>>
|
||||
fetch: Array<Record<string, any>>
|
||||
error: any
|
||||
state: Array<Record<string, any>>
|
||||
serverRendered: boolean
|
||||
routePath: string
|
||||
config: NuxtRuntimeConfig
|
||||
}
|
||||
}
|
||||
error(params: NuxtError): void
|
||||
nuxtState: NuxtState
|
||||
beforeNuxtRender(fn: (params: { Components: VueRouter['getMatchedComponents'], nuxtState: NuxtState }) => void): void
|
||||
|
Loading…
Reference in New Issue
Block a user