@vitejs/devtools-kit
Advanced tools
| import { RpcFunctionsCollectorBase } from "birpc-x"; | ||
| import { WebSocketRpcClientOptions } from "@vitejs/devtools-rpc/presets/ws/client"; | ||
| import { Emitter } from "nanoevents"; | ||
| import { Raw } from "vue"; | ||
| import { Plugin, ResolvedConfig, ViteDevServer } from "vite"; | ||
| import { BirpcFn, BirpcOptions, BirpcReturn, BirpcReturn as BirpcReturn$1 } from "birpc"; | ||
| //#region src/types/rpc-augments.d.ts | ||
| /** | ||
| * To be extended | ||
| */ | ||
| interface DevToolsRpcClientFunctions {} | ||
| /** | ||
| * To be extended | ||
| */ | ||
| interface DevToolsRpcServerFunctions {} | ||
| //#endregion | ||
| //#region src/types/utils.d.ts | ||
| type Thenable<T> = T | Promise<T>; | ||
| type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] }; | ||
| //#endregion | ||
| //#region src/types/views.d.ts | ||
| interface DevToolsDockHost { | ||
| views: Map<string, DevToolsDockEntry>; | ||
| register: (entry: DevToolsDockEntry) => void; | ||
| update: (entry: DevToolsDockEntry) => void; | ||
| values: () => DevToolsDockEntry[]; | ||
| } | ||
| interface DevToolsViewHost { | ||
| /** | ||
| * @internal | ||
| */ | ||
| buildStaticDirs: { | ||
| baseUrl: string; | ||
| distDir: string; | ||
| }[]; | ||
| /** | ||
| * Helper to host static files | ||
| * - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files | ||
| * - In `build` mode, it will copy the static files to the dist directory | ||
| */ | ||
| hostStatic: (baseUrl: string, distDir: string) => void; | ||
| } | ||
| type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default'; | ||
| interface DevToolsDockEntryBase { | ||
| id: string; | ||
| title: string; | ||
| icon: string | { | ||
| light: string; | ||
| dark: string; | ||
| }; | ||
| /** | ||
| * The default order of the entry in the dock. | ||
| * The higher the number the earlier it appears. | ||
| * @default 0 | ||
| */ | ||
| defaultOrder?: number; | ||
| /** | ||
| * The category of the entry | ||
| * @default 'default' | ||
| */ | ||
| category?: DevToolsDockEntryCategory; | ||
| } | ||
| interface ClientScriptEntry { | ||
| /** | ||
| * The filepath or module name to import from | ||
| */ | ||
| importFrom: string; | ||
| /** | ||
| * The name to import the module as | ||
| * | ||
| * @default 'default' | ||
| */ | ||
| importName?: string; | ||
| } | ||
| interface DevToolsViewIframe extends DevToolsDockEntryBase { | ||
| type: 'iframe'; | ||
| url: string; | ||
| /** | ||
| * The id of the iframe, if multiple tabs is assigned with the same id, the iframe will be shared. | ||
| * | ||
| * When not provided, it would be treated as a unique frame. | ||
| */ | ||
| frameId?: string; | ||
| /** | ||
| * Optional client script to import into the iframe | ||
| */ | ||
| clientScript?: ClientScriptEntry; | ||
| } | ||
| interface DevToolsViewAction extends DevToolsDockEntryBase { | ||
| type: 'action'; | ||
| action: ClientScriptEntry; | ||
| } | ||
| interface DevToolsViewCustomRender extends DevToolsDockEntryBase { | ||
| type: 'custom-render'; | ||
| renderer: ClientScriptEntry; | ||
| } | ||
| type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender; | ||
| //#endregion | ||
| //#region src/types/vite-plugin.d.ts | ||
| interface DevToolsCapabilities { | ||
| rpc?: boolean; | ||
| views?: boolean; | ||
| } | ||
| interface DevToolsPluginOptions { | ||
| capabilities?: { | ||
| dev?: DevToolsCapabilities | boolean; | ||
| build?: DevToolsCapabilities | boolean; | ||
| }; | ||
| setup: (context: DevToolsNodeContext) => void | Promise<void>; | ||
| } | ||
| interface DevToolsNodeContext { | ||
| readonly cwd: string; | ||
| readonly mode: 'dev' | 'build'; | ||
| readonly viteConfig: ResolvedConfig; | ||
| readonly viteServer?: ViteDevServer; | ||
| rpc: RpcFunctionsHost; | ||
| docks: DevToolsDockHost; | ||
| views: DevToolsViewHost; | ||
| utils: DevToolsNodeUtils; | ||
| } | ||
| interface DevToolsNodeUtils { | ||
| /** | ||
| * Create a simple client script from a function or stringified code | ||
| * | ||
| * @deprecated DO NOT USE. This is mostly for testing only. Please use a proper importable module instead. | ||
| * @experimental | ||
| */ | ||
| createSimpleClientScript: (fn: string | ((ctx: DockClientScriptContext) => void)) => ClientScriptEntry; | ||
| } | ||
| interface ConnectionMeta { | ||
| backend: 'websocket' | 'static'; | ||
| websocket?: number | string; | ||
| } | ||
| //#endregion | ||
| //#region src/types/rpc.d.ts | ||
| /** | ||
| * Type of the RPC function, | ||
| * - static: A function that returns a static data (can be cached and dumped) | ||
| * - action: A function that performs an action (no data returned) | ||
| * - query: A function that queries a resource | ||
| */ | ||
| type RpcFunctionType = 'static' | 'action' | 'query'; | ||
| type RpcFunctionsHost = RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext>; | ||
| interface RpcFunctionSetupResult<ARGS extends any[], RETURN = void> { | ||
| handler: (...args: ARGS) => RETURN; | ||
| } | ||
| interface RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[] = [], RETURN = void> { | ||
| name: NAME; | ||
| type: TYPE; | ||
| setup: (context: DevToolsNodeContext) => Thenable<RpcFunctionSetupResult<ARGS, RETURN>>; | ||
| handler?: (...args: ARGS) => RETURN; | ||
| __resolved?: RpcFunctionSetupResult<ARGS, RETURN>; | ||
| __promise?: Thenable<RpcFunctionSetupResult<ARGS, RETURN>>; | ||
| } | ||
| type RpcDefinitionsToFunctions<T extends readonly RpcFunctionDefinition<any, any, any>[]> = EntriesToObject<{ [K in keyof T]: [T[K]['name'], Awaited<ReturnType<T[K]['setup']>>['handler']] }>; | ||
| type RpcDefinitionsFilter<T extends readonly RpcFunctionDefinition<any, any, any>[], Type extends RpcFunctionType> = { [K in keyof T]: T[K] extends { | ||
| type: Type; | ||
| } ? T[K] : never }; | ||
| //#endregion | ||
| //#region src/types/vite-augment.d.ts | ||
| declare module 'vite' { | ||
| interface Plugin { | ||
| devtools?: DevToolsPluginOptions; | ||
| } | ||
| } | ||
| interface PluginWithDevTools extends Plugin { | ||
| devtools?: DevToolsPluginOptions; | ||
| } | ||
| //#endregion | ||
| //#region src/client/rpc.d.ts | ||
| interface DevToolsRpcClientOptions { | ||
| connectionMeta?: ConnectionMeta; | ||
| baseURL?: string[]; | ||
| wsOptions?: Partial<WebSocketRpcClientOptions>; | ||
| rpcOptions?: Partial<BirpcOptions<DevToolsRpcServerFunctions>>; | ||
| } | ||
| type DevToolsRpcClient = BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>; | ||
| declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promise<{ | ||
| connectionMeta: ConnectionMeta; | ||
| rpc: DevToolsRpcClient; | ||
| }>; | ||
| //#endregion | ||
| //#region src/client/docks.d.ts | ||
| interface DockPanelStorage { | ||
| width: number; | ||
| height: number; | ||
| top: number; | ||
| left: number; | ||
| position: 'left' | 'right' | 'bottom' | 'top'; | ||
| open: boolean; | ||
| inactiveTimeout: number; | ||
| } | ||
| type DockClientType = 'embedded' | 'standalone'; | ||
| interface DocksContext { | ||
| /** | ||
| * Type of the client environment | ||
| * | ||
| * 'embedded' - running inside an embedded floating panel | ||
| * 'standalone' - running inside a standlone window (no user app) | ||
| */ | ||
| readonly clientType: 'embedded' | 'standalone'; | ||
| /** | ||
| * The RPC client to interact with the server | ||
| */ | ||
| readonly rpc: DevToolsRpcClient; | ||
| /** | ||
| * The panel context | ||
| */ | ||
| panel: DocksPanelContext; | ||
| /** | ||
| * The docks entries context | ||
| */ | ||
| docks: DocksEntriesContext; | ||
| } | ||
| interface DocksPanelContext { | ||
| store: DockPanelStorage; | ||
| isDragging: boolean; | ||
| isResizing: boolean; | ||
| readonly isVertical: boolean; | ||
| } | ||
| interface DocksEntriesContext { | ||
| selected: DevToolsDockEntry | null; | ||
| entries: DevToolsDockEntry[]; | ||
| entryToStateMap: Map<string, DockEntryState>; | ||
| /** | ||
| * Get the state of a dock entry by its ID | ||
| */ | ||
| getStateById: (id: string) => DockEntryState | undefined; | ||
| /** | ||
| * Switch to the selected dock entry, pass `null` to clear the selection | ||
| * | ||
| * @returns Whether the selection was changed successfully | ||
| */ | ||
| switchEntry: (id: string | null) => Promise<boolean>; | ||
| } | ||
| interface DockEntryState { | ||
| entryMeta: DevToolsDockEntry; | ||
| readonly isActive: boolean; | ||
| domElements: { | ||
| iframe?: HTMLIFrameElement | null; | ||
| panel?: HTMLDivElement | null; | ||
| }; | ||
| events: Raw<Emitter<DockEntryStateEvents>>; | ||
| } | ||
| interface DockEntryStateEvents { | ||
| 'entry:activated': () => void; | ||
| 'entry:deactivated': () => void; | ||
| 'entry:updated': (newMeta: DevToolsDockEntry) => void; | ||
| 'dom:panel:mounted': (panel: HTMLDivElement) => void; | ||
| 'dom:iframe:mounted': (iframe: HTMLIFrameElement) => void; | ||
| } | ||
| //#endregion | ||
| //#region src/client/client-script.d.ts | ||
| /** | ||
| * Context for client scripts running in dock entries | ||
| */ | ||
| interface DockClientScriptContext extends DocksContext { | ||
| /** | ||
| * The state of the current dock entry | ||
| */ | ||
| current: DockEntryState; | ||
| } | ||
| //#endregion | ||
| export { DevToolsDockHost as A, DevToolsNodeContext as C, DevToolsDockEntry as D, ClientScriptEntry as E, EntriesToObject as F, Thenable as I, DevToolsRpcClientFunctions as L, DevToolsViewCustomRender as M, DevToolsViewHost as N, DevToolsDockEntryBase as O, DevToolsViewIframe as P, DevToolsRpcServerFunctions as R, DevToolsCapabilities as S, DevToolsPluginOptions as T, RpcFunctionDefinition as _, DockPanelStorage as a, RpcFunctionsHost as b, DocksPanelContext as c, getDevToolsRpcClient as d, PluginWithDevTools as f, RpcDefinitionsToFunctions as g, RpcDefinitionsFilter as h, DockEntryStateEvents as i, DevToolsViewAction as j, DevToolsDockEntryCategory as k, DevToolsRpcClient as l, BirpcReturn$1 as m, DockClientType as n, DocksContext as o, BirpcFn as p, DockEntryState as r, DocksEntriesContext as s, DockClientScriptContext as t, DevToolsRpcClientOptions as u, RpcFunctionSetupResult as v, DevToolsNodeUtils as w, ConnectionMeta as x, RpcFunctionType as y }; |
@@ -1,2 +0,2 @@ | ||
| import { a as DockPanelStorage, c as DocksPanelContext, d as getDevToolsRpcClient, i as DockEntryState, l as DevToolsRpcClient, n as DockClientScriptCurrent, o as DocksContext, r as DockClientType, s as DocksEntriesContext, t as DockClientScriptContext, u as DevToolsRpcClientOptions } from "./index-D9rmGPF1.mjs"; | ||
| export { DevToolsRpcClient, DevToolsRpcClientOptions, DockClientScriptContext, DockClientScriptCurrent, DockClientType, DockEntryState, DockPanelStorage, DocksContext, DocksEntriesContext, DocksPanelContext, getDevToolsRpcClient }; | ||
| import { a as DockPanelStorage, c as DocksPanelContext, d as getDevToolsRpcClient, i as DockEntryStateEvents, l as DevToolsRpcClient, n as DockClientType, o as DocksContext, r as DockEntryState, s as DocksEntriesContext, t as DockClientScriptContext, u as DevToolsRpcClientOptions } from "./index-Bf_5llis.mjs"; | ||
| export { DevToolsRpcClient, DevToolsRpcClientOptions, DockClientScriptContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DocksContext, DocksEntriesContext, DocksPanelContext, getDevToolsRpcClient }; |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { A as DevToolsDockHost, C as DevToolsNodeContext, D as DevToolsDockEntry, E as ClientScriptEntry, F as EntriesToObject, I as Thenable, L as DevToolsRpcClientFunctions, M as DevToolsViewCustomRender, N as DevToolsViewHost, O as DevToolsDockEntryBase, P as DevToolsViewIframe, R as DevToolsRpcServerFunctions, S as DevToolsCapabilities, T as DevToolsPluginOptions, _ as RpcFunctionDefinition, b as RpcFunctionsHost, f as PluginWithDevTools, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, j as DevToolsViewAction, k as DevToolsDockEntryCategory, m as BirpcReturn, p as BirpcFn, v as RpcFunctionSetupResult, w as DevToolsNodeUtils, x as ConnectionMeta, y as RpcFunctionType } from "./index-D9rmGPF1.mjs"; | ||
| import { A as DevToolsDockHost, C as DevToolsNodeContext, D as DevToolsDockEntry, E as ClientScriptEntry, F as EntriesToObject, I as Thenable, L as DevToolsRpcClientFunctions, M as DevToolsViewCustomRender, N as DevToolsViewHost, O as DevToolsDockEntryBase, P as DevToolsViewIframe, R as DevToolsRpcServerFunctions, S as DevToolsCapabilities, T as DevToolsPluginOptions, _ as RpcFunctionDefinition, b as RpcFunctionsHost, f as PluginWithDevTools, g as RpcDefinitionsToFunctions, h as RpcDefinitionsFilter, j as DevToolsViewAction, k as DevToolsDockEntryCategory, m as BirpcReturn, p as BirpcFn, v as RpcFunctionSetupResult, w as DevToolsNodeUtils, x as ConnectionMeta, y as RpcFunctionType } from "./index-Bf_5llis.mjs"; | ||
| import * as birpc_x0 from "birpc-x"; | ||
@@ -3,0 +3,0 @@ |
+3
-2
| { | ||
| "name": "@vitejs/devtools-kit", | ||
| "type": "module", | ||
| "version": "0.0.0-alpha.15", | ||
| "version": "0.0.0-alpha.16", | ||
| "description": "Vite DevTools Kit", | ||
@@ -38,3 +38,4 @@ "author": "VoidZero Inc.", | ||
| "birpc-x": "0.0.1", | ||
| "@vitejs/devtools-rpc": "0.0.0-alpha.15" | ||
| "nanoevents": "^9.1.0", | ||
| "@vitejs/devtools-rpc": "0.0.0-alpha.16" | ||
| }, | ||
@@ -41,0 +42,0 @@ "devDependencies": { |
| import { RpcFunctionsCollectorBase } from "birpc-x"; | ||
| import { WebSocketRpcClientOptions } from "@vitejs/devtools-rpc/presets/ws/client"; | ||
| import { Plugin, ResolvedConfig, ViteDevServer } from "vite"; | ||
| import { BirpcFn, BirpcOptions, BirpcReturn, BirpcReturn as BirpcReturn$1 } from "birpc"; | ||
| //#region src/types/rpc-augments.d.ts | ||
| /** | ||
| * To be extended | ||
| */ | ||
| interface DevToolsRpcClientFunctions {} | ||
| /** | ||
| * To be extended | ||
| */ | ||
| interface DevToolsRpcServerFunctions {} | ||
| //#endregion | ||
| //#region src/types/utils.d.ts | ||
| type Thenable<T> = T | Promise<T>; | ||
| type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] }; | ||
| //#endregion | ||
| //#region src/types/views.d.ts | ||
| interface DevToolsDockHost { | ||
| views: Map<string, DevToolsDockEntry>; | ||
| register: (entry: DevToolsDockEntry) => void; | ||
| update: (entry: DevToolsDockEntry) => void; | ||
| values: () => DevToolsDockEntry[]; | ||
| } | ||
| interface DevToolsViewHost { | ||
| /** | ||
| * @internal | ||
| */ | ||
| buildStaticDirs: { | ||
| baseUrl: string; | ||
| distDir: string; | ||
| }[]; | ||
| /** | ||
| * Helper to host static files | ||
| * - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files | ||
| * - In `build` mode, it will copy the static files to the dist directory | ||
| */ | ||
| hostStatic: (baseUrl: string, distDir: string) => void; | ||
| } | ||
| type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default'; | ||
| interface DevToolsDockEntryBase { | ||
| id: string; | ||
| title: string; | ||
| icon: string | { | ||
| light: string; | ||
| dark: string; | ||
| }; | ||
| /** | ||
| * The default order of the entry in the dock. | ||
| * The higher the number the earlier it appears. | ||
| * @default 0 | ||
| */ | ||
| defaultOrder?: number; | ||
| /** | ||
| * The category of the entry | ||
| * @default 'default' | ||
| */ | ||
| category?: DevToolsDockEntryCategory; | ||
| } | ||
| interface ClientScriptEntry { | ||
| /** | ||
| * The filepath or module name to import from | ||
| */ | ||
| importFrom: string; | ||
| /** | ||
| * The name to import the module as | ||
| * | ||
| * @default 'default' | ||
| */ | ||
| importName?: string; | ||
| } | ||
| interface DevToolsViewIframe extends DevToolsDockEntryBase { | ||
| type: 'iframe'; | ||
| url: string; | ||
| /** | ||
| * The id of the iframe, if multiple tabs is assigned with the same id, the iframe will be shared. | ||
| * | ||
| * When not provided, it would be treated as a unique frame. | ||
| */ | ||
| frameId?: string; | ||
| /** | ||
| * Optional client script to import into the iframe | ||
| */ | ||
| clientScript?: ClientScriptEntry; | ||
| } | ||
| interface DevToolsViewAction extends DevToolsDockEntryBase { | ||
| type: 'action'; | ||
| action: ClientScriptEntry; | ||
| } | ||
| interface DevToolsViewCustomRender extends DevToolsDockEntryBase { | ||
| type: 'custom-render'; | ||
| renderer: ClientScriptEntry; | ||
| } | ||
| type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender; | ||
| //#endregion | ||
| //#region src/types/vite-plugin.d.ts | ||
| interface DevToolsCapabilities { | ||
| rpc?: boolean; | ||
| views?: boolean; | ||
| } | ||
| interface DevToolsPluginOptions { | ||
| capabilities?: { | ||
| dev?: DevToolsCapabilities | boolean; | ||
| build?: DevToolsCapabilities | boolean; | ||
| }; | ||
| setup: (context: DevToolsNodeContext) => void | Promise<void>; | ||
| } | ||
| interface DevToolsNodeContext { | ||
| readonly cwd: string; | ||
| readonly mode: 'dev' | 'build'; | ||
| readonly viteConfig: ResolvedConfig; | ||
| readonly viteServer?: ViteDevServer; | ||
| rpc: RpcFunctionsHost; | ||
| docks: DevToolsDockHost; | ||
| views: DevToolsViewHost; | ||
| utils: DevToolsNodeUtils; | ||
| } | ||
| interface DevToolsNodeUtils { | ||
| /** | ||
| * Create a simple client script from a function or stringified code | ||
| * | ||
| * @deprecated DO NOT USE. This is mostly for testing only. Please use a proper importable module instead. | ||
| * @experimental | ||
| */ | ||
| createSimpleClientScript: (fn: string | ((ctx: DockClientScriptContext) => void)) => ClientScriptEntry; | ||
| } | ||
| interface ConnectionMeta { | ||
| backend: 'websocket' | 'static'; | ||
| websocket?: number | string; | ||
| } | ||
| //#endregion | ||
| //#region src/types/rpc.d.ts | ||
| /** | ||
| * Type of the RPC function, | ||
| * - static: A function that returns a static data (can be cached and dumped) | ||
| * - action: A function that performs an action (no data returned) | ||
| * - query: A function that queries a resource | ||
| */ | ||
| type RpcFunctionType = 'static' | 'action' | 'query'; | ||
| type RpcFunctionsHost = RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext>; | ||
| interface RpcFunctionSetupResult<ARGS extends any[], RETURN = void> { | ||
| handler: (...args: ARGS) => RETURN; | ||
| } | ||
| interface RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[] = [], RETURN = void> { | ||
| name: NAME; | ||
| type: TYPE; | ||
| setup: (context: DevToolsNodeContext) => Thenable<RpcFunctionSetupResult<ARGS, RETURN>>; | ||
| handler?: (...args: ARGS) => RETURN; | ||
| __resolved?: RpcFunctionSetupResult<ARGS, RETURN>; | ||
| __promise?: Thenable<RpcFunctionSetupResult<ARGS, RETURN>>; | ||
| } | ||
| type RpcDefinitionsToFunctions<T extends readonly RpcFunctionDefinition<any, any, any>[]> = EntriesToObject<{ [K in keyof T]: [T[K]['name'], Awaited<ReturnType<T[K]['setup']>>['handler']] }>; | ||
| type RpcDefinitionsFilter<T extends readonly RpcFunctionDefinition<any, any, any>[], Type extends RpcFunctionType> = { [K in keyof T]: T[K] extends { | ||
| type: Type; | ||
| } ? T[K] : never }; | ||
| //#endregion | ||
| //#region src/types/vite-augment.d.ts | ||
| declare module 'vite' { | ||
| interface Plugin { | ||
| devtools?: DevToolsPluginOptions; | ||
| } | ||
| } | ||
| interface PluginWithDevTools extends Plugin { | ||
| devtools?: DevToolsPluginOptions; | ||
| } | ||
| //#endregion | ||
| //#region src/client/rpc.d.ts | ||
| interface DevToolsRpcClientOptions { | ||
| connectionMeta?: ConnectionMeta; | ||
| baseURL?: string[]; | ||
| wsOptions?: Partial<WebSocketRpcClientOptions>; | ||
| rpcOptions?: Partial<BirpcOptions<DevToolsRpcServerFunctions>>; | ||
| } | ||
| type DevToolsRpcClient = BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>; | ||
| declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promise<{ | ||
| connectionMeta: ConnectionMeta; | ||
| rpc: DevToolsRpcClient; | ||
| }>; | ||
| //#endregion | ||
| //#region src/client/docks.d.ts | ||
| interface DockPanelStorage { | ||
| width: number; | ||
| height: number; | ||
| top: number; | ||
| left: number; | ||
| position: 'left' | 'right' | 'bottom' | 'top'; | ||
| open: boolean; | ||
| inactiveTimeout: number; | ||
| } | ||
| type DockClientType = 'embedded' | 'standalone'; | ||
| interface DocksContext { | ||
| /** | ||
| * Type of the client environment | ||
| * | ||
| * 'embedded' - running inside an embedded floating panel | ||
| * 'standalone' - running inside a standlone window (no user app) | ||
| */ | ||
| readonly clientType: 'embedded' | 'standalone'; | ||
| /** | ||
| * The RPC client to interact with the server | ||
| */ | ||
| readonly rpc: DevToolsRpcClient; | ||
| /** | ||
| * The panel context | ||
| */ | ||
| panel: DocksPanelContext; | ||
| /** | ||
| * The docks entries context | ||
| */ | ||
| docks: DocksEntriesContext; | ||
| } | ||
| interface DocksPanelContext { | ||
| store: DockPanelStorage; | ||
| isDragging: boolean; | ||
| isResizing: boolean; | ||
| readonly isVertical: boolean; | ||
| } | ||
| interface DocksEntriesContext { | ||
| selected: DevToolsDockEntry | null; | ||
| entries: DevToolsDockEntry[]; | ||
| entryToStateMap: Map<string, DockEntryState>; | ||
| /** | ||
| * Get the state of a dock entry by its ID | ||
| */ | ||
| getStateById: (id: string) => DockEntryState | undefined; | ||
| /** | ||
| * Switch to the selected dock entry, pass `null` to clear the selection | ||
| * | ||
| * @returns Whether the selection was changed successfully | ||
| */ | ||
| switchEntry: (id: string | null) => Promise<boolean>; | ||
| } | ||
| interface DockEntryState { | ||
| entryMeta: DevToolsDockEntry; | ||
| readonly isActive: boolean; | ||
| domElements: { | ||
| iframe?: HTMLIFrameElement | null; | ||
| panel?: HTMLDivElement | null; | ||
| }; | ||
| } | ||
| //#endregion | ||
| //#region src/client/client-script.d.ts | ||
| /** | ||
| * Context for client scripts running in dock entries | ||
| */ | ||
| interface DockClientScriptContext extends DocksContext { | ||
| /** | ||
| * The state if the current dock entry | ||
| */ | ||
| current: DockEntryState; | ||
| } | ||
| interface DockClientScriptCurrent { | ||
| /** | ||
| * The dock entry info of the current dock item | ||
| */ | ||
| entryMeta: DevToolsDockEntry; | ||
| /** | ||
| * The current state of the dock | ||
| */ | ||
| state: 'active' | 'inactive'; | ||
| /** | ||
| * The panel element to mount into, when the entry type is `custom-render` | ||
| */ | ||
| elPanel?: HTMLDivElement | null; | ||
| /** | ||
| * The iframe element to mount into, when the entry type is `iframe` | ||
| */ | ||
| elIframe?: HTMLIFrameElement | null; | ||
| /** | ||
| * The dock icon element | ||
| */ | ||
| elDockIcon?: HTMLDivElement | null; | ||
| } | ||
| //#endregion | ||
| export { DevToolsDockHost as A, DevToolsNodeContext as C, DevToolsDockEntry as D, ClientScriptEntry as E, EntriesToObject as F, Thenable as I, DevToolsRpcClientFunctions as L, DevToolsViewCustomRender as M, DevToolsViewHost as N, DevToolsDockEntryBase as O, DevToolsViewIframe as P, DevToolsRpcServerFunctions as R, DevToolsCapabilities as S, DevToolsPluginOptions as T, RpcFunctionDefinition as _, DockPanelStorage as a, RpcFunctionsHost as b, DocksPanelContext as c, getDevToolsRpcClient as d, PluginWithDevTools as f, RpcDefinitionsToFunctions as g, RpcDefinitionsFilter as h, DockEntryState as i, DevToolsViewAction as j, DevToolsDockEntryCategory as k, DevToolsRpcClient as l, BirpcReturn$1 as m, DockClientScriptCurrent as n, DocksContext as o, BirpcFn as p, DockClientType as r, DocksEntriesContext as s, DockClientScriptContext as t, DevToolsRpcClientOptions as u, RpcFunctionSetupResult as v, DevToolsNodeUtils as w, ConnectionMeta as x, RpcFunctionType as y }; |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1
-50%14779
-0.85%5
25%+ Added
+ Added
+ Added
- Removed