@rinova/devtools 0.0.0-stage → 0.11.0

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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -2
  3. package/dist/core/config-store.d.ts +26 -0
  4. package/dist/core/console-capture.d.ts +23 -0
  5. package/dist/core/emitter.d.ts +10 -0
  6. package/dist/core/network-capture.d.ts +49 -0
  7. package/dist/core/runtime.d.ts +58 -0
  8. package/dist/core/storage.d.ts +20 -0
  9. package/dist/create-devtools.d.ts +8 -0
  10. package/dist/icons.d.ts +4 -0
  11. package/dist/index.d.ts +45 -0
  12. package/dist/index.js +6838 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/plugins/actions.d.ts +2 -0
  15. package/dist/plugins/config.d.ts +2 -0
  16. package/dist/plugins/console.d.ts +2 -0
  17. package/dist/plugins/index.d.ts +5 -0
  18. package/dist/plugins/master-detail.d.ts +65 -0
  19. package/dist/plugins/network.d.ts +2 -0
  20. package/dist/plugins/settings.d.ts +2 -0
  21. package/dist/plugins/storage.d.ts +2 -0
  22. package/dist/plugins/table-state.d.ts +11 -0
  23. package/dist/types.d.ts +319 -0
  24. package/dist/ui/choice-groups.d.ts +28 -0
  25. package/dist/ui/code-editor.d.ts +15 -0
  26. package/dist/ui/component.d.ts +20 -0
  27. package/dist/ui/date-picker.d.ts +18 -0
  28. package/dist/ui/dialog.d.ts +27 -0
  29. package/dist/ui/dom.d.ts +66 -0
  30. package/dist/ui/form-controls.d.ts +109 -0
  31. package/dist/ui/inspectors.d.ts +32 -0
  32. package/dist/ui/layout-watch.d.ts +10 -0
  33. package/dist/ui/layout.d.ts +43 -0
  34. package/dist/ui/maximize.d.ts +30 -0
  35. package/dist/ui/overlays.d.ts +54 -0
  36. package/dist/ui/page-layer.d.ts +9 -0
  37. package/dist/ui/popup.d.ts +26 -0
  38. package/dist/ui/select.d.ts +43 -0
  39. package/dist/ui/shell-chrome.d.ts +28 -0
  40. package/dist/ui/shell.d.ts +157 -0
  41. package/dist/ui/splitter.d.ts +16 -0
  42. package/dist/ui/table.d.ts +79 -0
  43. package/dist/ui/tabs.d.ts +20 -0
  44. package/dist/utils/curl.d.ts +4 -0
  45. package/dist/utils/format.d.ts +15 -0
  46. package/dist/version.d.ts +1 -0
  47. package/package.json +51 -4
@@ -0,0 +1,109 @@
1
+ import { type ButtonOptions } from './dom.js';
2
+ import type { IconName } from '../types.js';
3
+ /** 两段式确认倒计时,与快捷操作一致 */
4
+ export declare const BUTTON_CONFIRM_MS = 2600;
5
+ export interface ButtonProps extends ButtonOptions {
6
+ label: string;
7
+ /** 为 true 时使用默认文案;为字符串时使用自定义确认文案 */
8
+ confirm?: boolean | string;
9
+ }
10
+ export declare const Button: import("./component.js").ComponentDef<ButtonProps, {
11
+ click: MouseEvent;
12
+ }, HTMLButtonElement>;
13
+ export interface InputProps {
14
+ value?: string;
15
+ defaultValue?: string;
16
+ type?: 'text' | 'search' | 'password' | 'email' | 'url' | 'tel' | 'number';
17
+ placeholder?: string;
18
+ disabled?: boolean;
19
+ readonly?: boolean;
20
+ clearable?: boolean;
21
+ mono?: boolean;
22
+ prefixIcon?: IconName;
23
+ size?: 'sm' | 'md';
24
+ ariaLabel?: string;
25
+ onInput?: (value: string) => void;
26
+ onChange?: (value: string) => void;
27
+ onEnter?: (value: string) => void;
28
+ }
29
+ type InputEvents = {
30
+ input: string;
31
+ change: string;
32
+ enter: string;
33
+ };
34
+ export declare const Input: import("./component.js").ComponentDef<InputProps, InputEvents, HTMLElement>;
35
+ export interface TextareaProps {
36
+ value?: string;
37
+ defaultValue?: string;
38
+ placeholder?: string;
39
+ disabled?: boolean;
40
+ readonly?: boolean;
41
+ mono?: boolean;
42
+ rows?: number;
43
+ ariaLabel?: string;
44
+ onInput?: (value: string) => void;
45
+ onChange?: (value: string) => void;
46
+ }
47
+ type TextareaEvents = {
48
+ input: string;
49
+ change: string;
50
+ };
51
+ export declare const Textarea: import("./component.js").ComponentDef<TextareaProps, TextareaEvents, HTMLTextAreaElement>;
52
+ export interface TagProps {
53
+ text: string;
54
+ tone?: 'neutral' | 'ok' | 'warn' | 'error' | 'info';
55
+ }
56
+ export declare const Tag: import("./component.js").ComponentDef<TagProps, Record<string, never>, HTMLSpanElement>;
57
+ export interface SegmentedItem<T extends string = string> {
58
+ value: T;
59
+ label: string;
60
+ icon?: IconName;
61
+ }
62
+ export interface SegmentedProps<T extends string = string> {
63
+ items: Array<SegmentedItem<T>>;
64
+ value?: T;
65
+ defaultValue?: T;
66
+ ariaLabel?: string;
67
+ disabled?: boolean;
68
+ readonly?: boolean;
69
+ onChange?: (value: T) => void;
70
+ }
71
+ export declare const Segmented: import("./component.js").ComponentDef<SegmentedProps<string>, {
72
+ change: string;
73
+ }, HTMLElement>;
74
+ type BooleanEvent = {
75
+ change: boolean;
76
+ };
77
+ export interface SwitchProps {
78
+ ariaLabel: string;
79
+ value?: boolean;
80
+ defaultValue?: boolean;
81
+ disabled?: boolean;
82
+ readonly?: boolean;
83
+ onChange?: (value: boolean) => void;
84
+ }
85
+ export declare const Switch: import("./component.js").ComponentDef<SwitchProps, BooleanEvent, HTMLButtonElement>;
86
+ interface ChoiceProps {
87
+ label: string;
88
+ checked?: boolean;
89
+ defaultChecked?: boolean;
90
+ disabled?: boolean;
91
+ readonly?: boolean;
92
+ name?: string;
93
+ value?: string;
94
+ onChange?: (checked: boolean) => void;
95
+ }
96
+ export interface CheckboxProps extends ChoiceProps {
97
+ indeterminate?: boolean;
98
+ }
99
+ export interface RadioProps extends ChoiceProps {
100
+ name: string;
101
+ }
102
+ export declare const Checkbox: import("./component.js").ComponentDef<CheckboxProps, BooleanEvent, HTMLLabelElement>;
103
+ export declare const Radio: import("./component.js").ComponentDef<RadioProps, BooleanEvent, HTMLLabelElement>;
104
+ export declare function input(props?: InputProps): HTMLInputElement;
105
+ export declare function textarea(props?: TextareaProps): HTMLTextAreaElement;
106
+ export declare function switchControl({ value, ...props }: SwitchProps): HTMLButtonElement;
107
+ export declare function checkbox(props: CheckboxProps): HTMLLabelElement;
108
+ export declare function radio(props: RadioProps): HTMLLabelElement;
109
+ export {};
@@ -0,0 +1,32 @@
1
+ export interface CopyResult {
2
+ text: string;
3
+ ok: boolean;
4
+ }
5
+ export interface KeyValueItem {
6
+ key: string;
7
+ value: unknown;
8
+ copyable?: boolean;
9
+ render?: (value: unknown) => Node | string | number;
10
+ }
11
+ export interface KeyValueProps {
12
+ items: readonly KeyValueItem[];
13
+ columns?: number;
14
+ empty?: string;
15
+ compact?: boolean;
16
+ onCopy?: (result: CopyResult) => void;
17
+ }
18
+ export declare const KeyValue: import("./component.js").ComponentDef<KeyValueProps, {
19
+ copy: CopyResult;
20
+ }, HTMLDListElement>;
21
+ /** JsonView 超大数组按该页大小分片展开 */
22
+ export declare const JSON_VIEW_PAGE_SIZE = 100;
23
+ export interface JsonViewProps {
24
+ value: unknown;
25
+ /** Number of initially expanded levels (default 1). */
26
+ depth?: number;
27
+ collapsed?: boolean;
28
+ onCopy?: (result: CopyResult) => void;
29
+ }
30
+ export declare const JsonView: import("./component.js").ComponentDef<JsonViewProps, {
31
+ copy: CopyResult;
32
+ }, HTMLElement>;
@@ -0,0 +1,10 @@
1
+ /** 面板拖拽 / 尺寸变化时派发,供 popup 与 Dialog 重新定位或关闭 */
2
+ export declare const PANEL_MOVE_EVENT = "rdt-panel-move";
3
+ export interface LayoutWatch {
4
+ stop(): void;
5
+ }
6
+ /**
7
+ * 用 scroll(capture)、resize、ResizeObserver 和面板拖拽事件驱动回调。
8
+ * 只用一次性 rAF 合并同一帧内的多次事件,不再常驻每帧空转。
9
+ */
10
+ export declare function watchLayout(targets: Array<Element | null | undefined>, onChange: () => void): LayoutWatch;
@@ -0,0 +1,43 @@
1
+ import { type EmptyOptions, type FieldOptions } from './dom.js';
2
+ export type LayoutNode = Node | string;
3
+ export type LayoutContent = LayoutNode | readonly LayoutNode[];
4
+ type NoEvents = Record<never, never>;
5
+ declare function slot(el: HTMLElement): (value?: LayoutContent) => void;
6
+ export interface ToolbarProps {
7
+ title?: string;
8
+ content?: LayoutContent;
9
+ actions?: LayoutContent;
10
+ }
11
+ export declare const Toolbar: import("./component.js").ComponentDef<ToolbarProps, NoEvents, HTMLElement>;
12
+ export interface StatusBarProps {
13
+ status?: LayoutContent;
14
+ detail?: LayoutContent;
15
+ }
16
+ export declare const StatusBar: import("./component.js").ComponentDef<StatusBarProps, NoEvents, HTMLElement>;
17
+ export interface SectionProps {
18
+ title: string;
19
+ content?: LayoutContent;
20
+ collapsible?: boolean;
21
+ defaultOpen?: boolean;
22
+ }
23
+ export declare const Section: import("./component.js").ComponentDef<SectionProps, NoEvents, HTMLElement>;
24
+ export interface ScrollAreaProps {
25
+ content?: LayoutContent;
26
+ ariaLabel?: string;
27
+ maxHeight?: number;
28
+ }
29
+ export declare const ScrollArea: import("./component.js").ComponentDef<ScrollAreaProps, NoEvents, HTMLElement>;
30
+ export interface FieldProps extends FieldOptions {
31
+ label: string;
32
+ control?: Node;
33
+ }
34
+ export declare const Field: import("./component.js").ComponentDef<FieldProps, NoEvents, HTMLElement>;
35
+ export interface EmptyProps extends EmptyOptions {
36
+ text: string;
37
+ }
38
+ export declare const Empty: import("./component.js").ComponentDef<EmptyProps, NoEvents, HTMLElement>;
39
+ export declare const toolbar: (props: ToolbarProps) => HTMLElement;
40
+ export declare const statusBar: (props: StatusBarProps) => HTMLElement;
41
+ export declare const section: (props: SectionProps) => HTMLElement;
42
+ export declare const scrollArea: (props: ScrollAreaProps) => HTMLElement;
43
+ export { slot as createLayoutSlot };
@@ -0,0 +1,30 @@
1
+ import type { DefaultCorner } from '../types.js';
2
+ /** 视口安全边距(防越界) */
3
+ export declare const SAFE_GAP = 8;
4
+ export declare const MIN_PANEL_WIDTH = 280;
5
+ export declare const MIN_PANEL_HEIGHT = 220;
6
+ export interface PanelRect {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ export interface ViewportSize {
13
+ width: number;
14
+ height: number;
15
+ }
16
+ /**
17
+ * 放大锚定角(交互设计 6.2):
18
+ * - 停在默认角(未拖过或复位之后):锚定默认角;
19
+ * - 拖离默认角:按面板中心所在象限选最近的视口角;中心恰在中线上时水平取左、垂直取下。
20
+ */
21
+ export declare function pickMaximizeAnchor(base: PanelRect, viewport: ViewportSize, defaultCorner: DefaultCorner, docked: boolean): DefaultCorner;
22
+ /**
23
+ * 原位放大矩形(设计规范 5.2):锚定角不动,另外两边长到视口安全边距。
24
+ * - 放大前尺寸先按视口可用区域(视口减两侧安全边距)收窄,再不低于最小尺寸;与壳层 resolveDimensions 同一口径;
25
+ * - 锚点越界先夹回安全区(唯一允许移动锚点的情况);
26
+ * - 只增不减:每个方向取 max(收窄后的放大前尺寸, 可长到的尺寸);
27
+ * - 可用区域小于最小尺寸时取最小尺寸,锚定角所在一侧贴安全边距,超出部分落在对边之外;
28
+ * - 长大区域与悬浮球相交时,该方向止于悬浮球外 SAFE_GAP。
29
+ */
30
+ export declare function maximizedRect(base: PanelRect, anchor: DefaultCorner, viewport: ViewportSize, launcher: PanelRect | null): PanelRect;
@@ -0,0 +1,54 @@
1
+ import { type PopupCloseReason, type PopupPlacement } from './popup.js';
2
+ import type { IconName } from '../types.js';
3
+ type PopupEvents = {
4
+ open: undefined;
5
+ close: PopupCloseReason;
6
+ };
7
+ export interface OverlayProps {
8
+ label?: string;
9
+ trigger?: Node;
10
+ open?: boolean;
11
+ onOpenChange?: (open: boolean) => void;
12
+ placement?: PopupPlacement;
13
+ onOpen?: () => void;
14
+ onClose?: (reason: PopupCloseReason) => void;
15
+ }
16
+ export declare function resolveTrigger(props: {
17
+ label?: string;
18
+ trigger?: Node;
19
+ }, tone?: 'ghost'): {
20
+ trigger: HTMLElement;
21
+ defaultTrigger: boolean;
22
+ };
23
+ export interface TooltipProps extends OverlayProps {
24
+ text: string;
25
+ delay?: number;
26
+ maxWidth?: number;
27
+ /** 仅侧栏图标使用:指针或焦点离开即刻收起,不保留 120ms 尾巴。默认 'delayed'。 */
28
+ dismiss?: 'delayed' | 'immediate';
29
+ }
30
+ export declare const Tooltip: import("./component.js").ComponentDef<TooltipProps, PopupEvents, HTMLElement>;
31
+ export interface PopoverProps extends OverlayProps {
32
+ content?: string | Node;
33
+ ariaLabel?: string;
34
+ closeOnOutside?: boolean;
35
+ }
36
+ export declare const Popover: import("./component.js").ComponentDef<PopoverProps, PopupEvents, HTMLElement>;
37
+ export type ContextMenuItem = {
38
+ value: string;
39
+ label: string;
40
+ icon?: IconName;
41
+ danger?: boolean;
42
+ disabled?: boolean;
43
+ divider?: false;
44
+ } | {
45
+ divider: true;
46
+ };
47
+ export interface ContextMenuProps extends OverlayProps {
48
+ items: readonly ContextMenuItem[];
49
+ onSelect?: (value: string) => void;
50
+ }
51
+ export declare const ContextMenu: import("./component.js").ComponentDef<ContextMenuProps, PopupEvents & {
52
+ select: string;
53
+ }, HTMLElement>;
54
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Light-DOM host for official popups that have no `.rdt-root` / ShadowRoot to mount into. */
2
+ export declare const PAGE_OVERLAY_HOST_ID = "rdt-page-overlays";
3
+ /**
4
+ * Return the style-bearing `.rdt-root` used when `createPopup` falls back outside
5
+ * the DevTools Shadow DOM. The host is `position: fixed` and ignores pointer
6
+ * events, so opening a page-level Popover does not shove the document or
7
+ * collapse into an unthemed in-flow bar.
8
+ */
9
+ export declare function pageOverlayRoot(doc?: Document): HTMLElement;
@@ -0,0 +1,26 @@
1
+ export type PopupPlacement = 'top' | 'bottom' | 'left' | 'right' | 'auto';
2
+ export type PopupCloseReason = 'outside' | 'escape' | 'anchor-hidden' | 'program';
3
+ export interface PopupOptions {
4
+ placement?: PopupPlacement;
5
+ offset?: number;
6
+ maxWidth?: number;
7
+ matchAnchorWidth?: boolean;
8
+ closeOnOutside?: boolean;
9
+ /** 锚点是点位弹出的大容器(如整个表格)时,锚点内弹层外的按下也算外部 */
10
+ closeOnAnchorPress?: boolean;
11
+ closeOnEscape?: boolean;
12
+ onClose?: (reason: PopupCloseReason) => void;
13
+ }
14
+ export interface PopupHandle {
15
+ open(point?: PopupPoint): boolean;
16
+ isOpen(): boolean;
17
+ close(): void;
18
+ dispose(): void;
19
+ }
20
+ export interface PopupPoint {
21
+ x: number;
22
+ y: number;
23
+ }
24
+ export declare function closeDialogPopups(dialog: HTMLDialogElement): void;
25
+ /** Floating content stays in the same DevTools ShadowRoot and theme as its trigger. */
26
+ export declare function createPopup(anchor: HTMLElement, content: HTMLElement, options?: PopupOptions): PopupHandle;
@@ -0,0 +1,43 @@
1
+ export interface SelectOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ group?: string;
6
+ }
7
+ interface SelectBaseProps {
8
+ ariaLabel: string;
9
+ options: readonly SelectOption[];
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ readonly?: boolean;
13
+ searchable?: boolean;
14
+ clearable?: boolean;
15
+ searchPlaceholder?: string;
16
+ onOpen?: () => void;
17
+ onClose?: () => void;
18
+ }
19
+ export interface SelectProps extends SelectBaseProps {
20
+ value?: string | null;
21
+ defaultValue?: string | null;
22
+ onChange?(value: string | null): void;
23
+ onClear?: () => void;
24
+ }
25
+ export interface MultiSelectProps extends SelectBaseProps {
26
+ value?: readonly string[];
27
+ defaultValue?: readonly string[];
28
+ onChange?: (value: string[]) => void;
29
+ }
30
+ type SingleEvents = {
31
+ change: string | null;
32
+ clear: undefined;
33
+ open: undefined;
34
+ close: undefined;
35
+ };
36
+ type MultiEvents = {
37
+ change: string[];
38
+ open: undefined;
39
+ close: undefined;
40
+ };
41
+ export declare const Select: import("./component.js").ComponentDef<SelectProps, SingleEvents, HTMLButtonElement>;
42
+ export declare const MultiSelect: import("./component.js").ComponentDef<MultiSelectProps, MultiEvents, HTMLButtonElement>;
43
+ export {};
@@ -0,0 +1,28 @@
1
+ type NoEvents = Record<never, never>;
2
+ /** 窗口按钮只有放大 / 还原与关闭(交互设计 6.2:缩小与胶囊已移除) */
3
+ export interface WindowControlsProps {
4
+ maximized?: boolean;
5
+ onToggleMaximize?(): void;
6
+ onClose?(): void;
7
+ }
8
+ export declare const WindowControls: import("./component.js").ComponentDef<WindowControlsProps, NoEvents, HTMLElement>;
9
+ export interface TitleBarProps {
10
+ appName: string;
11
+ envLabel: string;
12
+ envLocal?: boolean;
13
+ pageTitle?: string;
14
+ pageSubtitle?: string;
15
+ actions?: Node;
16
+ maximized?: boolean;
17
+ onDblClick?: (event: MouseEvent) => void;
18
+ }
19
+ export declare const TitleBar: import("./component.js").ComponentDef<TitleBarProps, NoEvents, HTMLElement>;
20
+ /** 侧栏只有图标一种形态(交互设计 6.3:展开 / 收起已移除) */
21
+ export interface SideNavProps {
22
+ ariaLabel?: string;
23
+ items?: Node[];
24
+ footer?: Node[];
25
+ indicator?: Node;
26
+ }
27
+ export declare const SideNav: import("./component.js").ComponentDef<SideNavProps, NoEvents, HTMLElement>;
28
+ export {};
@@ -0,0 +1,157 @@
1
+ import type { DefaultCorner, DevtoolsPlugin, DevtoolsTheme, PanelPosition, PanelSize, ToastTone } from '../types.js';
2
+ import type { Runtime } from '../core/runtime.js';
3
+ export interface ShellUiState {
4
+ theme: DevtoolsTheme;
5
+ size: PanelSize;
6
+ panelDimensions: {
7
+ width: number;
8
+ height: number;
9
+ } | null;
10
+ /** 是否原位放大(交互设计 6.2) */
11
+ maximized: boolean;
12
+ /** 展开面板的自由拖拽坐标;null 表示停靠在默认角(出厂为左下角)并与悬浮球错开 */
13
+ panelPos: PanelPosition | null;
14
+ /** 悬浮球空闲 4s 自动向吸附边轻度半隐 */
15
+ autoTuck: boolean;
16
+ activePlugin: string;
17
+ launcher: PanelPosition | null;
18
+ /** 网络列表栏占比(百分比),未拖过为 null */
19
+ splitNetwork?: number | null;
20
+ /** 存储列表栏占比(百分比),未拖过为 null */
21
+ splitStorage?: number | null;
22
+ }
23
+ export interface SizeSpec {
24
+ fontSize: number;
25
+ width: number;
26
+ height: number;
27
+ rowHeight: number;
28
+ }
29
+ export declare const PANEL_SIZE_SPECS: Record<PanelSize, SizeSpec>;
30
+ export declare function resolveDefaultCorner(value: unknown): DefaultCorner;
31
+ export declare class Shell {
32
+ private shadow;
33
+ private rt;
34
+ private ui;
35
+ private saveUi;
36
+ readonly root: HTMLElement;
37
+ private styleEl;
38
+ private launcher;
39
+ private launcherPulse;
40
+ private launcherStatus;
41
+ private launcherBadge;
42
+ private launcherPill;
43
+ private pillNav;
44
+ private panel;
45
+ private headerEl;
46
+ private rail;
47
+ private railIndicator;
48
+ private titleEl;
49
+ private subtitleEl;
50
+ private bodyEl;
51
+ private themeButton;
52
+ private titleBar;
53
+ private windowControls;
54
+ private sideNav;
55
+ private titleTooltip;
56
+ private themeTip?;
57
+ private railTips;
58
+ private toastsEl;
59
+ private statusNet;
60
+ private statusLogs;
61
+ private statusCapture;
62
+ private entries;
63
+ private emptyView;
64
+ private openState;
65
+ private activeId;
66
+ private visibleEntry;
67
+ private listeners;
68
+ private timers;
69
+ private tuckTimer;
70
+ private pillOpenTimer;
71
+ private pillCloseTimer;
72
+ private pillVisible;
73
+ private lastNetTotal;
74
+ private lastErrorCount;
75
+ private lastPulseAt;
76
+ private mediaQuery?;
77
+ private onMediaChange;
78
+ private suppressedClick;
79
+ private suppressedHeaderDblClick;
80
+ private finishPanelResize?;
81
+ /** 进入放大态时锁定的基础矩形、锚定角与档位(交互设计 6.2);视口变化只按快照重算放大矩形 */
82
+ private maxSnapshot;
83
+ /** 还原时把档位恢复为放大前的值,此时不重算位置、不清尺寸记忆 */
84
+ private restoringSize;
85
+ constructor(shadow: ShadowRoot, rt: Runtime, ui: ShellUiState, saveUi: (patch: Partial<ShellUiState>) => void);
86
+ private schedule;
87
+ private clearTimer;
88
+ /** 按当前视口计算指定档位的实际安全宽高(小屏自动收敛,绝不超出视口) */
89
+ private resolveDimensions;
90
+ private clampExpandedPos;
91
+ /** 在设置面板切换 小 / 默认 / 大 档位:若已自定义拖拽坐标,按屏幕左/右半区锚定并严格防越界 */
92
+ private onSizeTransition;
93
+ private defaultCorner;
94
+ private launcherClearance;
95
+ private defaultLauncherPos;
96
+ private launcherPoint;
97
+ /** 非放大态的面板矩形:自由定位取 panelPos;停靠时与 panel.less 默认角规则一致(左右 12px、上下 56px) */
98
+ private restoredRect;
99
+ /** 锚定角:停在默认角时为默认角;拖离后按面板中心所在象限选最近视口角(中线上水平取左、垂直取下) */
100
+ private maximizeAnchor;
101
+ private launcherRect;
102
+ private captureMaxSnapshot;
103
+ private onMaximizedTransition;
104
+ private applyPanelGeometry;
105
+ private envLabel;
106
+ private resolveNonce;
107
+ private syncWindowControls;
108
+ private sideNavProps;
109
+ private syncTitleTooltip;
110
+ private syncCustomThemeStyles;
111
+ private resolvedBaseTheme;
112
+ private applyTheme;
113
+ private themeLabel;
114
+ private toggleTheme;
115
+ mountPlugins(plugins: DevtoolsPlugin[]): void;
116
+ private syncEmptyState;
117
+ registerPlugin(plugin: DevtoolsPlugin): void;
118
+ unregisterPlugin(id: string): void;
119
+ private sortedEntries;
120
+ private renderRail;
121
+ private syncRailTips;
122
+ private syncThemeTip;
123
+ private syncRailIndicator;
124
+ private renderQuickPill;
125
+ private syncQuickPillBadges;
126
+ private createContext;
127
+ activate(id: string): void;
128
+ private applyActive;
129
+ private syncPluginVisibility;
130
+ private updateSubtitle;
131
+ private computeErrorCount;
132
+ private onNetworkActivity;
133
+ refreshBadges(silent?: boolean): void;
134
+ open(pluginId?: string): void;
135
+ close(): void;
136
+ toggle(): void;
137
+ isOpen(): boolean;
138
+ private wakeLauncher;
139
+ private scheduleTuck;
140
+ private syncPillPosition;
141
+ private showPill;
142
+ private hidePill;
143
+ private bindLauncher;
144
+ private clampLauncher;
145
+ private snapLauncher;
146
+ private positionLauncher;
147
+ private applyLauncherPosition;
148
+ private startPanelResize;
149
+ /** 面板展开态(小/默认/大)与收起胶囊态均支持按住顶栏任意拖拽位置,松手持久化 */
150
+ private bindPanelDrag;
151
+ private bindGlobal;
152
+ /** 面板打开时让 toast 跟随面板(底部居中;收起态在标题条下方),否则回退到默认右下角 */
153
+ private positionToasts;
154
+ addToast(text: string, tone?: ToastTone): void;
155
+ private applyReset;
156
+ dispose(): void;
157
+ }
@@ -0,0 +1,16 @@
1
+ export interface SplitterProps {
2
+ first?: Node | string;
3
+ second?: Node | string;
4
+ direction?: 'horizontal' | 'vertical';
5
+ /** Optional height in pixels, particularly useful for stacked panes. */
6
+ height?: number;
7
+ size?: number;
8
+ defaultSize?: number;
9
+ minSize?: number;
10
+ maxSize?: number;
11
+ ariaLabel?: string;
12
+ onResize?: (size: number) => void;
13
+ }
14
+ export declare const Splitter: import("./component.js").ComponentDef<SplitterProps, {
15
+ resize: number;
16
+ }, HTMLElement>;
@@ -0,0 +1,79 @@
1
+ export type TableRowKey = string | number;
2
+ export interface TableColumn<Row extends object = object> {
3
+ key: string;
4
+ title: string;
5
+ /** 默认列宽,如 `'120px'` */
6
+ width?: string;
7
+ /** 最小列宽(px)。未给时为 64,或 `width` 更小时取 `width` */
8
+ minWidth?: number;
9
+ /** 填充列:列宽总和小于容器时吃掉剩余宽度;用户拖过后按拖后宽度 */
10
+ fill?: boolean;
11
+ /** 为 `false` 时不渲染列宽把柄 */
12
+ resizable?: boolean;
13
+ /** 为 `false` 时列设置里该项禁用,列始终显示 */
14
+ hideable?: boolean;
15
+ align?: 'left' | 'center' | 'right';
16
+ /** 默认可排序;为 `false` 时该列表头不提供排序(如操作列) */
17
+ sortable?: boolean;
18
+ compare?: (a: Row, b: Row) => number;
19
+ render?: (value: unknown, row: Row) => Node | string | number;
20
+ }
21
+ export interface TableSort {
22
+ key: string;
23
+ direction: 'asc' | 'desc';
24
+ }
25
+ export interface TableVirtualOptions {
26
+ /** 固定行高(px),默认 32 */
27
+ rowHeight?: number;
28
+ /** 可视区上下各多渲染的行数,默认 6 */
29
+ overscan?: number;
30
+ }
31
+ export interface TableProps<Row extends object = object> {
32
+ ariaLabel?: string;
33
+ columns: readonly TableColumn<Row>[];
34
+ rows: readonly Row[];
35
+ rowKey?: string | ((row: Row) => TableRowKey);
36
+ sort?: TableSort | null;
37
+ defaultSort?: TableSort;
38
+ selectable?: boolean;
39
+ selectedKeys?: readonly TableRowKey[];
40
+ activeRowKey?: TableRowKey | null;
41
+ dense?: boolean;
42
+ maxHeight?: number;
43
+ empty?: string;
44
+ hiddenKeys?: readonly string[];
45
+ defaultHiddenKeys?: readonly string[];
46
+ columnWidths?: Readonly<Record<string, number>>;
47
+ defaultColumnWidths?: Readonly<Record<string, number>>;
48
+ columnSettings?: boolean;
49
+ /** 虚拟滚动:固定行高,只渲染可视行 ± 缓冲行。表格需要确定高度(`maxHeight` 或父容器高度) */
50
+ virtual?: boolean | TableVirtualOptions;
51
+ /** 行级附加类 */
52
+ rowClass?: (row: Row, key: TableRowKey) => string | undefined;
53
+ onSortChange?: (sort: TableSort | null) => void;
54
+ onSelectionChange?: (keys: TableRowKey[]) => void;
55
+ onRowClick?: (key: TableRowKey, row: Row) => void;
56
+ onColumnVisibilityChange?: (hiddenKeys: string[]) => void;
57
+ onColumnWidthChange?: (widths: Record<string, number>) => void;
58
+ }
59
+ export declare const TABLE_SETTINGS_HINT = "\u53F3\u952E\u6216 Shift+F10 \u6253\u5F00\u5217\u8BBE\u7F6E";
60
+ export declare function defineTable<Row extends object = object>(): import("./component.js").ComponentDef<TableProps<Row>, {
61
+ sort: TableSort | null;
62
+ selection: TableRowKey[];
63
+ rowClick: {
64
+ key: TableRowKey;
65
+ row: Row;
66
+ };
67
+ columnVisibility: string[];
68
+ columnWidth: Record<string, number>;
69
+ }, HTMLElement>;
70
+ export declare const Table: import("./component.js").ComponentDef<TableProps<object>, {
71
+ sort: TableSort | null;
72
+ selection: TableRowKey[];
73
+ rowClick: {
74
+ key: TableRowKey;
75
+ row: object;
76
+ };
77
+ columnVisibility: string[];
78
+ columnWidth: Record<string, number>;
79
+ }, HTMLElement>;
@@ -0,0 +1,20 @@
1
+ import type { IconName } from '../types.js';
2
+ export interface TabItem {
3
+ key: string;
4
+ label: string;
5
+ icon?: IconName;
6
+ badge?: string | number;
7
+ disabled?: boolean;
8
+ content?: Node | string;
9
+ }
10
+ export interface TabsProps {
11
+ items: readonly TabItem[];
12
+ ariaLabel?: string;
13
+ activeKey?: string;
14
+ defaultActiveKey?: string;
15
+ placement?: 'top' | 'left';
16
+ onChange?: (key: string) => void;
17
+ }
18
+ export declare const Tabs: import("./component.js").ComponentDef<TabsProps, {
19
+ change: string;
20
+ }, HTMLElement>;
@@ -0,0 +1,4 @@
1
+ import type { NetworkEntry } from '../types.js';
2
+ export declare function shellQuote(value: string): string;
3
+ /** 把一条网络记录转成可直接粘到终端的 cURL */
4
+ export declare function toCurl(entry: Pick<NetworkEntry, 'method' | 'url' | 'requestHeaders' | 'requestBody'>): string;