@vue/devtools-api 6.0.0-beta.2 → 6.0.0-beta.20

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.
Files changed (67) hide show
  1. package/lib/{api → cjs/api}/api.js +0 -1
  2. package/lib/{api → cjs/api}/app.js +0 -1
  3. package/lib/{api → cjs/api}/component.js +0 -1
  4. package/lib/{api → cjs/api}/context.js +0 -1
  5. package/lib/cjs/api/hooks.js +2 -0
  6. package/lib/{api → cjs/api}/index.js +1 -1
  7. package/lib/cjs/api/util.js +2 -0
  8. package/lib/cjs/const.js +5 -0
  9. package/lib/cjs/env.js +17 -0
  10. package/lib/{index.js → cjs/index.js} +13 -5
  11. package/lib/cjs/plugin.js +2 -0
  12. package/lib/cjs/proxy.js +105 -0
  13. package/lib/esm/api/api.d.ts +102 -0
  14. package/lib/esm/api/api.js +0 -0
  15. package/lib/esm/api/app.d.ts +3 -0
  16. package/lib/esm/api/app.js +0 -0
  17. package/lib/{api → esm/api}/component.d.ts +37 -19
  18. package/lib/esm/api/component.js +0 -0
  19. package/lib/esm/api/context.d.ts +5 -0
  20. package/lib/esm/api/context.js +0 -0
  21. package/lib/esm/api/hooks.d.ts +179 -0
  22. package/lib/esm/api/hooks.js +0 -0
  23. package/lib/{api → esm/api}/index.d.ts +1 -0
  24. package/lib/esm/api/index.js +6 -0
  25. package/lib/esm/api/util.d.ts +4 -0
  26. package/lib/esm/api/util.js +0 -0
  27. package/lib/esm/const.d.ts +2 -0
  28. package/lib/esm/const.js +2 -0
  29. package/lib/esm/env.d.ts +15 -0
  30. package/lib/esm/env.js +12 -0
  31. package/lib/esm/index.d.ts +7 -0
  32. package/lib/esm/index.js +24 -0
  33. package/lib/esm/plugin.d.ts +35 -0
  34. package/lib/esm/plugin.js +0 -0
  35. package/lib/esm/proxy.d.ts +20 -0
  36. package/lib/esm/proxy.js +101 -0
  37. package/package.json +18 -8
  38. package/.eslintrc.js +0 -14
  39. package/lib/api/api.d.ts +0 -48
  40. package/lib/api/api.js.map +0 -1
  41. package/lib/api/app.d.ts +0 -1
  42. package/lib/api/app.js.map +0 -1
  43. package/lib/api/component.js.map +0 -1
  44. package/lib/api/context.d.ts +0 -3
  45. package/lib/api/context.js.map +0 -1
  46. package/lib/api/hooks.d.ts +0 -94
  47. package/lib/api/hooks.js +0 -19
  48. package/lib/api/hooks.js.map +0 -1
  49. package/lib/api/index.js.map +0 -1
  50. package/lib/const.d.ts +0 -3
  51. package/lib/const.js +0 -8
  52. package/lib/const.js.map +0 -1
  53. package/lib/env.d.ts +0 -3
  54. package/lib/env.js +0 -11
  55. package/lib/env.js.map +0 -1
  56. package/lib/index.d.ts +0 -9
  57. package/lib/index.js.map +0 -1
  58. package/src/api/api.ts +0 -56
  59. package/src/api/app.ts +0 -1
  60. package/src/api/component.ts +0 -68
  61. package/src/api/context.ts +0 -5
  62. package/src/api/hooks.ts +0 -99
  63. package/src/api/index.ts +0 -5
  64. package/src/const.ts +0 -3
  65. package/src/env.ts +0 -7
  66. package/src/index.ts +0 -25
  67. 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
@@ -1,5 +0,0 @@
1
- export * from './api'
2
- export * from './app'
3
- export * from './component'
4
- export * from './context'
5
- export * from './hooks'
package/src/const.ts DELETED
@@ -1,3 +0,0 @@
1
- export enum ApiHookEvents {
2
- SETUP_DEVTOOLS_PLUGIN = 'devtools-plugin:setup',
3
- }
package/src/env.ts DELETED
@@ -1,7 +0,0 @@
1
- export const isBrowser = typeof navigator !== 'undefined'
2
- export const target: any = isBrowser
3
- ? window
4
- : typeof global !== 'undefined'
5
- ? global
6
- : {}
7
- export const hook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__
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
- }