保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 26fa49f4b0aa658d65a21fffe828f39e78302573
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import { ServerResponse } from 'http'
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
import './vue'
 
// augment typings of Vuex
import './vuex'
 
type NuxtState = Record<string, any>
 
export interface NuxtAppOptions extends ComponentOptions<Vue> {
  [key: string]: any // TBD
}
 
export interface NuxtError {
  message?: string
  path?: string
  statusCode?: number
}
 
export interface Context {
  $config: NuxtRuntimeConfig
 
  app: NuxtAppOptions
  base: string
  /**
   * @deprecated Use process.client instead
  */
  isClient: boolean
  /**
   * @deprecated Use process.server instead
  */
  isServer: boolean
  /**
   * @deprecated Use process.static instead
  */
  isStatic: boolean
  isDev: boolean
  isHMR: boolean
  route: Route
  from: Route
  store: Store<any>
  env: Record<string, any>
  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
  redirect(status: number, 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>
    fetchCounters: Record<string, number>
    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
  enablePreview?: (previewData?: Record<string, any>) => void
  $preview?: Record<string, any>
}
 
// eslint-disable-next-line @typescript-eslint/ban-types
export type Middleware = string | ((ctx: Context, cb: Function) => Promise<void> | void)
export type Inject = (key: string, value: any) => void
export type Plugin = (ctx: Context, inject: Inject) => Promise<void> | void
 
export interface Transition {
  name?: string
  mode?: string
  css?: boolean
  duration?: number
  type?: string
  enterClass?: string
  enterToClass?: string
  enterActiveClass?: string
  leaveClass?: string
  leaveToClass?: string
  leaveActiveClass?: string
  beforeEnter?(el: HTMLElement): void
  // eslint-disable-next-line @typescript-eslint/ban-types
  enter?(el: HTMLElement, done: Function): void
  afterEnter?(el: HTMLElement): void
  enterCancelled?(el: HTMLElement): void
  beforeLeave?(el: HTMLElement): void
  // eslint-disable-next-line @typescript-eslint/ban-types
  leave?(el: HTMLElement, done: Function): void
  afterLeave?(el: HTMLElement): void
  leaveCancelled?(el: HTMLElement): void
}
 
export interface DefaultNuxtLoading extends Vue {
  canSucceed: boolean
  clear(): void
  continuous: boolean
  decrease(num: number): DefaultNuxtLoading
  duration: number
  fail(): DefaultNuxtLoading
  finish(): DefaultNuxtLoading
  increase(num: number): DefaultNuxtLoading
  get(): number
  hide(): DefaultNuxtLoading
  left: number
  pause(): DefaultNuxtLoading
  percent: number
  resume(): DefaultNuxtLoading
  reversed: boolean
  rtl: boolean
  set(num: number): DefaultNuxtLoading
  skipTimerCount: number
  show: boolean
  start(): DefaultNuxtLoading
  startTimer(): void
  throttle: number
}
 
export interface CustomNuxtLoading extends Vue {
  fail?(): CustomNuxtLoading
  finish(): CustomNuxtLoading
  increase?(num: number): CustomNuxtLoading
  pause?(): CustomNuxtLoading
  start(): CustomNuxtLoading
}
 
export type NuxtLoading = DefaultNuxtLoading | CustomNuxtLoading
 
export interface NuxtApp extends Vue {
  $options: NuxtAppOptions
  $loading: NuxtLoading
  nbFetching: number
  isFetching: boolean
  context: Context
  error(params: NuxtError): void
  isOffline: boolean
  isOnline: boolean
  layout: any // TBD
  layoutName: string
  loadLayout(layout: string): Promise<any> // TBD
  refresh(): Promise<void>
  setLayout(layout: string): any // TBD
}
 
// window.$nuxt
declare global {
  interface Window {
    $nuxt: NuxtApp
  }
}