chore: type improvements (#5264)
This commit is contained in:
parent
9f55e6fbb1
commit
92e04a651f
@ -1,8 +1,9 @@
|
|||||||
|
/* eslint-disable no-restricted-globals */
|
||||||
import { ComponentInternalInstance, formatComponentName } from './component'
|
import { ComponentInternalInstance, formatComponentName } from './component'
|
||||||
import { devtoolsPerfEnd, devtoolsPerfStart } from './devtools'
|
import { devtoolsPerfEnd, devtoolsPerfStart } from './devtools'
|
||||||
|
|
||||||
let supported: boolean
|
let supported: boolean
|
||||||
let perf: any
|
let perf: Performance
|
||||||
|
|
||||||
export function startMeasure(
|
export function startMeasure(
|
||||||
instance: ComponentInternalInstance,
|
instance: ComponentInternalInstance,
|
||||||
@ -40,13 +41,11 @@ function isSupported() {
|
|||||||
if (supported !== undefined) {
|
if (supported !== undefined) {
|
||||||
return supported
|
return supported
|
||||||
}
|
}
|
||||||
/* eslint-disable no-restricted-globals */
|
|
||||||
if (typeof window !== 'undefined' && window.performance) {
|
if (typeof window !== 'undefined' && window.performance) {
|
||||||
supported = true
|
supported = true
|
||||||
perf = window.performance
|
perf = window.performance
|
||||||
} else {
|
} else {
|
||||||
supported = false
|
supported = false
|
||||||
}
|
}
|
||||||
/* eslint-enable no-restricted-globals */
|
|
||||||
return supported
|
return supported
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ function nextSibling(node: TestNode): TestNode | null {
|
|||||||
return parent.children[i + 1] || null
|
return parent.children[i + 1] || null
|
||||||
}
|
}
|
||||||
|
|
||||||
function querySelector(): any {
|
function querySelector(): never {
|
||||||
throw new Error('querySelector not supported in test renderer.')
|
throw new Error('querySelector not supported in test renderer.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user