@vue/devtools-api 6.0.0-beta.2 → 6.0.0-beta.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{api → cjs/api}/api.js +0 -1
- package/lib/{api → cjs/api}/app.js +0 -1
- package/lib/{api → cjs/api}/component.js +0 -1
- package/lib/{api → cjs/api}/context.js +0 -1
- package/lib/cjs/api/hooks.js +2 -0
- package/lib/{api → cjs/api}/index.js +2 -2
- package/lib/cjs/api/util.js +2 -0
- package/lib/cjs/const.js +5 -0
- package/lib/cjs/env.js +17 -0
- package/lib/cjs/index.js +38 -0
- package/lib/cjs/plugin.js +2 -0
- package/lib/cjs/proxy.js +107 -0
- package/lib/esm/api/api.d.ts +102 -0
- package/lib/esm/api/api.js +1 -0
- package/lib/{api → esm/api}/app.d.ts +0 -0
- package/lib/esm/api/app.js +1 -0
- package/lib/{api → esm/api}/component.d.ts +34 -18
- package/lib/esm/api/component.js +1 -0
- package/lib/esm/api/context.d.ts +5 -0
- package/lib/esm/api/context.js +1 -0
- package/lib/esm/api/hooks.d.ts +179 -0
- package/lib/esm/api/hooks.js +1 -0
- package/lib/{api → esm/api}/index.d.ts +1 -0
- package/lib/esm/api/index.js +6 -0
- package/lib/esm/api/util.d.ts +4 -0
- package/lib/esm/api/util.js +1 -0
- package/lib/esm/const.d.ts +2 -0
- package/lib/esm/const.js +2 -0
- package/lib/esm/env.d.ts +15 -0
- package/lib/esm/env.js +12 -0
- package/lib/esm/index.d.ts +7 -0
- package/lib/esm/index.js +24 -0
- package/lib/esm/plugin.d.ts +35 -0
- package/lib/esm/plugin.js +1 -0
- package/lib/esm/proxy.d.ts +20 -0
- package/lib/esm/proxy.js +103 -0
- package/package.json +19 -9
- package/.eslintrc.js +0 -14
- package/lib/api/api.d.ts +0 -48
- package/lib/api/api.js.map +0 -1
- package/lib/api/app.js.map +0 -1
- package/lib/api/component.js.map +0 -1
- package/lib/api/context.d.ts +0 -3
- package/lib/api/context.js.map +0 -1
- package/lib/api/hooks.d.ts +0 -94
- package/lib/api/hooks.js +0 -19
- package/lib/api/hooks.js.map +0 -1
- package/lib/api/index.js.map +0 -1
- package/lib/const.d.ts +0 -3
- package/lib/const.js +0 -8
- package/lib/const.js.map +0 -1
- package/lib/env.d.ts +0 -3
- package/lib/env.js +0 -11
- package/lib/env.js.map +0 -1
- package/lib/index.d.ts +0 -9
- package/lib/index.js +0 -30
- package/lib/index.js.map +0 -1
- package/src/api/api.ts +0 -56
- package/src/api/app.ts +0 -1
- package/src/api/component.ts +0 -68
- package/src/api/context.ts +0 -5
- package/src/api/hooks.ts +0 -99
- package/src/api/index.ts +0 -5
- package/src/const.ts +0 -3
- package/src/env.ts +0 -7
- package/src/index.ts +0 -25
- package/tsconfig.json +0 -29
package/src/api/hooks.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ComponentTreeNode, InspectedComponentData, ComponentInstance } from './component'
|
|
2
|
-
import { App } from './app'
|
|
3
|
-
import { CustomInspectorNode, CustomInspectorState } from './api'
|
|
4
|
-
|
|
5
|
-
export enum Hooks {
|
|
6
|
-
TRANSFORM_CALL = 'transformCall',
|
|
7
|
-
GET_APP_RECORD_NAME = 'getAppRecordName',
|
|
8
|
-
GET_APP_ROOT_INSTANCE = 'getAppRootInstance',
|
|
9
|
-
REGISTER_APPLICATION = 'registerApplication',
|
|
10
|
-
WALK_COMPONENT_TREE = 'walkComponentTree',
|
|
11
|
-
WALK_COMPONENT_PARENTS = 'walkComponentParents',
|
|
12
|
-
INSPECT_COMPONENT = 'inspectComponent',
|
|
13
|
-
GET_COMPONENT_BOUNDS = 'getComponentBounds',
|
|
14
|
-
GET_COMPONENT_NAME = 'getComponentName',
|
|
15
|
-
GET_ELEMENT_COMPONENT = 'getElementComponent',
|
|
16
|
-
GET_INSPECTOR_TREE = 'getInspectorTree',
|
|
17
|
-
GET_INSPECTOR_STATE = 'getInspectorState'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ComponentBounds {
|
|
21
|
-
left: number
|
|
22
|
-
top: number
|
|
23
|
-
width: number
|
|
24
|
-
height: number
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type HookPayloads = {
|
|
28
|
-
[Hooks.TRANSFORM_CALL]: {
|
|
29
|
-
callName: string
|
|
30
|
-
inArgs: any[]
|
|
31
|
-
outArgs: any[]
|
|
32
|
-
}
|
|
33
|
-
[Hooks.GET_APP_RECORD_NAME]: {
|
|
34
|
-
app: App
|
|
35
|
-
name: string
|
|
36
|
-
}
|
|
37
|
-
[Hooks.GET_APP_ROOT_INSTANCE]: {
|
|
38
|
-
app: App
|
|
39
|
-
root: ComponentInstance
|
|
40
|
-
}
|
|
41
|
-
[Hooks.REGISTER_APPLICATION]: {
|
|
42
|
-
app: App
|
|
43
|
-
}
|
|
44
|
-
[Hooks.WALK_COMPONENT_TREE]: {
|
|
45
|
-
componentInstance: ComponentInstance
|
|
46
|
-
componentTreeData: ComponentTreeNode
|
|
47
|
-
maxDepth: number
|
|
48
|
-
filter: string
|
|
49
|
-
}
|
|
50
|
-
[Hooks.WALK_COMPONENT_PARENTS]: {
|
|
51
|
-
componentInstance: ComponentInstance
|
|
52
|
-
parentInstances: ComponentInstance[]
|
|
53
|
-
}
|
|
54
|
-
[Hooks.INSPECT_COMPONENT]: {
|
|
55
|
-
componentInstance: ComponentInstance
|
|
56
|
-
instanceData: InspectedComponentData
|
|
57
|
-
}
|
|
58
|
-
[Hooks.GET_COMPONENT_BOUNDS]: {
|
|
59
|
-
componentInstance: ComponentInstance
|
|
60
|
-
bounds: ComponentBounds
|
|
61
|
-
}
|
|
62
|
-
[Hooks.GET_COMPONENT_NAME]: {
|
|
63
|
-
componentInstance: ComponentInstance
|
|
64
|
-
name: string
|
|
65
|
-
}
|
|
66
|
-
[Hooks.GET_ELEMENT_COMPONENT]: {
|
|
67
|
-
element: HTMLElement | any
|
|
68
|
-
componentInstance: ComponentInstance
|
|
69
|
-
}
|
|
70
|
-
[Hooks.GET_INSPECTOR_TREE]: {
|
|
71
|
-
app: App
|
|
72
|
-
inspectorId: string
|
|
73
|
-
filter: string
|
|
74
|
-
rootNodes: CustomInspectorNode[]
|
|
75
|
-
}
|
|
76
|
-
[Hooks.GET_INSPECTOR_STATE]: {
|
|
77
|
-
app: App
|
|
78
|
-
inspectorId: string
|
|
79
|
-
nodeId: string
|
|
80
|
-
state: CustomInspectorState
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type HookHandler<TPayload, TContext> = (payload: TPayload, ctx: TContext) => void | Promise<void>
|
|
85
|
-
|
|
86
|
-
export interface Hookable<TContext> {
|
|
87
|
-
transformCall (handler: HookHandler<HookPayloads[Hooks.TRANSFORM_CALL], TContext>)
|
|
88
|
-
getAppRecordName (handler: HookHandler<HookPayloads[Hooks.GET_APP_RECORD_NAME], TContext>)
|
|
89
|
-
getAppRootInstance (handler: HookHandler<HookPayloads[Hooks.GET_APP_ROOT_INSTANCE], TContext>)
|
|
90
|
-
registerApplication (handler: HookHandler<HookPayloads[Hooks.REGISTER_APPLICATION], TContext>)
|
|
91
|
-
walkComponentTree (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_TREE], TContext>)
|
|
92
|
-
walkComponentParents (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_PARENTS], TContext>)
|
|
93
|
-
inspectComponent (handler: HookHandler<HookPayloads[Hooks.INSPECT_COMPONENT], TContext>)
|
|
94
|
-
getComponentBounds (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_BOUNDS], TContext>)
|
|
95
|
-
getComponentName (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_NAME], TContext>)
|
|
96
|
-
getElementComponent (handler: HookHandler<HookPayloads[Hooks.GET_ELEMENT_COMPONENT], TContext>)
|
|
97
|
-
getInspectorTree (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>)
|
|
98
|
-
getInspectorState (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>)
|
|
99
|
-
}
|
package/src/api/index.ts
DELETED
package/src/const.ts
DELETED
package/src/env.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { hook, target } from './env'
|
|
2
|
-
import { ApiHookEvents } from './const'
|
|
3
|
-
import { DevtoolsPluginApi, App } from './api'
|
|
4
|
-
|
|
5
|
-
export * from './api'
|
|
6
|
-
|
|
7
|
-
export interface PluginDescriptor {
|
|
8
|
-
id: string
|
|
9
|
-
label: string
|
|
10
|
-
app: App
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type SetupFunction = (api: DevtoolsPluginApi) => void
|
|
14
|
-
|
|
15
|
-
export function setupDevtoolsPlugin (pluginDescriptor: PluginDescriptor, setupFn: SetupFunction) {
|
|
16
|
-
if (hook) {
|
|
17
|
-
hook.emit(ApiHookEvents.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn)
|
|
18
|
-
} else {
|
|
19
|
-
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []
|
|
20
|
-
list.push({
|
|
21
|
-
pluginDescriptor,
|
|
22
|
-
setupFn
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2019",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"types": [
|
|
11
|
-
"node",
|
|
12
|
-
"webpack-env"
|
|
13
|
-
],
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"preserveWatchOutput": true,
|
|
16
|
-
// Strict
|
|
17
|
-
"noImplicitAny": false,
|
|
18
|
-
"noImplicitThis": true,
|
|
19
|
-
"alwaysStrict": true,
|
|
20
|
-
"strictBindCallApply": true,
|
|
21
|
-
"strictFunctionTypes": true,
|
|
22
|
-
},
|
|
23
|
-
"include": [
|
|
24
|
-
"src/**/*",
|
|
25
|
-
],
|
|
26
|
-
"exclude": [
|
|
27
|
-
"node_modules"
|
|
28
|
-
]
|
|
29
|
-
}
|