import * as _vue_devtools_kit0 from "@vue/devtools-kit"; import { AppRecord, CustomCommand, CustomTab, DevToolsV6PluginAPIHookKeys, DevToolsV6PluginAPIHookPayloads, OpenInEditorOptions, Router, RouterInfo, getRpcClient, getRpcServer, getViteRpcClient } from "@vue/devtools-kit"; import * as vue from "vue"; import { App, Ref } from "vue"; //#region src/client.d.ts declare function setDevToolsClientUrl(url: string): void; declare function getDevToolsClientUrl(): any; //#endregion //#region src/rpc/global.d.ts declare enum DevToolsMessagingEvents { INSPECTOR_TREE_UPDATED = "inspector-tree-updated", INSPECTOR_STATE_UPDATED = "inspector-state-updated", DEVTOOLS_STATE_UPDATED = "devtools-state-updated", ROUTER_INFO_UPDATED = "router-info-updated", TIMELINE_EVENT_UPDATED = "timeline-event-updated", INSPECTOR_UPDATED = "inspector-updated", ACTIVE_APP_UNMOUNTED = "active-app-updated", DESTROY_DEVTOOLS_CLIENT = "destroy-devtools-client", RELOAD_DEVTOOLS_CLIENT = "reload-devtools-client" } declare const functions: { on: (event: string, handler: Function) => void; off: (event: string, handler: Function) => void; once: (event: string, handler: Function) => void; emit: (event: string, ...args: any[]) => void; heartbeat: () => boolean; devtoolsState: () => { connected: boolean; clientConnected: boolean; vueVersion: string; tabs: _vue_devtools_kit0.CustomTab[]; commands: _vue_devtools_kit0.CustomCommand[]; vitePluginDetected: boolean; appRecords: { id: string; name: string; version: string | undefined; routerId: string | undefined; iframe: string | undefined; }[]; activeAppRecordId: string; timelineLayersState: Record; }; getInspectorTree(payload: Pick): Promise; getInspectorState(payload: Pick): Promise; editInspectorState(payload: DevToolsV6PluginAPIHookPayloads[DevToolsV6PluginAPIHookKeys.EDIT_INSPECTOR_STATE]): Promise; sendInspectorState(id: string): void; inspectComponentInspector(): Promise; cancelInspectComponentInspector(): void; getComponentRenderCode(id: string): any; scrollToComponent(id: string): void; inspectDOM(id: string): void; getInspectorNodeActions(id: string): { icon: string; tooltip?: string; action: (nodeId: string) => void | Promise; }[] | undefined; getInspectorActions(id: string): { icon: string; tooltip?: string; action: () => void | Promise; }[] | undefined; updateTimelineLayersState(state: Record): void; callInspectorNodeAction(inspectorId: string, actionIndex: number, nodeId: string): void; callInspectorAction(inspectorId: string, actionIndex: number): void; openInEditor(options: OpenInEditorOptions): void; checkVueInspectorDetected(): Promise; enableVueInspector(): Promise; toggleApp(id: string, options?: { inspectingComponent?: boolean; }): Promise; updatePluginSettings(pluginId: string, key: string, value: string): void; getPluginSettings(pluginId: string): { options: Record | null; values: any; }; getRouterInfo(): RouterInfo; navigate(path: string): Promise> | Record> | undefined; getMatchedRoutes(path: string): RouterInfo["routes"]; toggleClientConnected(state: boolean): void; getCustomInspector(): { id: string; label: string; logo: string; icon: string; packageName: string | undefined; homepage: string | undefined; pluginId: string; }[]; getInspectorInfo(id: string): { id: string; label: string; logo: string | undefined; packageName: string | undefined; homepage: string | undefined; timelineLayers: { id: string; label: string; color: number; }[]; treeFilterPlaceholder: string; stateFilterPlaceholder: string; } | undefined; highlighComponent(uid: string): Promise; unhighlight(): Promise; updateDevToolsClientDetected(params: Record): void; initDevToolsServerListener(): void; }; type RPCFunctions = typeof functions; declare const rpc: { value: ReturnType>; functions: ReturnType>; }; declare const rpcServer: { value: ReturnType>; functions: ReturnType>; }; declare function onRpcConnected(callback: () => void): void; declare function onRpcSeverReady(callback: () => void): void; //#endregion //#region src/rpc/types.d.ts type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'wasm' | 'other'; interface AssetInfo { path: string; type: AssetType; publicPath: string; relativePath: string; filePath: string; size: number; mtime: number; } interface ImageMeta { width: number; height: number; orientation?: number; type?: string; mimeType?: string; } interface AssetImporter { url: string; id: string | null; } interface AssetEntry { path: string; content: string; encoding?: BufferEncoding; override?: boolean; } interface CodeSnippet { code: string; lang: string; name: string; docs?: string; } interface ModuleInfo { id: string; plugins: { name: string; transform?: number; resolveId?: number; }[]; deps: string[]; virtual: boolean; } //#endregion //#region src/rpc/vite.d.ts declare const viteRpcFunctions: { on: (event: string, handler: Function) => void; off: (event: string, handler: Function) => void; once: (event: string, handler: Function) => void; emit: (event: string, ...args: any[]) => void; heartbeat: () => boolean; }; type ViteRPCFunctions = typeof viteRpcFunctions & { getStaticAssets: () => Promise; getAssetImporters: (url: string) => Promise; getImageMeta: (filepath: string) => Promise; getTextAssetContent: (filepath: string, limit?: number) => Promise; getRoot: () => Promise; getGraphModules: () => Promise; }; declare const viteRpc: { value: ReturnType>; functions: ReturnType>; }; declare function onViteRpcConnected(callback: () => void): void; declare function createViteClientRpc(): void; declare function createViteServerRpc(functions: Record): void; //#endregion //#region src/vue-plugin/devtools-state.d.ts interface DevToolsState { connected: boolean; clientConnected: boolean; vueVersion: string; tabs: CustomTab[]; commands: CustomCommand[]; vitePluginDetected: boolean; appRecords: AppRecord[]; activeAppRecordId: string; timelineLayersState: Record; } type DevToolsRefState = { [P in keyof DevToolsState]: Ref }; declare function VueDevToolsVuePlugin(): { install(app: App): void; }; declare function createDevToolsStateContext(): { getDevToolsState: () => void; connected: Ref; clientConnected: Ref; vueVersion: Ref; tabs: Ref<{ name: string; icon?: string | undefined; title: string; view: { type: "iframe"; src: string; persistent?: boolean | undefined; } | { type: "vnode"; vnode: vue.VNode; } | { type: "sfc"; sfc: string; }; category?: ("app" | "pinned" | "modules" | "advanced") | undefined; }[], CustomTab[] | { name: string; icon?: string | undefined; title: string; view: { type: "iframe"; src: string; persistent?: boolean | undefined; } | { type: "vnode"; vnode: vue.VNode; } | { type: "sfc"; sfc: string; }; category?: ("app" | "pinned" | "modules" | "advanced") | undefined; }[]>; commands: Ref<{ id: string; title: string; description?: string | undefined; order?: number | undefined; icon?: string | undefined; action?: { type: "url"; src: string; } | undefined; children?: { icon?: string | undefined; title: string; id: string; description?: string | undefined; order?: number | undefined; action?: { type: "url"; src: string; } | undefined; }[] | undefined; }[], CustomCommand[] | { id: string; title: string; description?: string | undefined; order?: number | undefined; icon?: string | undefined; action?: { type: "url"; src: string; } | undefined; children?: { icon?: string | undefined; title: string; id: string; description?: string | undefined; order?: number | undefined; action?: { type: "url"; src: string; } | undefined; }[] | undefined; }[]>; vitePluginDetected: Ref; appRecords: Ref<{ id: string; name: string; app?: _vue_devtools_kit0.App; version?: string | undefined; types?: Record | undefined; instanceMap: Map & Omit, keyof Map>; perfGroupIds: Map & Omit, keyof Map>; rootInstance: _vue_devtools_kit0.VueAppInstance; routerId?: string | undefined; iframe?: string | undefined; }[], AppRecord[] | { id: string; name: string; app?: _vue_devtools_kit0.App; version?: string | undefined; types?: Record | undefined; instanceMap: Map & Omit, keyof Map>; perfGroupIds: Map & Omit, keyof Map>; rootInstance: _vue_devtools_kit0.VueAppInstance; routerId?: string | undefined; iframe?: string | undefined; }[]>; activeAppRecordId: Ref; timelineLayersState: Ref, Record>; }; declare function useDevToolsState(): DevToolsRefState; declare function onDevToolsConnected(fn: () => void): () => void; declare function refreshCurrentPageData(): void; //#endregion export { AssetEntry, AssetImporter, AssetInfo, AssetType, CodeSnippet, DevToolsMessagingEvents, ImageMeta, ModuleInfo, RPCFunctions, ViteRPCFunctions, VueDevToolsVuePlugin, createDevToolsStateContext, createViteClientRpc, createViteServerRpc, functions, getDevToolsClientUrl, onDevToolsConnected, onRpcConnected, onRpcSeverReady, onViteRpcConnected, refreshCurrentPageData, rpc, rpcServer, setDevToolsClientUrl, useDevToolsState, viteRpc, viteRpcFunctions };