import { VNode, App, ComponentInternalInstance, ComponentOptions, SuspenseBoundary } from 'vue'; import { RouteLocationNormalizedLoaded, RouteRecordNormalized, Router } from 'vue-router'; export { Router } from 'vue-router'; interface ComponentInspector { enabled: boolean; position: { x: number; y: number; }; linkParams: { file: string; line: number; column: number; }; enable: () => void; disable: () => void; toggleEnabled: () => void; openInEditor: (baseUrl: string, file: string, line: number, column: number) => void; onUpdated: () => void; } declare function toggleComponentInspectorEnabled(enabled: boolean): void; declare function getComponentInspector(): Promise; interface TimelineEvent { event: { groupId: number; time: number; title: string; subtitle: string; data: Record; }; layerId: string; } interface TimelineLayerItem { id: string; label: string; color: number; } declare function addTimelineLayer(payload: TimelineLayerItem): void; declare function getTimelineLayer(): TimelineLayerItem[]; interface Inspector { id: string; nodeId: string; filter: string; treeFilterPlaceholder: string; } interface InspectorApiPayload { id: string; label: string; icon?: string; treeFilterPlaceholder?: string; actions?: { icon: string; tooltip: string; action: (payload: unknown) => void; }[]; } declare function addInspector(payload: Inspector): void; declare function getInspector(inspectorId: string): Inspector | undefined; declare function updateInspector(inspectorId: string, payload: Partial): void; declare function setupDevToolsPlugin(pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction): void; interface InspectorNodeTag { label: string; textColor: number; backgroundColor: number; tooltip?: string; } interface ComponentTreeNode { uid: number | string; id: string; name: string; renderKey: string | number; inactive: boolean; isFragment: boolean; children: ComponentTreeNode[]; domOrder?: number[]; tags: InspectorNodeTag[]; autoOpen: boolean; file: string; } interface InspectorTreeApiPayload { app?: VueAppInstance; inspectorId?: string; filter?: string; instanceId?: string; rootNodes?: ComponentTreeNode[]; } interface ComponentBoundingRect { left: number; top: number; right: number; bottom: number; width: number; height: number; } interface ComponentBoundingRectApiPayload { app?: VueAppInstance; inspectorId?: string; instanceId?: string; rect?: ComponentBoundingRect; } interface InspectorCustomState { _custom?: { type?: string; displayText?: string; tooltipText?: string; value?: string | InspectorCustomState; stateTypeName?: string; fields?: { abstract?: boolean; }; }; } interface InspectorState { key: string; value: string | number | boolean | null | Record | InspectorCustomState | Array; type: string; stateType?: string; stateTypeName?: string; meta?: Record; raw?: string; editable?: boolean; children?: { key: string; value: string | number; type: string; }[]; } interface InspectorStateApiPayload { app: VueAppInstance; inspectorId: string; nodeId: string; state: { id: string; name: string; file: string | undefined; state: InspectorState[]; instance: VueAppInstance | undefined; }; } interface AddInspectorApiPayload { id: string; label: string; icon?: string; treeFilterPlaceholder?: string; actions?: { icon: string; tooltip: string; action: (payload: unknown) => void; }[]; } type Recordable = Record; type PropPath = string | string[]; interface InspectorStateEditorPayload { app?: AppRecord['app']; inspectorId: string; nodeId: string; type: string; path: PropPath; state: { value: unknown; newKey: string; remove?: boolean; type: string; }; set?: (obj: Recordable, path: PropPath, value: unknown, cb?: (object: Recordable, field: string, value: unknown) => void) => unknown; } type customTypeEnums = 'function' | 'bigint' | 'map' | 'set' | 'store' | 'router' | 'component' | 'component-definition' | 'HTMLElement' | 'component-definition' | 'date'; interface ComponentHighLighterOptions { bounds: ComponentBoundingRect; name?: string; id?: string; visible?: boolean; } interface ScrollToComponentOptions { id?: string; } declare function toggleComponentHighLighter(options: ComponentHighLighterOptions): void; declare function highlight(instance: VueAppInstance): void; declare function unhighlight(): void; declare function inspectComponentHighLighter(): Promise; declare function scrollToComponent(options: ScrollToComponentOptions): void; type TabCategory = 'pinned' | 'app' | 'modules' | 'advanced'; type ModuleView = ModuleIframeView | ModuleVNodeView; interface ModuleIframeView { /** * Iframe view */ type: 'iframe'; /** * Url of the iframe */ src: string; /** * Persist the iframe instance even if the tab is not active * * @default true */ persistent?: boolean; } interface ModuleVNodeView { /** * Vue's VNode view */ type: 'vnode'; /** * Send vnode to the client, they must be static and serializable */ vnode: VNode; } interface CustomTab { /** * The name of the tab, must be unique */ name: string; /** * Icon of the tab, support any Iconify icons, or a url to an image */ icon?: string; /** * Title of the tab */ title: string; /** * Main view of the tab */ view: ModuleView; /** * Category of the tab * @default 'app' */ category?: TabCategory; } interface CustomCommandAction { type: 'url'; /** * Url of the action, if set, execute the action will open the url */ src: string; } interface CustomCommand { /** * The id of the command, should be unique */ id: string; title: string; description?: string; /** * Order of the command, bigger number will be shown first * @default 0 */ order?: number; /** * Icon of the tab, support any Iconify icons, or a url to an image */ icon?: string; /** * - action of the command * - __NOTE__: This will be ignored if `children` is set */ action?: CustomCommandAction; /** * - children of action, if set, execute the action will show the children */ children?: Omit[]; } declare function addCustomCommand(action: CustomCommand): void; declare function removeCustomCommand(actionId: string): void; declare enum DevToolsEvents { DEVTOOLS_STATE_UPDATED = "devtools:state-updated", DEVTOOLS_CONNECTED_UPDATED = "devtools:connected-updated", ROUTER_INFO_UPDATED = "router-info:updated", COMPONENT_STATE_INSPECT = "component-state:inspect", COMPONENT_UPDATED = "component:updated", TOGGLE_COMPONENT_HIGHLIGHTER = "component-highlighter:toggle", GET_COMPONENT_BOUNDING_RECT = "component-bounding-rect:get", SCROLL_TO_COMPONENT = "scroll-to-component", GET_INSPECTOR_TREE = "inspector-tree:get", SEND_INSPECTOR_TREE = "inspector-tree:send", GET_INSPECTOR_STATE = "inspector-state:get", EDIT_INSPECTOR_STATE = "inspector-state:edit", SEND_INSPECTOR_STATE = "inspector-state:send", VISIT_COMPONENT_TREE = "component-tree:visit", ADD_TIMELINE_EVENT = "timeline:add-event", CUSTOM_TABS_UPDATED = "custom-tabs:updated", CUSTOM_COMMANDS_UPDATED = "custom-commands:updated" } interface DevToolsEvent$1 { [DevToolsEvents.ADD_TIMELINE_EVENT]: (payload: TimelineEvent) => void; [DevToolsEvents.ROUTER_INFO_UPDATED]: (routerInfo: RouterInfo) => void; [DevToolsEvents.TOGGLE_COMPONENT_HIGHLIGHTER]: (payload: ComponentHighLighterOptions) => void; [DevToolsEvents.SCROLL_TO_COMPONENT]: (payload: ScrollToComponentOptions) => void; [DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]: (payload: ComponentBoundingRectApiPayload) => void; [DevToolsEvents.DEVTOOLS_STATE_UPDATED]: (state: DevToolsState, oldState: DevToolsState) => void; [DevToolsEvents.DEVTOOLS_CONNECTED_UPDATED]: (state: DevToolsState, oldState: DevToolsState) => void; [DevToolsEvents.COMPONENT_STATE_INSPECT]: (payload: { componentInstance: VueAppInstance | undefined; app: VueAppInstance | undefined; instanceData: InspectorStateApiPayload['state']; }) => void; [DevToolsEvents.GET_INSPECTOR_TREE]: (payload: InspectorTreeApiPayload) => void; [DevToolsEvents.SEND_INSPECTOR_TREE]: (payload: { inspectorId: string; data: InspectorTreeApiPayload['rootNodes']; }) => void; [DevToolsEvents.GET_INSPECTOR_STATE]: (payload: InspectorStateApiPayload) => void; [DevToolsEvents.EDIT_INSPECTOR_STATE]: (payload: InspectorStateEditorPayload) => void; [DevToolsEvents.SEND_INSPECTOR_STATE]: (payload: string) => void; [DevToolsEvents.VISIT_COMPONENT_TREE]: (payload: { componentInstance: VueAppInstance | undefined; app: VueAppInstance | undefined; treeNode: ComponentTreeNode; filter: string; }) => void; [DevToolsEvents.CUSTOM_TABS_UPDATED]: (payload: CustomTab[]) => void; [DevToolsEvents.CUSTOM_COMMANDS_UPDATED]: (payload: CustomCommand[]) => void; [DevToolsEvents.COMPONENT_UPDATED]: () => void; } type DevToolsEventParams = Parameters; type PluginApi = DevToolsPluginApi; declare type PluginSettingsItem = { label: string; description?: string; } & ({ type: 'boolean'; defaultValue: boolean; } | { type: 'choice'; defaultValue: string | number; options: { value: string | number; label: string; }[]; component?: 'select' | 'button-group'; } | { type: 'text'; defaultValue: string; }); interface PluginDescriptor { id: string; label: string; app: App; packageName?: string; homepage?: string; componentStateTypes?: string[]; logo?: string; disableAppScope?: boolean; disablePluginScope?: boolean; /** * Run the plugin setup and expose the api even if the devtools is not opened yet. * Useful to record timeline events early. */ enableEarlyProxy?: boolean; settings?: Record; } type PluginSetupFunction = (api: PluginApi) => void; type VueAppInstance = ComponentInternalInstance & { type: { _componentTag: string | undefined; components: Record; __VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__: string; __isKeepAlive: boolean; devtools: { hide: boolean; }; mixins: ComponentOptions[]; extends: ComponentOptions; vuex: { getters: Record; }; computed: Record; }; __v_cache: Cache; __VUE_DEVTOOLS_UID__: string; _isBeingDestroyed: boolean; _instance: VueAppInstance; _container: { _vnode: { component: VueAppInstance; }; }; isUnmounted: boolean; parent: VueAppInstance; appContext: { app: VueAppInstance & App & { __VUE_DEVTOOLS_APP_RECORD_ID__: string; __VUE_DEVTOOLS_APP_RECORD__: AppRecord; }; }; __VUE_DEVTOOLS_APP_RECORD__: AppRecord; suspense: SuspenseBoundary & { suspenseKey: string; }; renderContext: Record; devtoolsRawSetupState: Record; setupState: Record; provides: Record; ctx: Record; } & App; interface AppRecord { id: string | number; name: string; app?: App; version?: string; types?: Record; instanceMap: Map; rootInstance: VueAppInstance; api?: PluginApi; routerId?: string; moduleDetectives?: { vueRouter: boolean; pinia: boolean; vueI18n: boolean; }; } type HookAppInstance = App & VueAppInstance; declare enum DevToolsHooks { APP_INIT = "app:init", APP_UNMOUNT = "app:unmount", COMPONENT_UPDATED = "component:updated", COMPONENT_ADDED = "component:added", COMPONENT_REMOVED = "component:removed", COMPONENT_EMIT = "component:emit", PERFORMANCE_START = "perf:start", PERFORMANCE_END = "perf:end", ADD_ROUTE = "router:add-route", REMOVE_ROUTE = "router:remove-route", RENDER_TRACKED = "render:tracked", RENDER_TRIGGERED = "render:triggered", APP_CONNECTED = "app:connected", SETUP_DEVTOOLS_PLUGIN = "devtools-plugin:setup" } interface DevToolsEvent { [DevToolsHooks.APP_INIT]: (app: VueAppInstance['appContext']['app'], version: string) => void; [DevToolsHooks.APP_CONNECTED]: () => void; [DevToolsHooks.COMPONENT_ADDED]: (app: HookAppInstance, uid: number, parentUid: number, component: VueAppInstance) => void; [DevToolsHooks.COMPONENT_UPDATED]: DevToolsEvent['component:added']; [DevToolsHooks.COMPONENT_REMOVED]: DevToolsEvent['component:added']; [DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction, options?: { target?: string; }) => void; } interface DevToolsHook { id: string; enabled?: boolean; devtoolsVersion: string; events: Map; emit: (event: DevToolsHooks, ...payload: any[]) => void; on: (event: DevToolsHooks, handler: T) => () => void; once: (event: DevToolsHooks, handler: T) => void; off: (event: DevToolsHooks, handler: T) => void; appRecords: AppRecord[]; apps: Record; cleanupBuffer?: (matchArg: unknown) => boolean; } interface VueHooks { on: { vueAppInit: (fn: DevToolsEvent[DevToolsHooks.APP_INIT]) => void; vueAppConnected: (fn: DevToolsEvent[DevToolsHooks.APP_CONNECTED]) => void; componentAdded: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_ADDED]) => () => void; componentUpdated: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_UPDATED]) => () => void; componentRemoved: (fn: DevToolsEvent[DevToolsHooks.COMPONENT_REMOVED]) => () => void; setupDevtoolsPlugin: (fn: DevToolsEvent[DevToolsHooks.SETUP_DEVTOOLS_PLUGIN]) => void; }; setupDevToolsPlugin: (pluginDescriptor: PluginDescriptor, setupFn: PluginSetupFunction) => void; } declare function addCustomTab(tab: CustomTab): void; interface DevToolsState { connected: boolean; clientConnected: boolean; vitePluginDetected: boolean; appRecords: AppRecord[]; activeAppRecord: AppRecord | null; selectedComponentId: string | null; pluginBuffer: [PluginDescriptor, PluginSetupFunction][]; tabs: CustomTab[]; commands: CustomCommand[]; activeAppRecordId: string | null; highPerfModeEnabled: boolean; } interface RouterInfo { currentRoute: RouteLocationNormalizedLoaded | null | {}; routes: RouteRecordNormalized[]; } interface DevToolsContext { appRecord: AppRecord | null; api: DevToolsPluginApi; inspector: Inspector[]; timelineLayer: TimelineLayerItem[]; routerInfo: RouterInfo; router: Router | null; activeInspectorTreeId: string; componentPluginHookBuffer: (() => void)[]; clear: () => void; } interface DevToolsEnv { vitePluginDetected: boolean; } interface OpenInEditorOptions { baseUrl?: string; file?: string; line?: number; column?: number; } declare function openInEditor(options?: OpenInEditorOptions): void; declare const on: { readonly addTimelineEvent: (fn: DevToolsEvent$1[DevToolsEvents.ADD_TIMELINE_EVENT]) => void; readonly inspectComponent: (fn: DevToolsEvent$1[DevToolsEvents.COMPONENT_STATE_INSPECT]) => void; readonly visitComponentTree: (fn: DevToolsEvent$1[DevToolsEvents.VISIT_COMPONENT_TREE]) => void; readonly getInspectorTree: (fn: DevToolsEvent$1[DevToolsEvents.GET_INSPECTOR_TREE]) => void; readonly getInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.GET_INSPECTOR_STATE]) => void; readonly sendInspectorTree: (fn: DevToolsEvent$1[DevToolsEvents.SEND_INSPECTOR_TREE]) => void; readonly sendInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.SEND_INSPECTOR_STATE]) => void; readonly editInspectorState: (fn: DevToolsEvent$1[DevToolsEvents.EDIT_INSPECTOR_STATE]) => void; readonly editComponentState: () => void; readonly componentUpdated: (fn: DevToolsEvent$1[DevToolsEvents.COMPONENT_UPDATED]) => void; readonly routerInfoUpdated: (fn: DevToolsEvent$1[DevToolsEvents.ROUTER_INFO_UPDATED]) => void; readonly getComponentBoundingRect: (fn: DevToolsEvent$1[DevToolsEvents.GET_COMPONENT_BOUNDING_RECT]) => void; readonly customTabsUpdated: (fn: DevToolsEvent$1[DevToolsEvents.CUSTOM_TABS_UPDATED]) => void; readonly customCommandsUpdated: (fn: DevToolsEvent$1[DevToolsEvents.CUSTOM_COMMANDS_UPDATED]) => void; readonly devtoolsStateUpdated: (fn: DevToolsEvent$1[DevToolsEvents.DEVTOOLS_STATE_UPDATED]) => void; }; declare function remove(): void; declare class DevToolsPluginApi { on: typeof on; clear: typeof remove; constructor(); addTimelineLayer(payload: TimelineLayerItem): void; addTimelineEvent(...params: DevToolsEventParams): void; addInspector(payload: InspectorApiPayload): void; highlightElement(instance: VueAppInstance): void; unhighlightElement(): void; getInspectorTree(payload?: DevToolsEventParams[0]): Promise; getInspectorState(payload?: { inspectorId?: string; nodeId?: string; }): any; editInspectorState(payload: InspectorStateEditorPayload): Promise; sendInspectorTree(inspectorId: string): Promise; sendInspectorState(inspectorId: string): Promise; getComponentInstances(app: VueAppInstance): Promise; visitComponentTree(...params: DevToolsEventParams): void; notifyComponentUpdate(): void; now(): number; getSettings(): { logStoreChanges: null; }; toggleComponentInspector(...params: DevToolsEventParams): void; inspectComponentInspector(): Promise; scrollToComponent(...params: DevToolsEventParams): void; getComponentBoundingRect(...params: DevToolsEventParams): string; toggleApp(id: string): Promise; addCustomTab(tab: CustomTab): void; addCustomCommand(action: CustomCommand): void; removeCustomCommand(actionId: CustomCommand['id']): void; openInEditor(payload: OpenInEditorOptions): void; getVueInspector(): Promise; } declare function initDevTools(): void; declare function onDevToolsConnected(fn: () => void): Promise; declare function onDevToolsClientConnected(fn: () => void): Promise; declare const hook: VueHooks; declare const devtoolsState: DevToolsState; declare const devtoolsContext: DevToolsContext; declare function setDevToolsEnv(env: Partial): void; declare function toggleHighPerfMode(state?: boolean): void; declare function getInspectorStateValueType(value: any, raw?: boolean): string; declare function formatInspectorStateValue(value: any, quotes?: boolean): any; declare function getRaw(value: InspectorState['value']): { value: object | string | number | boolean | null; inherit: {} | { abstract: true; }; customType?: customTypeEnums; }; declare function toEdit(value: unknown, customType?: customTypeEnums): string; declare function toSubmit(value: string, customType?: customTypeEnums): any; declare function stringify>(data: T): string | string[]; declare function parse(data: string, revive?: boolean): any; declare const UNDEFINED = "__vue_devtool_undefined__"; interface DevToolsType { state: typeof devtoolsState; context: typeof devtoolsContext; hook: typeof hook; init: typeof initDevTools; get api(): typeof devtoolsContext.api; } declare const devtools: { state: DevToolsState; context: DevToolsContext; hook: VueHooks; init: typeof initDevTools; readonly api: DevToolsPluginApi; }; export { type AddInspectorApiPayload, type AppRecord, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentHighLighterOptions, type ComponentInspector, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, type DevToolsContext, type DevToolsEnv, type DevToolsEvent, type DevToolsHook, DevToolsHooks, type DevToolsState, type DevToolsType, type Inspector, type InspectorApiPayload, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, type OpenInEditorOptions, type PluginApi, type PluginDescriptor, type PluginSettingsItem, type PluginSetupFunction, type PropPath, type RouterInfo, type ScrollToComponentOptions, type TimelineEvent, type TimelineLayerItem, UNDEFINED, type VueAppInstance, type VueHooks, addCustomCommand, addCustomTab, addInspector, addTimelineLayer, type customTypeEnums, devtools, formatInspectorStateValue, getComponentInspector, getInspector, getInspectorStateValueType, getRaw, getTimelineLayer, highlight, inspectComponentHighLighter, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, removeCustomCommand, scrollToComponent, setDevToolsEnv, setupDevToolsPlugin, stringify, toEdit, toSubmit, toggleComponentHighLighter, toggleComponentInspectorEnabled, toggleHighPerfMode, unhighlight, updateInspector };