@visulima/dev-toolbar 1.0.0-alpha.13 → 1.0.0-alpha.15
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/CHANGELOG.md +14 -0
- package/LICENSE.md +21 -0
- package/dist/apps/a11y/index.d.ts +3 -2
- package/dist/apps/a11y/index.js +1 -1
- package/dist/apps/annotations/index.d.ts +3 -2
- package/dist/apps/annotations/index.js +1 -1
- package/dist/apps/assets/index.d.ts +3 -2
- package/dist/apps/assets/index.js +1 -1
- package/dist/apps/inspector/index.d.ts +3 -2
- package/dist/apps/inspector/index.js +1 -1
- package/dist/apps/module-graph/index.d.ts +3 -2
- package/dist/apps/module-graph/index.js +1 -1
- package/dist/apps/performance/index.d.ts +3 -2
- package/dist/apps/performance/index.js +1 -1
- package/dist/apps/seo/index.d.ts +3 -2
- package/dist/apps/seo/index.js +1 -1
- package/dist/apps/settings/index.d.ts +3 -2
- package/dist/apps/settings/index.js +1 -1
- package/dist/apps/tailwind/index.d.ts +3 -2
- package/dist/apps/timeline/index.d.ts +3 -2
- package/dist/apps/timeline/index.js +1 -1
- package/dist/apps/vite-config/index.d.ts +3 -2
- package/dist/apps/vite-config/index.js +1 -1
- package/dist/client/overlay.d.ts +1 -1
- package/dist/index.d.ts +143 -8
- package/dist/mcp/server.d.ts +2 -12
- package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
- package/dist/packem_shared/global-api.d-DG2WYakl.d.ts +547 -0
- package/dist/packem_shared/{sharedToolbarStylesheet-CaTdYhVe.js → sharedToolbarStylesheet-Bx1muJAh.js} +1 -1
- package/dist/toolbar/index.d.ts +152 -48
- package/dist/toolbar/index.js +1 -1
- package/dist/ui/index.d.ts +382 -18
- package/dist/vite-plugin.d.ts +155 -146
- package/package.json +6 -6
- package/dist/apps/a11y/a11y-app.d.ts +0 -4
- package/dist/apps/a11y/a11y-store.d.ts +0 -42
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -10
- package/dist/apps/annotations/annotations-app.d.ts +0 -4
- package/dist/apps/assets/assets-app.d.ts +0 -4
- package/dist/apps/inspector/a11y-capture.d.ts +0 -12
- package/dist/apps/inspector/annotation-overlay.d.ts +0 -55
- package/dist/apps/inspector/annotation-settings.d.ts +0 -33
- package/dist/apps/inspector/element-utils.d.ts +0 -115
- package/dist/apps/inspector/freeze-animations.d.ts +0 -22
- package/dist/apps/inspector/inspector-app.d.ts +0 -14
- package/dist/apps/inspector/rulers.d.ts +0 -14
- package/dist/apps/inspector/theme-palette.d.ts +0 -34
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -4
- package/dist/apps/performance/performance-app.d.ts +0 -4
- package/dist/apps/performance/performance-tooltip.d.ts +0 -4
- package/dist/apps/seo/seo-app.d.ts +0 -4
- package/dist/apps/settings/settings-app.d.ts +0 -4
- package/dist/apps/tailwind/tailwind-app.d.ts +0 -4
- package/dist/apps/timeline/timeline-app.d.ts +0 -4
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -4
- package/dist/hooks/create-hook.d.ts +0 -12
- package/dist/hooks/events.d.ts +0 -7
- package/dist/hooks/global-hook.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -6
- package/dist/performance/monitor.d.ts +0 -116
- package/dist/rpc/client.d.ts +0 -9
- package/dist/rpc/functions/annotations.d.ts +0 -28
- package/dist/rpc/functions/assets.d.ts +0 -16
- package/dist/rpc/functions/module-graph.d.ts +0 -17
- package/dist/rpc/functions/open-in-editor.d.ts +0 -16
- package/dist/rpc/functions/tailwind-config.d.ts +0 -15
- package/dist/rpc/functions/vite-config.d.ts +0 -83
- package/dist/rpc/server.d.ts +0 -15
- package/dist/store/annotation-store.d.ts +0 -41
- package/dist/timeline/capture.d.ts +0 -8
- package/dist/timeline/index.d.ts +0 -8
- package/dist/timeline/store.d.ts +0 -42
- package/dist/toolbar/app-manager.d.ts +0 -104
- package/dist/toolbar/components/app-button.d.ts +0 -18
- package/dist/toolbar/components/app-canvas.d.ts +0 -12
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -15
- package/dist/toolbar/components/index.d.ts +0 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
- package/dist/toolbar/components/toolbar-bar.d.ts +0 -9
- package/dist/toolbar/components/toolbar-container.d.ts +0 -49
- package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
- package/dist/toolbar/context/index.d.ts +0 -2
- package/dist/toolbar/context/toolbar-context.d.ts +0 -107
- package/dist/toolbar/global-api.d.ts +0 -24
- package/dist/toolbar/helpers.d.ts +0 -8
- package/dist/toolbar/hooks/index.d.ts +0 -10
- package/dist/toolbar/hooks/use-apps.d.ts +0 -15
- package/dist/toolbar/hooks/use-frame-state.d.ts +0 -110
- package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
- package/dist/toolbar/hooks/use-position.d.ts +0 -24
- package/dist/toolbar/hooks/use-theme.d.ts +0 -15
- package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
- package/dist/toolbar/settings.d.ts +0 -17
- package/dist/toolbar/stylesheet.d.ts +0 -3
- package/dist/toolbar/utils/index.d.ts +0 -12
- package/dist/types/annotations.d.ts +0 -156
- package/dist/types/app.d.ts +0 -175
- package/dist/types/global-api.d.ts +0 -91
- package/dist/types/hooks.d.ts +0 -86
- package/dist/types/index.d.ts +0 -13
- package/dist/types/messaging.d.ts +0 -43
- package/dist/types/rpc.d.ts +0 -137
- package/dist/types/timeline.d.ts +0 -62
- package/dist/types/toolbar.d.ts +0 -56
- package/dist/ui/components/alert.d.ts +0 -19
- package/dist/ui/components/badge.d.ts +0 -9
- package/dist/ui/components/button.d.ts +0 -11
- package/dist/ui/components/card.d.ts +0 -16
- package/dist/ui/components/icon.d.ts +0 -19
- package/dist/ui/components/input.d.ts +0 -7
- package/dist/ui/components/label.d.ts +0 -7
- package/dist/ui/components/popover.d.ts +0 -27
- package/dist/ui/components/progress.d.ts +0 -7
- package/dist/ui/components/select.d.ts +0 -54
- package/dist/ui/components/separator.d.ts +0 -8
- package/dist/ui/components/skeleton.d.ts +0 -6
- package/dist/ui/components/switch.d.ts +0 -11
- package/dist/ui/components/tabs.d.ts +0 -28
- package/dist/ui/components/textarea.d.ts +0 -7
- package/dist/ui/components/tooltip.d.ts +0 -19
- package/dist/vite/inject-source.d.ts +0 -24
- package/dist/vite/matcher.d.ts +0 -6
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { D as DevToolbarApp, T as ToolbarSettings } from "./app.d-SmKEDxsI.js";
|
|
2
|
+
import { ViteDevServer } from 'vite';
|
|
3
|
+
/**
|
|
4
|
+
* Severity levels for timeline events.
|
|
5
|
+
*/
|
|
6
|
+
type TimelineEventLevel = "info" | "warning" | "error";
|
|
7
|
+
/**
|
|
8
|
+
* A single captured event displayed in the timeline panel.
|
|
9
|
+
*/
|
|
10
|
+
interface TimelineEvent {
|
|
11
|
+
/**
|
|
12
|
+
* Optional event data
|
|
13
|
+
*/
|
|
14
|
+
data?: Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional duration (milliseconds)
|
|
17
|
+
*/
|
|
18
|
+
duration?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Unique event ID
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Event level
|
|
25
|
+
*/
|
|
26
|
+
level?: TimelineEventLevel;
|
|
27
|
+
/**
|
|
28
|
+
* Optional subtitle
|
|
29
|
+
*/
|
|
30
|
+
subtitle?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Timestamp (milliseconds since epoch)
|
|
33
|
+
*/
|
|
34
|
+
time: number;
|
|
35
|
+
/**
|
|
36
|
+
* Event title
|
|
37
|
+
*/
|
|
38
|
+
title: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A named group that holds related timeline events.
|
|
42
|
+
*/
|
|
43
|
+
interface TimelineGroup {
|
|
44
|
+
/**
|
|
45
|
+
* Group color (hex or CSS color)
|
|
46
|
+
*/
|
|
47
|
+
color?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Events in this group
|
|
50
|
+
*/
|
|
51
|
+
events: TimelineEvent[];
|
|
52
|
+
/**
|
|
53
|
+
* Group ID
|
|
54
|
+
*/
|
|
55
|
+
id: string;
|
|
56
|
+
/**
|
|
57
|
+
* Group label
|
|
58
|
+
*/
|
|
59
|
+
label: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Default timeline groups
|
|
63
|
+
*/
|
|
64
|
+
declare const DEFAULT_TIMELINE_GROUPS: ReadonlyArray<TimelineGroup>;
|
|
65
|
+
/**
|
|
66
|
+
* Hook event definitions
|
|
67
|
+
*/
|
|
68
|
+
interface HookEvents {
|
|
69
|
+
[key: string]: (...args: any[]) => void;
|
|
70
|
+
/**
|
|
71
|
+
* App error occurred.
|
|
72
|
+
* @param error Error object.
|
|
73
|
+
* @param appId Optional app ID where error occurred.
|
|
74
|
+
*/
|
|
75
|
+
"app:error": (error: Error, appId?: string) => void;
|
|
76
|
+
/**
|
|
77
|
+
* DevTools closed.
|
|
78
|
+
*/
|
|
79
|
+
"devtools:close": () => void;
|
|
80
|
+
/**
|
|
81
|
+
* DevTools initialized.
|
|
82
|
+
*/
|
|
83
|
+
"devtools:init": () => void;
|
|
84
|
+
/**
|
|
85
|
+
* DevTools opened.
|
|
86
|
+
* @param appId ID of the opened app.
|
|
87
|
+
*/
|
|
88
|
+
"devtools:open": (appId: string) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Timeline event added.
|
|
91
|
+
* @param event Timeline event.
|
|
92
|
+
*/
|
|
93
|
+
"timeline:event": (event: TimelineEvent) => void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Dev toolbar hook interface.
|
|
97
|
+
* Exposed as window.__DEV_TOOLBAR_HOOK__
|
|
98
|
+
*/
|
|
99
|
+
interface DevToolbarHook {
|
|
100
|
+
/**
|
|
101
|
+
* Adds a timeline event.
|
|
102
|
+
* @param groupId Timeline group ID.
|
|
103
|
+
* @param event Timeline event.
|
|
104
|
+
*/
|
|
105
|
+
addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Emits an event.
|
|
108
|
+
* @param event Event name.
|
|
109
|
+
* @param args Event arguments.
|
|
110
|
+
*/
|
|
111
|
+
emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Unsubscribes from an event.
|
|
114
|
+
* @param event Event name.
|
|
115
|
+
* @param handler Optional specific handler to remove.
|
|
116
|
+
*/
|
|
117
|
+
off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Subscribes to an event.
|
|
120
|
+
* @param event Event name.
|
|
121
|
+
* @param handler Event handler.
|
|
122
|
+
* @returns Unsubscribe function.
|
|
123
|
+
*/
|
|
124
|
+
on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
|
|
125
|
+
/**
|
|
126
|
+
* Subscribes to an event once.
|
|
127
|
+
* @param event Event name.
|
|
128
|
+
* @param handler Event handler.
|
|
129
|
+
*/
|
|
130
|
+
once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Registers a custom app.
|
|
133
|
+
* @param app App definition.
|
|
134
|
+
*/
|
|
135
|
+
registerApp: (app: DevToolbarApp) => void;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Global hook declaration
|
|
139
|
+
*/
|
|
140
|
+
declare global {
|
|
141
|
+
interface Window {
|
|
142
|
+
/**
|
|
143
|
+
* Dev toolbar hook for library integrations.
|
|
144
|
+
*/
|
|
145
|
+
__DEV_TOOLBAR_HOOK__?: DevToolbarHook;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
interface StaticAsset {
|
|
149
|
+
/** Last-modified timestamp (ms since epoch) */
|
|
150
|
+
mtime: number;
|
|
151
|
+
/** Public URL path (e.g. "/images/logo.png") */
|
|
152
|
+
publicPath: string;
|
|
153
|
+
/** File size in bytes */
|
|
154
|
+
size: number;
|
|
155
|
+
/** Asset type category */
|
|
156
|
+
type: "audio" | "font" | "image" | "other" | "text" | "video";
|
|
157
|
+
}
|
|
158
|
+
interface SerializableModuleNode {
|
|
159
|
+
id: string;
|
|
160
|
+
importerCount: number;
|
|
161
|
+
importerUrls: string[];
|
|
162
|
+
url: string;
|
|
163
|
+
}
|
|
164
|
+
interface TailwindConfigResult {
|
|
165
|
+
/** CSS files that \@import tailwindcss */
|
|
166
|
+
cssFiles: string[];
|
|
167
|
+
/** User-defined \@theme overrides/extensions */
|
|
168
|
+
customTheme: Record<string, string>;
|
|
169
|
+
/** Full default Tailwind theme tokens */
|
|
170
|
+
defaultTheme: Record<string, string>;
|
|
171
|
+
/** Detected Tailwind version */
|
|
172
|
+
version: "v3" | "v4" | "unknown";
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Annotation intent — describes what the user wants to communicate.
|
|
176
|
+
*/
|
|
177
|
+
type AnnotationIntent = "approve" | "change" | "fix" | "question";
|
|
178
|
+
/**
|
|
179
|
+
* Annotation severity — how urgent or important the annotation is.
|
|
180
|
+
*/
|
|
181
|
+
type AnnotationSeverity = "blocking" | "important" | "suggestion";
|
|
182
|
+
/**
|
|
183
|
+
* Annotation status — lifecycle state.
|
|
184
|
+
*/
|
|
185
|
+
type AnnotationStatus = "acknowledged" | "dismissed" | "pending" | "resolved";
|
|
186
|
+
/**
|
|
187
|
+
* A single message in a conversation thread attached to an annotation.
|
|
188
|
+
*/
|
|
189
|
+
interface ThreadMessage {
|
|
190
|
+
/** Message text */
|
|
191
|
+
content: string;
|
|
192
|
+
/** Unique message identifier */
|
|
193
|
+
id?: string;
|
|
194
|
+
/** Who wrote it — e.g. "human", "agent", or a specific agent name */
|
|
195
|
+
role: string;
|
|
196
|
+
/** ISO 8601 timestamp */
|
|
197
|
+
timestamp: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Bounding box of the annotated element relative to the viewport.
|
|
201
|
+
*/
|
|
202
|
+
interface BoundingBox {
|
|
203
|
+
height: number;
|
|
204
|
+
width: number;
|
|
205
|
+
x: number;
|
|
206
|
+
y: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Detected framework component information.
|
|
210
|
+
*/
|
|
211
|
+
interface FrameworkContext {
|
|
212
|
+
/** Component name */
|
|
213
|
+
componentName?: string;
|
|
214
|
+
/** Full component stack (e.g. ["App", "Layout", "Header", "Button"]) */
|
|
215
|
+
componentStack?: string[];
|
|
216
|
+
/** Additional framework-specific data (e.g. props) */
|
|
217
|
+
data?: Record<string, unknown>;
|
|
218
|
+
/** Framework identifier (react, vue, svelte, etc.) */
|
|
219
|
+
framework: string;
|
|
220
|
+
/** Source file path */
|
|
221
|
+
sourceFile?: string;
|
|
222
|
+
/** Source line number */
|
|
223
|
+
sourceLine?: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Captured accessibility attributes for an element.
|
|
227
|
+
*/
|
|
228
|
+
interface AccessibilityInfo {
|
|
229
|
+
/** aria-describedby content */
|
|
230
|
+
ariaDescribedBy?: string;
|
|
231
|
+
/** aria-label value */
|
|
232
|
+
ariaLabel?: string;
|
|
233
|
+
/** Whether the element is focusable */
|
|
234
|
+
focusable: boolean;
|
|
235
|
+
/** ARIA role (explicit or implicit) */
|
|
236
|
+
role?: string;
|
|
237
|
+
/** tabindex value */
|
|
238
|
+
tabindex?: number;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* A visual annotation placed on a page element during development.
|
|
242
|
+
* Stored in `.devtoolbar/annotations.json`.
|
|
243
|
+
*/
|
|
244
|
+
interface Annotation {
|
|
245
|
+
/** Captured accessibility attributes */
|
|
246
|
+
accessibility?: AccessibilityInfo;
|
|
247
|
+
/** Element bounding box at annotation time */
|
|
248
|
+
boundingBox?: BoundingBox;
|
|
249
|
+
/** User feedback / description */
|
|
250
|
+
comment: string;
|
|
251
|
+
/** Key computed CSS properties for forensic context */
|
|
252
|
+
computedStyles?: string;
|
|
253
|
+
/** ISO 8601 creation timestamp */
|
|
254
|
+
createdAt: string;
|
|
255
|
+
/** CSS classes on the annotated element (module hashes cleaned) */
|
|
256
|
+
cssClasses?: string;
|
|
257
|
+
/** Bounding boxes for multi-select annotations */
|
|
258
|
+
elementBoundingBoxes?: BoundingBox[];
|
|
259
|
+
/** Human-readable element label (e.g. 'button "Submit"') */
|
|
260
|
+
elementLabel?: string;
|
|
261
|
+
/** CSS selector path to the element */
|
|
262
|
+
elementPath?: string;
|
|
263
|
+
/** HTML tag name of the annotated element */
|
|
264
|
+
elementTag: string;
|
|
265
|
+
/** Detected framework component context */
|
|
266
|
+
frameworkContext?: FrameworkContext;
|
|
267
|
+
/** Full DOM ancestry path (e.g. "body > main > article > p") */
|
|
268
|
+
fullPath?: string;
|
|
269
|
+
/** Unique identifier (crypto.randomUUID) */
|
|
270
|
+
id: string;
|
|
271
|
+
/** What the user wants — fix, change, question, or approve */
|
|
272
|
+
intent: AnnotationIntent;
|
|
273
|
+
/** Whether the element has fixed/sticky positioning */
|
|
274
|
+
isFixed?: boolean;
|
|
275
|
+
/** Whether this is a multi-select (drag) annotation */
|
|
276
|
+
isMultiSelect?: boolean;
|
|
277
|
+
/** Sibling elements for spatial context */
|
|
278
|
+
nearbyElements?: string;
|
|
279
|
+
/** Text near the annotated element for additional context */
|
|
280
|
+
nearbyText?: string;
|
|
281
|
+
/** ISO 8601 resolution timestamp */
|
|
282
|
+
resolvedAt?: string;
|
|
283
|
+
/** Who resolved it — "human" or "agent" (or a specific agent name) */
|
|
284
|
+
resolvedBy?: string;
|
|
285
|
+
/** Path to screenshot file relative to .devtoolbar/ (e.g. "screenshots/<id>.png") */
|
|
286
|
+
screenshot?: string;
|
|
287
|
+
/** Text the user had selected when annotating */
|
|
288
|
+
selectedText?: string;
|
|
289
|
+
/** Severity level */
|
|
290
|
+
severity: AnnotationSeverity;
|
|
291
|
+
/** Source file location from data-vdt-source (file:line:col) */
|
|
292
|
+
source?: string;
|
|
293
|
+
/** Lifecycle status */
|
|
294
|
+
status: AnnotationStatus;
|
|
295
|
+
/** Conversation thread (human ↔ AI agent) */
|
|
296
|
+
thread?: ThreadMessage[];
|
|
297
|
+
/** ISO 8601 last-updated timestamp */
|
|
298
|
+
updatedAt: string;
|
|
299
|
+
/** Page URL where the annotation was created */
|
|
300
|
+
url: string;
|
|
301
|
+
/** Click X as percentage of viewport width (0-100) — survives resize */
|
|
302
|
+
x: number;
|
|
303
|
+
/**
|
|
304
|
+
* Click Y as absolute page position (pixels from document top) — survives scroll.
|
|
305
|
+
* For fixed/sticky elements, Y is viewport-relative instead.
|
|
306
|
+
*/
|
|
307
|
+
y: number;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Data required to create a new annotation (server-generated fields omitted).
|
|
311
|
+
*/
|
|
312
|
+
type CreateAnnotationData = Omit<Annotation, "createdAt" | "id" | "resolvedAt" | "resolvedBy" | "status" | "thread" | "updatedAt">;
|
|
313
|
+
/**
|
|
314
|
+
* Fields that can be updated on an existing annotation.
|
|
315
|
+
*/
|
|
316
|
+
interface UpdateAnnotationData {
|
|
317
|
+
/** Updated comment text */
|
|
318
|
+
comment?: string;
|
|
319
|
+
/** Updated intent */
|
|
320
|
+
intent?: AnnotationIntent;
|
|
321
|
+
/** Who resolved the annotation */
|
|
322
|
+
resolvedBy?: string;
|
|
323
|
+
/** Updated severity */
|
|
324
|
+
severity?: AnnotationSeverity;
|
|
325
|
+
/** New status */
|
|
326
|
+
status?: AnnotationStatus;
|
|
327
|
+
/** Append a thread message */
|
|
328
|
+
threadMessage?: ThreadMessage;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Server-side RPC functions
|
|
332
|
+
* These can be called from the client
|
|
333
|
+
*/
|
|
334
|
+
interface ServerFunctions {
|
|
335
|
+
/**
|
|
336
|
+
* Extension point for custom server functions
|
|
337
|
+
*/
|
|
338
|
+
[key: string]: (...args: any[]) => Promise<any>;
|
|
339
|
+
/**
|
|
340
|
+
* Create a new annotation
|
|
341
|
+
* @param data Annotation data (id, timestamps, status are generated server-side)
|
|
342
|
+
*/
|
|
343
|
+
createAnnotation: (data: CreateAnnotationData) => Promise<Annotation>;
|
|
344
|
+
/**
|
|
345
|
+
* Delete an annotation and its screenshot
|
|
346
|
+
* @param id Annotation ID
|
|
347
|
+
*/
|
|
348
|
+
deleteAnnotation: (id: string) => Promise<boolean>;
|
|
349
|
+
/**
|
|
350
|
+
* Get all annotations
|
|
351
|
+
*/
|
|
352
|
+
getAnnotations: () => Promise<Annotation[]>;
|
|
353
|
+
/**
|
|
354
|
+
* Get module dependency graph
|
|
355
|
+
*/
|
|
356
|
+
getModuleGraph: () => Promise<SerializableModuleNode[]>;
|
|
357
|
+
/**
|
|
358
|
+
* Get a screenshot as a base64 data URL
|
|
359
|
+
* @param annotationId Annotation ID
|
|
360
|
+
*/
|
|
361
|
+
getScreenshot: (annotationId: string) => Promise<string | null>;
|
|
362
|
+
/**
|
|
363
|
+
* Get all static assets from the public directory
|
|
364
|
+
*/
|
|
365
|
+
getStaticAssets: () => Promise<StaticAsset[]>;
|
|
366
|
+
/**
|
|
367
|
+
* Get full Tailwind CSS theme (default + user overrides)
|
|
368
|
+
*/
|
|
369
|
+
getTailwindConfig: () => Promise<TailwindConfigResult>;
|
|
370
|
+
/**
|
|
371
|
+
* Get Vite configuration
|
|
372
|
+
*/
|
|
373
|
+
getViteConfig: () => Promise<Record<string, any>>;
|
|
374
|
+
/**
|
|
375
|
+
* Open file in editor
|
|
376
|
+
* @param file File path
|
|
377
|
+
* @param line Line number (1-based)
|
|
378
|
+
* @param column Column number (1-based)
|
|
379
|
+
* @param editor Editor override (e.g. "code", "webstorm") — empty string means auto-detect
|
|
380
|
+
*/
|
|
381
|
+
openInEditor: (file: string, line?: number, column?: number, editor?: string) => Promise<void>;
|
|
382
|
+
/**
|
|
383
|
+
* Read file contents
|
|
384
|
+
* @param path File path
|
|
385
|
+
*/
|
|
386
|
+
readFile: (path: string) => Promise<string>;
|
|
387
|
+
/**
|
|
388
|
+
* Save a screenshot for an annotation
|
|
389
|
+
* @param annotationId Annotation ID
|
|
390
|
+
* @param dataUrl Base64 data URL (PNG, JPEG, WebP, or SVG)
|
|
391
|
+
* @returns Relative path within .devtoolbar/
|
|
392
|
+
*/
|
|
393
|
+
saveScreenshot: (annotationId: string, dataUrl: string) => Promise<string>;
|
|
394
|
+
/**
|
|
395
|
+
* Update an existing annotation
|
|
396
|
+
* @param id Annotation ID
|
|
397
|
+
* @param data Fields to update
|
|
398
|
+
*/
|
|
399
|
+
updateAnnotation: (id: string, data: UpdateAnnotationData) => Promise<Annotation | null>;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Client-side RPC functions
|
|
403
|
+
* These can be called from the server
|
|
404
|
+
*/
|
|
405
|
+
interface ClientFunctions {
|
|
406
|
+
[key: string]: (...args: any[]) => void;
|
|
407
|
+
/**
|
|
408
|
+
* Notify client of config change
|
|
409
|
+
* @param config New Vite config
|
|
410
|
+
*/
|
|
411
|
+
onConfigChange: (config: Record<string, unknown>) => void;
|
|
412
|
+
/**
|
|
413
|
+
* Notify client of HMR update
|
|
414
|
+
* @param payload HMR payload
|
|
415
|
+
*/
|
|
416
|
+
onHMRUpdate: (payload: unknown) => void;
|
|
417
|
+
/**
|
|
418
|
+
* Notify client of module update
|
|
419
|
+
* @param module Updated module node
|
|
420
|
+
*/
|
|
421
|
+
onModuleUpdate: (module: SerializableModuleNode) => void;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* RPC context for server-side
|
|
425
|
+
*/
|
|
426
|
+
interface ServerRPCContext {
|
|
427
|
+
/**
|
|
428
|
+
* Call a client function
|
|
429
|
+
* @param name Function name
|
|
430
|
+
* @param args Function arguments
|
|
431
|
+
*/
|
|
432
|
+
callClient: <K extends keyof ClientFunctions>(name: K, ...args: Parameters<ClientFunctions[K]>) => void;
|
|
433
|
+
/**
|
|
434
|
+
* Register a server function
|
|
435
|
+
* @param name Function name
|
|
436
|
+
* @param fn Function implementation
|
|
437
|
+
*/
|
|
438
|
+
registerFunction: <K extends keyof ServerFunctions>(name: K, function_: ServerFunctions[K]) => void;
|
|
439
|
+
/**
|
|
440
|
+
* Vite dev server instance
|
|
441
|
+
*/
|
|
442
|
+
server: ViteDevServer;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* RPC context for client-side
|
|
446
|
+
*/
|
|
447
|
+
interface ClientRPCContext {
|
|
448
|
+
/**
|
|
449
|
+
* Call a server function
|
|
450
|
+
* @param name Function name
|
|
451
|
+
* @param args Function arguments
|
|
452
|
+
*/
|
|
453
|
+
callServer: <K extends keyof ServerFunctions>(name: K, ...args: Parameters<ServerFunctions[K]>) => Promise<ReturnType<ServerFunctions[K]>>;
|
|
454
|
+
/**
|
|
455
|
+
* Register a client function
|
|
456
|
+
* @param name Function name
|
|
457
|
+
* @param function_ Function implementation
|
|
458
|
+
*/
|
|
459
|
+
registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Global DevTools API interface.
|
|
463
|
+
* Exposed as window.__VISULIMA_DEVTOOLS__
|
|
464
|
+
*/
|
|
465
|
+
interface VisulimaDevTools {
|
|
466
|
+
/**
|
|
467
|
+
* Clears notification for an app.
|
|
468
|
+
*/
|
|
469
|
+
clearNotification: (appId: string) => void;
|
|
470
|
+
/**
|
|
471
|
+
* Closes the currently active app.
|
|
472
|
+
*/
|
|
473
|
+
closeApp: () => Promise<void>;
|
|
474
|
+
/**
|
|
475
|
+
* Gets the currently active app ID.
|
|
476
|
+
*/
|
|
477
|
+
getActiveApp: () => string | undefined;
|
|
478
|
+
/**
|
|
479
|
+
* Gets all registered apps.
|
|
480
|
+
*/
|
|
481
|
+
getApps: () => DevToolbarApp[];
|
|
482
|
+
/**
|
|
483
|
+
* Gets current toolbar settings.
|
|
484
|
+
*/
|
|
485
|
+
getSettings: () => ToolbarSettings;
|
|
486
|
+
/**
|
|
487
|
+
* Hides the toolbar.
|
|
488
|
+
*/
|
|
489
|
+
hide: () => void;
|
|
490
|
+
/**
|
|
491
|
+
* Hook instance for event subscriptions.
|
|
492
|
+
*/
|
|
493
|
+
hook: DevToolbarHook;
|
|
494
|
+
/**
|
|
495
|
+
* Shows a notification for an app.
|
|
496
|
+
*/
|
|
497
|
+
notify: (appId: string, level: "info" | "warning" | "error") => void;
|
|
498
|
+
/**
|
|
499
|
+
* Opens an app by ID.
|
|
500
|
+
*/
|
|
501
|
+
openApp: (appId: string) => Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Registers a custom app.
|
|
504
|
+
*/
|
|
505
|
+
registerApp: (app: DevToolbarApp) => void;
|
|
506
|
+
/**
|
|
507
|
+
* RPC client for calling server functions.
|
|
508
|
+
*/
|
|
509
|
+
rpc: ServerFunctions;
|
|
510
|
+
/**
|
|
511
|
+
* Directly sets the active state of an action button without invoking callbacks.
|
|
512
|
+
* Useful for deactivating a button from async work running outside the toolbar.
|
|
513
|
+
*/
|
|
514
|
+
setAppActive: (appId: string, active: boolean) => void;
|
|
515
|
+
/**
|
|
516
|
+
* Shows the toolbar.
|
|
517
|
+
*/
|
|
518
|
+
show: () => void;
|
|
519
|
+
/**
|
|
520
|
+
* Toggles toolbar visibility.
|
|
521
|
+
*/
|
|
522
|
+
toggle: () => void;
|
|
523
|
+
/**
|
|
524
|
+
* Unregisters an app by ID.
|
|
525
|
+
*/
|
|
526
|
+
unregisterApp: (appId: string) => void;
|
|
527
|
+
/**
|
|
528
|
+
* Updates toolbar settings.
|
|
529
|
+
*/
|
|
530
|
+
updateSettings: (settings: Partial<ToolbarSettings>) => void;
|
|
531
|
+
/**
|
|
532
|
+
* Package version.
|
|
533
|
+
*/
|
|
534
|
+
version: string;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Global API declaration
|
|
538
|
+
*/
|
|
539
|
+
declare global {
|
|
540
|
+
interface Window {
|
|
541
|
+
/**
|
|
542
|
+
* Visulima DevTools global API.
|
|
543
|
+
*/
|
|
544
|
+
__VISULIMA_DEVTOOLS__?: VisulimaDevTools;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
export { AccessibilityInfo as A, BoundingBox as B, ClientFunctions as C, DevToolbarHook as D, FrameworkContext as F, HookEvents as H, ServerFunctions as S, TimelineEvent as T, UpdateAnnotationData as U, VisulimaDevTools as V, ClientRPCContext as a, ServerRPCContext as b, TimelineGroup as c, Annotation as d, AnnotationIntent as e, AnnotationSeverity as f, AnnotationStatus as g, CreateAnnotationData as h, DEFAULT_TIMELINE_GROUPS as i, ThreadMessage as j, TimelineEventLevel as k };
|