Skip to content

Commit 8f51aae

Browse files
committed
fix(core): avoid bundling Vite and Vue Router types in declarations
1 parent 0dea144 commit 8f51aae

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

packages/core/src/rpc/global.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DevToolsV6PluginAPIHookKeys, DevToolsV6PluginAPIHookPayloads, OpenInEditorOptions } from '@vue/devtools-kit'
1+
import type { DevToolsV6PluginAPIHookKeys, DevToolsV6PluginAPIHookPayloads, OpenInEditorOptions, Router, RouterInfo } from '@vue/devtools-kit'
22
import { devtools, DevToolsContextHookKeys, DevToolsMessagingHookKeys, devtoolsRouter, devtoolsRouterInfo, getActiveInspectors, getInspector, getInspectorActions, getInspectorInfo, getInspectorNodeActions, getRpcClient, getRpcServer, stringify, toggleClientConnected, updateDevToolsClientDetected, updateTimelineLayersState } from '@vue/devtools-kit'
33
import { createHooks } from 'hookable'
44

@@ -135,10 +135,10 @@ export const functions = {
135135
getRouterInfo() {
136136
return devtoolsRouterInfo
137137
},
138-
navigate(path: string) {
139-
return devtoolsRouter.value?.push(path).catch(() => ({}))
138+
navigate(path: string): Promise<Awaited<ReturnType<Router['push']>> | Record<string, never>> | undefined {
139+
return devtoolsRouter.value?.push(path).catch((): Record<string, never> => ({}))
140140
},
141-
getMatchedRoutes(path: string) {
141+
getMatchedRoutes(path: string): RouterInfo['routes'] {
142142
const c = console.warn
143143
console.warn = () => {}
144144
const matched = devtoolsRouter.value?.resolve?.({

packages/core/src/rpc/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { ModuleNode } from 'vite'
2-
31
// assets
42
export type AssetType = 'image' | 'font' | 'video' | 'audio' | 'text' | 'json' | 'wasm' | 'other'
53
export interface AssetInfo {
@@ -19,7 +17,10 @@ export interface ImageMeta {
1917
mimeType?: string
2018
}
2119

22-
export type AssetImporter = Pick<ModuleNode, 'url' | 'id'>
20+
export interface AssetImporter {
21+
url: string
22+
id: string | null
23+
}
2324

2425
export interface AssetEntry {
2526
path: string

0 commit comments

Comments
 (0)