@vue/devtools-api 6.0.0-beta.10 → 6.0.0-beta.14

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.
@@ -11,6 +11,7 @@ export interface DevtoolsPluginApi {
11
11
  addInspector(options: CustomInspectorOptions): any;
12
12
  sendInspectorTree(inspectorId: string): any;
13
13
  sendInspectorState(inspectorId: string): any;
14
+ selectInspectorNode(inspectorId: string, nodeId: string): any;
14
15
  getComponentBounds(instance: ComponentInstance): Promise<ComponentBounds>;
15
16
  getComponentName(instance: ComponentInstance): Promise<string>;
16
17
  getComponentInstances(app: App): Promise<ComponentInstance[]>;
@@ -27,6 +28,9 @@ export interface TimelineLayerOptions<TData = any, TMeta = any> {
27
28
  id: string;
28
29
  label: string;
29
30
  color: number;
31
+ skipScreenshots?: boolean;
32
+ groupsOnly?: boolean;
33
+ ignoreNoDurationGroups?: boolean;
30
34
  screenshotOverlayRender?: (event: TimelineEvent<TData, TMeta> & ScreenshotOverlayEvent, ctx: ScreenshotOverlayRenderContext) => ScreenshotOverlayRenderResult | Promise<ScreenshotOverlayRenderResult>;
31
35
  }
32
36
  export interface ScreenshotOverlayEvent {
@@ -63,6 +67,11 @@ export interface CustomInspectorOptions {
63
67
  treeFilterPlaceholder?: string;
64
68
  stateFilterPlaceholder?: string;
65
69
  noSelectionText?: string;
70
+ actions?: {
71
+ icon: string;
72
+ tooltip?: string;
73
+ action: () => void | Promise<void>;
74
+ }[];
66
75
  }
67
76
  export interface CustomInspectorNode {
68
77
  id: string;
@@ -74,6 +83,7 @@ export interface InspectorNodeTag {
74
83
  label: string;
75
84
  textColor: number;
76
85
  backgroundColor: number;
86
+ tooltip?: string;
77
87
  }
78
88
  export interface CustomInspectorState {
79
89
  [key: string]: (StateBase | Omit<ComponentState, 'type'>)[];
@@ -44,23 +44,32 @@ export interface ComponentPropState extends ComponentStateBase {
44
44
  }
45
45
  export declare type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store';
46
46
  export interface ComponentCustomState extends ComponentStateBase {
47
- value: {
48
- _custom: {
49
- type: ComponentBuiltinCustomStateTypes | string;
50
- display?: string;
51
- tooltip?: string;
52
- value?: any;
47
+ value: CustomState;
48
+ }
49
+ export declare type CustomState = {
50
+ _custom: {
51
+ type: ComponentBuiltinCustomStateTypes | string;
52
+ display?: string;
53
+ tooltip?: string;
54
+ value?: any;
55
+ abstract?: boolean;
56
+ file?: string;
57
+ uid?: number;
58
+ readOnly?: boolean;
59
+ /** Configure immediate child fields */
60
+ fields?: {
53
61
  abstract?: boolean;
54
- file?: string;
55
- uid?: number;
56
- readOnly?: boolean;
57
- /** Configure immediate child fields */
58
- fields?: {
59
- abstract?: boolean;
60
- };
61
62
  };
63
+ id?: any;
64
+ actions?: {
65
+ icon: string;
66
+ tooltip?: string;
67
+ action: () => void | Promise<void>;
68
+ }[];
69
+ /** internal */
70
+ _reviveId?: number;
62
71
  };
63
- }
72
+ };
64
73
  export declare type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState;
65
74
  export interface ComponentDevtoolsOptions {
66
75
  hide?: boolean;
@@ -17,6 +17,7 @@ export declare const enum Hooks {
17
17
  GET_COMPONENT_ROOT_ELEMENTS = "getComponentRootElements",
18
18
  EDIT_COMPONENT_STATE = "editComponentState",
19
19
  GET_COMPONENT_DEVTOOLS_OPTIONS = "getAppDevtoolsOptions",
20
+ GET_COMPONENT_RENDER_CODE = "getComponentRenderCode",
20
21
  INSPECT_TIMELINE_EVENT = "inspectTimelineEvent",
21
22
  GET_INSPECTOR_TREE = "getInspectorTree",
22
23
  GET_INSPECTOR_STATE = "getInspectorState",
@@ -98,6 +99,10 @@ export declare type HookPayloads = {
98
99
  componentInstance: ComponentInstance;
99
100
  options: ComponentDevtoolsOptions;
100
101
  };
102
+ [Hooks.GET_COMPONENT_RENDER_CODE]: {
103
+ componentInstance: ComponentInstance;
104
+ code: string;
105
+ };
101
106
  [Hooks.INSPECT_TIMELINE_EVENT]: {
102
107
  app: App;
103
108
  layerId: string;
@@ -122,6 +127,7 @@ export declare type HookPayloads = {
122
127
  inspectorId: string;
123
128
  nodeId: string;
124
129
  path: string[];
130
+ type: string;
125
131
  state: EditStatePayload;
126
132
  set: (object: any, path: string | (string[]), value: any, cb?: (object: any, field: string, value: any) => void) => void;
127
133
  };
@@ -152,6 +158,7 @@ export interface Hookable<TContext> {
152
158
  getComponentRootElements(handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_ROOT_ELEMENTS], TContext>): any;
153
159
  editComponentState(handler: HookHandler<HookPayloads[Hooks.EDIT_COMPONENT_STATE], TContext>): any;
154
160
  getComponentDevtoolsOptions(handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS], TContext>): any;
161
+ getComponentRenderCode(handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_RENDER_CODE], TContext>): any;
155
162
  inspectTimelineEvent(handler: HookHandler<HookPayloads[Hooks.INSPECT_TIMELINE_EVENT], TContext>): any;
156
163
  getInspectorTree(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>): any;
157
164
  getInspectorState(handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/devtools-api",
3
- "version": "6.0.0-beta.10",
3
+ "version": "6.0.0-beta.14",
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",