-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtypes.d.ts
More file actions
74 lines (65 loc) · 2.38 KB
/
types.d.ts
File metadata and controls
74 lines (65 loc) · 2.38 KB
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
import type { VNode, Ref } from 'vue'
import type { LCPMetricWithAttribution, INPMetricWithAttribution, CLSMetricWithAttribution } from 'web-vitals/attribution'
import type { HydrationMismatchPayload, LocalHydrationMismatch } from './hydration/types'
import type { DirectImportInfo, LazyHydrationState } from './lazy-load/composables'
declare global {
interface Window {
__hints_TPC_start_time: number
__hints_TPC_saveTime: (script: HTMLScriptElement, startTime?: number) => void
}
interface HTMLScriptElement {
__hints_TPC_start_time?: number
__hints_TPC_end_time?: number
requestTime?: number
downloadTime?: number
totalNetworkTime?: number
parseExecuteTime?: number
loaded?: boolean
}
interface Element {
__vnode?: VNode
}
}
declare module '#app' {
interface RuntimeNuxtHooks {
'hints:scripts:added': (script: HTMLScriptElement) => void
'hints:scripts:loaded': (script: HTMLScriptElement) => void
'hints:webvitals:sync': (webvitals: NuxtPayload['__hints']['webvitals']) => void
'hints:webvitals:lcp': (metric: LCPMetricWithAttribution) => void
'hints:webvitals:inp': (metric: INPMetricWithAttribution) => void
'hints:webvitals:cls': (metric: CLSMetricWithAttribution) => void
}
interface NuxtApp {
__tracerOverlay: typeof import('vite-plugin-vue-tracer/client/overlay')
__tracerRecord: typeof import('vite-plugin-vue-tracer/client/record')
}
interface NuxtPayload {
__hints: {
lazyHydrationState?: LazyHydrationState
hydration: LocalHydrationMismatch[]
lazyComponents: DirectImportInfo[]
webvitals: {
lcp: Ref<LCPMetricWithAttribution[]>
inp: Ref<INPMetricWithAttribution[]>
cls: Ref<CLSMetricWithAttribution[]>
}
thirdPartyScripts: Ref<{
element: HTMLScriptElement
loaded: boolean
}[]>
}
}
}
declare module 'nitropack' {
interface NitroRuntimeHooks {
// Core hints hooks
'hints:sse:setup': (context: import('./core/server/types').HintsSseContext) => void
// Hydration hooks
'hints:hydration:mismatch': (payload: HydrationMismatchPayload) => void
'hints:hydration:cleared': (payload: { id: string[] }) => void
// Lazy-load hooks
'hints:lazy-load:report': (payload: import('./lazy-load/schema').ComponentLazyLoadData) => void
'hints:lazy-load:cleared': (payload: { id: string }) => void
}
}
export {}