@vue/devtools-api 6.0.11 → 6.1.0

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
@@ -16,6 +16,7 @@ const const_1 = require("./const");
16
16
  const proxy_1 = require("./proxy");
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./plugin"), exports);
19
+ __exportStar(require("./time"), exports);
19
20
  function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
20
21
  const descriptor = pluginDescriptor;
21
22
  const target = (0, env_1.getTarget)();
package/lib/cjs/proxy.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiProxy = void 0;
4
4
  const const_1 = require("./const");
5
+ const time_1 = require("./time");
5
6
  class ApiProxy {
6
7
  constructor(plugin, hook) {
7
8
  this.target = null;
@@ -39,6 +40,9 @@ class ApiProxy {
39
40
  }
40
41
  currentSettings = value;
41
42
  },
43
+ now() {
44
+ return (0, time_1.now)();
45
+ },
42
46
  };
43
47
  if (hook) {
44
48
  hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.now = void 0;
4
+ let supported;
5
+ let perf;
6
+ function isSupported() {
7
+ if (supported !== undefined) {
8
+ return supported;
9
+ }
10
+ if (typeof window !== 'undefined' && window.performance) {
11
+ supported = true;
12
+ perf = window.performance;
13
+ }
14
+ else {
15
+ supported = false;
16
+ }
17
+ return supported;
18
+ }
19
+ function now() {
20
+ return isSupported() ? perf.now() : Date.now();
21
+ }
22
+ exports.now = now;
@@ -18,6 +18,7 @@ export interface DevtoolsPluginApi<TSettings> {
18
18
  highlightElement(instance: ComponentInstance): void;
19
19
  unhighlightElement(): void;
20
20
  getSettings(pluginId?: string): TSettings;
21
+ now(): number;
21
22
  /**
22
23
  * @private Not implemented yet
23
24
  */
@@ -49,6 +49,7 @@ export interface ComponentCustomState extends ComponentStateBase {
49
49
  export declare type CustomState = {
50
50
  _custom: {
51
51
  type: ComponentBuiltinCustomStateTypes | string;
52
+ objectType?: string;
52
53
  display?: string;
53
54
  tooltip?: string;
54
55
  value?: any;
@@ -2,6 +2,7 @@ import { DevtoolsPluginApi } from './api';
2
2
  import { PluginDescriptor, ExtractSettingsTypes, PluginSettingsItem } from './plugin';
3
3
  export * from './api';
4
4
  export * from './plugin';
5
+ export * from './time';
5
6
  export { PluginQueueItem } from './env';
6
7
  declare type Cast<A, B> = A extends B ? A : B;
7
8
  declare type Narrowable = string | number | bigint | boolean;
package/lib/esm/index.js CHANGED
@@ -3,6 +3,7 @@ import { HOOK_SETUP } from './const';
3
3
  import { ApiProxy } from './proxy';
4
4
  export * from './api';
5
5
  export * from './plugin';
6
+ export * from './time';
6
7
  export function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
7
8
  const descriptor = pluginDescriptor;
8
9
  const target = getTarget();
package/lib/esm/proxy.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { HOOK_PLUGIN_SETTINGS_SET } from './const';
2
+ import { now } from './time';
2
3
  export class ApiProxy {
3
4
  constructor(plugin, hook) {
4
5
  this.target = null;
@@ -36,6 +37,9 @@ export class ApiProxy {
36
37
  }
37
38
  currentSettings = value;
38
39
  },
40
+ now() {
41
+ return now();
42
+ },
39
43
  };
40
44
  if (hook) {
41
45
  hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
@@ -0,0 +1 @@
1
+ export declare function now(): number;
@@ -0,0 +1,18 @@
1
+ let supported;
2
+ let perf;
3
+ function isSupported() {
4
+ if (supported !== undefined) {
5
+ return supported;
6
+ }
7
+ if (typeof window !== 'undefined' && window.performance) {
8
+ supported = true;
9
+ perf = window.performance;
10
+ }
11
+ else {
12
+ supported = false;
13
+ }
14
+ return supported;
15
+ }
16
+ export function now() {
17
+ return isSupported() ? perf.now() : Date.now();
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/devtools-api",
3
- "version": "6.0.11",
3
+ "version": "6.1.0",
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",