@vue/devtools-api 6.0.0-beta.18 → 6.0.0-beta.20.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/cjs/index.js CHANGED
@@ -29,7 +29,7 @@ function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
29
29
  list.push({
30
30
  pluginDescriptor,
31
31
  setupFn,
32
- proxy
32
+ proxy,
33
33
  });
34
34
  if (proxy)
35
35
  setupFn(proxy.proxiedTarget);
package/lib/cjs/proxy.js CHANGED
@@ -38,7 +38,7 @@ class ApiProxy {
38
38
  // noop
39
39
  }
40
40
  currentSettings = value;
41
- }
41
+ },
42
42
  };
43
43
  hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
44
44
  if (pluginId === this.plugin.id) {
@@ -54,11 +54,11 @@ class ApiProxy {
54
54
  return (...args) => {
55
55
  this.onQueue.push({
56
56
  method: prop,
57
- args
57
+ args,
58
58
  });
59
59
  };
60
60
  }
61
- }
61
+ },
62
62
  });
63
63
  this.proxiedTarget = new Proxy({}, {
64
64
  get: (_target, prop) => {
@@ -73,7 +73,7 @@ class ApiProxy {
73
73
  this.targetQueue.push({
74
74
  method: prop,
75
75
  args,
76
- resolve: () => { }
76
+ resolve: () => { },
77
77
  });
78
78
  return this.fallbacks[prop](...args);
79
79
  };
@@ -84,12 +84,12 @@ class ApiProxy {
84
84
  this.targetQueue.push({
85
85
  method: prop,
86
86
  args,
87
- resolve
87
+ resolve,
88
88
  });
89
89
  });
90
90
  };
91
91
  }
92
- }
92
+ },
93
93
  });
94
94
  }
95
95
  async setRealTarget(target) {
@@ -17,7 +17,7 @@ export interface DevtoolsPluginApi<TSettings> {
17
17
  getComponentInstances(app: App): Promise<ComponentInstance[]>;
18
18
  highlightElement(instance: ComponentInstance): void;
19
19
  unhighlightElement(): void;
20
- getSettings(): TSettings;
20
+ getSettings(pluginId?: string): TSettings;
21
21
  /**
22
22
  * @private Not implemented yet
23
23
  */
@@ -1 +1,3 @@
1
- export declare type App = any;
1
+ export declare type App = Record<string, any> & {
2
+ __app: true;
3
+ };
@@ -1,6 +1,8 @@
1
1
  import { InspectorNodeTag } from './api';
2
2
  import { ID } from './util';
3
- export declare type ComponentInstance = any;
3
+ export declare type ComponentInstance = Record<string, any> & {
4
+ __component: true;
5
+ };
4
6
  export interface ComponentTreeNode {
5
7
  uid: ID;
6
8
  id: string;
@@ -22,7 +22,8 @@ export declare const enum Hooks {
22
22
  TIMELINE_CLEARED = "timelineCleared",
23
23
  GET_INSPECTOR_TREE = "getInspectorTree",
24
24
  GET_INSPECTOR_STATE = "getInspectorState",
25
- EDIT_INSPECTOR_STATE = "editInspectorState"
25
+ EDIT_INSPECTOR_STATE = "editInspectorState",
26
+ SET_PLUGIN_SETTINGS = "setPluginSettings"
26
27
  }
27
28
  export interface ComponentBounds {
28
29
  left: number;
@@ -94,7 +95,7 @@ export declare type HookPayloads = {
94
95
  path: string[];
95
96
  type: string;
96
97
  state: EditStatePayload;
97
- set: (object: any, path: string | (string[]), value: any, cb?: (object: any, field: string, value: any) => void) => void;
98
+ set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
98
99
  };
99
100
  [Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS]: {
100
101
  componentInstance: ComponentInstance;
@@ -133,6 +134,14 @@ export declare type HookPayloads = {
133
134
  state: EditStatePayload;
134
135
  set: (object: any, path: string | (string[]), value: any, cb?: (object: any, field: string, value: any) => void) => void;
135
136
  };
137
+ [Hooks.SET_PLUGIN_SETTINGS]: {
138
+ app: App;
139
+ pluginId: string;
140
+ key: string;
141
+ newValue: any;
142
+ oldValue: any;
143
+ settings: any;
144
+ };
136
145
  };
137
146
  export declare type EditStatePayload = {
138
147
  value: any;
@@ -166,4 +175,5 @@ export interface Hookable<TContext> {
166
175
  getInspectorTree(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>): any;
167
176
  getInspectorState(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>): any;
168
177
  editInspectorState(handler: HookHandler<HookPayloads[Hooks.EDIT_INSPECTOR_STATE], TContext>): any;
178
+ setPluginSettings(handler: HookHandler<HookPayloads[Hooks.SET_PLUGIN_SETTINGS], TContext>): any;
169
179
  }
package/lib/esm/index.js CHANGED
@@ -16,7 +16,7 @@ export function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
16
16
  list.push({
17
17
  pluginDescriptor,
18
18
  setupFn,
19
- proxy
19
+ proxy,
20
20
  });
21
21
  if (proxy)
22
22
  setupFn(proxy.proxiedTarget);
@@ -8,6 +8,7 @@ export interface PluginDescriptor {
8
8
  componentStateTypes?: string[];
9
9
  logo?: string;
10
10
  disableAppScope?: boolean;
11
+ disablePluginScope?: boolean;
11
12
  /**
12
13
  * Run the plugin setup and expose the api even if the devtools is not opened yet.
13
14
  * Useful to record timeline events early.
package/lib/esm/proxy.js CHANGED
@@ -35,7 +35,7 @@ export class ApiProxy {
35
35
  // noop
36
36
  }
37
37
  currentSettings = value;
38
- }
38
+ },
39
39
  };
40
40
  hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
41
41
  if (pluginId === this.plugin.id) {
@@ -51,11 +51,11 @@ export class ApiProxy {
51
51
  return (...args) => {
52
52
  this.onQueue.push({
53
53
  method: prop,
54
- args
54
+ args,
55
55
  });
56
56
  };
57
57
  }
58
- }
58
+ },
59
59
  });
60
60
  this.proxiedTarget = new Proxy({}, {
61
61
  get: (_target, prop) => {
@@ -70,7 +70,7 @@ export class ApiProxy {
70
70
  this.targetQueue.push({
71
71
  method: prop,
72
72
  args,
73
- resolve: () => { }
73
+ resolve: () => { },
74
74
  });
75
75
  return this.fallbacks[prop](...args);
76
76
  };
@@ -81,12 +81,12 @@ export class ApiProxy {
81
81
  this.targetQueue.push({
82
82
  method: prop,
83
83
  args,
84
- resolve
84
+ resolve,
85
85
  });
86
86
  });
87
87
  };
88
88
  }
89
- }
89
+ },
90
90
  });
91
91
  }
92
92
  async setRealTarget(target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/devtools-api",
3
- "version": "6.0.0-beta.18",
3
+ "version": "6.0.0-beta.20.1",
4
4
  "description": "Interact with the Vue devtools from the page",
5
5
  "main": "lib/cjs/index.js",
6
6
  "browser": "lib/esm/index.js",