forked from vuejs/devtools-v6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.ts
More file actions
28 lines (23 loc) · 740 Bytes
/
env.ts
File metadata and controls
28 lines (23 loc) · 740 Bytes
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
import type { PluginDescriptor, SetupFunction } from './index.js'
import type { ApiProxy } from './proxy.js'
export interface PluginQueueItem {
pluginDescriptor: PluginDescriptor
setupFn: SetupFunction
proxy?: ApiProxy
}
interface GlobalTarget {
__VUE_DEVTOOLS_PLUGINS__?: PluginQueueItem[]
__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__?: boolean
}
export function getDevtoolsGlobalHook (): any {
return (getTarget() as any).__VUE_DEVTOOLS_GLOBAL_HOOK__
}
export function getTarget (): GlobalTarget {
// @ts-ignore
return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
? window
: typeof global !== 'undefined'
? global
: {}
}
export const isProxyAvailable = typeof Proxy === 'function'