@simon_he/vue-tui 0.0.8 → 1.0.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.
- package/README.md +142 -30
- package/dist/TSelect-BwJJbuTt.js +6089 -0
- package/dist/TTree-DK_DQBYm.js +6480 -0
- package/dist/agent.cjs +39416 -0
- package/dist/agent.d.cts +44 -0
- package/dist/agent.d.ts +44 -0
- package/dist/agent.js +828 -0
- package/dist/ansi-palette-CNXqFciC.js +57 -0
- package/dist/ansi-styles.d.ts +200 -0
- package/dist/block-source-CKUOnkgT.js +1663 -0
- package/dist/cli/headless-renderer.d.ts +29 -0
- package/dist/cli/input.d.ts +49 -0
- package/dist/cli/node-file-writers.d.ts +13 -0
- package/dist/cli/node-module.d.ts +2 -0
- package/dist/cli/parse-kitty.d.ts +2 -0
- package/dist/cli/parse-mouse.d.ts +2 -0
- package/dist/cli/parse-utils.d.ts +14 -0
- package/dist/cli/parse-xterm.d.ts +2 -0
- package/dist/cli/path-provider-types.d.ts +1 -0
- package/dist/cli/path-provider.d.ts +4 -0
- package/dist/cli/path-suggest-core.d.ts +1 -0
- package/dist/cli/path-suggest.d.ts +15 -0
- package/dist/cli/recording.d.ts +4 -0
- package/dist/cli/stdin-buffer.d.ts +33 -0
- package/dist/cli.cjs +11061 -0
- package/dist/cli.d.cts +23 -0
- package/dist/cli.d.ts +23 -0
- package/dist/cli.js +9875 -0
- package/dist/core/ansi/capability.d.ts +20 -0
- package/dist/core/ansi/colors.d.ts +41 -0
- package/dist/core/ansi/sgr.d.ts +7 -0
- package/dist/core/ansi/theme.d.ts +6 -0
- package/dist/core/ansi-palette.d.ts +14 -0
- package/dist/core/buffer/buffer.d.ts +54 -0
- package/dist/core/buffer/width.d.ts +4 -0
- package/dist/core/debug-logger.d.ts +18 -0
- package/dist/core/hyperlink.d.ts +9 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/path-provider-types.d.ts +24 -0
- package/dist/core/path-suggest.d.ts +35 -0
- package/dist/core/render-plane.d.ts +3 -0
- package/dist/core/terminal/create-terminal.d.ts +8 -0
- package/dist/core/terminal/emitter.d.ts +7 -0
- package/dist/core/types.d.ts +107 -0
- package/dist/core.cjs +3153 -0
- package/dist/core.d.cts +14 -0
- package/dist/core.d.ts +14 -0
- package/dist/core.js +424 -0
- package/dist/create-terminal-C2oiWFJU.js +1434 -0
- package/dist/create-terminal-app.d.ts +36 -0
- package/dist/dom-renderer-BqGijQID.js +1173 -0
- package/dist/env-Cl8qmNFN.js +19 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/events/manager/cli-event-manager.d.ts +22 -0
- package/dist/events/manager/event-manager.d.ts +30 -0
- package/dist/events/manager/selection-suppression.d.ts +3 -0
- package/dist/events/manager/types.d.ts +108 -0
- package/dist/events/recording.d.ts +44 -0
- package/dist/experimental.cjs +4412 -1641
- package/dist/experimental.d.cts +42 -0
- package/dist/experimental.d.ts +42 -825
- package/dist/experimental.js +31 -7392
- package/dist/frame-perf-C6Xfg85O.js +24 -0
- package/dist/hyperlink-Bn02UXJb.js +419 -0
- package/dist/index.cjs +14765 -17582
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -1528
- package/dist/index.js +17 -20026
- package/dist/linkify-D_gzn9Xq.js +562 -0
- package/dist/markdown.cjs +9321 -7623
- package/dist/markdown.d.cts +11 -0
- package/dist/markdown.d.ts +11 -112
- package/dist/markdown.js +36 -1427
- package/dist/observability/cli-latency-node.d.ts +3 -0
- package/dist/observability/cli-latency-types.d.ts +41 -0
- package/dist/observability/cli-latency.d.ts +3 -0
- package/dist/observability/frame-perf-store.d.ts +18 -0
- package/dist/observability/frame-perf.d.ts +40 -0
- package/dist/observability/perf-sink.d.ts +56 -0
- package/dist/observability/trace.d.ts +40 -0
- package/dist/observability/tui-profiler.d.ts +33 -0
- package/dist/observability.cjs +221 -0
- package/dist/observability.d.cts +8 -0
- package/dist/observability.d.ts +8 -0
- package/dist/observability.js +4 -0
- package/dist/path-mnSgEpCm.js +81 -0
- package/dist/path-suggest-BNqcuE3-.js +274 -0
- package/dist/path-suggest-Dk9TRLh5.js +3 -0
- package/dist/{path-suggest-DmrmeueH.js → path-suggest-bvR9SY6Q.js} +86 -18
- package/dist/renderer/capabilities.d.ts +13 -0
- package/dist/renderer/cli/index.d.ts +2 -0
- package/dist/renderer/cli/stdout-metrics.d.ts +18 -0
- package/dist/renderer/cli/stdout-renderer.d.ts +48 -0
- package/dist/renderer/dom/dom-renderer.d.ts +157 -0
- package/dist/renderer/dom/index.d.ts +2 -0
- package/dist/renderer/index.d.ts +2 -0
- package/dist/renderer-dom.cjs +1505 -0
- package/dist/renderer-dom.d.cts +4 -0
- package/dist/renderer-dom.d.ts +4 -0
- package/dist/renderer-dom.js +7 -0
- package/dist/runtime/index.d.ts +36 -0
- package/dist/runtime/osc52.d.ts +9 -0
- package/dist/runtime-rfcZCyJq.js +1197 -0
- package/dist/runtime.cjs +1698 -0
- package/dist/runtime.d.cts +9 -0
- package/dist/runtime.d.ts +9 -0
- package/dist/runtime.js +4 -0
- package/dist/selection/terminal-selection.d.ts +123 -0
- package/dist/sgr-BmzxEjAO.js +304 -0
- package/dist/terminal-selection-DBinO6p5.js +330 -0
- package/dist/tlog-theme-qPBt5rge.js +9254 -0
- package/dist/trace-CjzYeIxN.js +182 -0
- package/dist/utils/env.d.ts +3 -0
- package/dist/utils/grapheme.d.ts +5 -0
- package/dist/utils/newlines.d.ts +1 -0
- package/dist/utils/path.d.ts +7 -0
- package/dist/utils/url-safety.d.ts +2 -0
- package/dist/vue/agent/view-models.d.ts +98 -0
- package/dist/vue/components/TAnchor.d.ts +108 -0
- package/dist/vue/components/TBox.d.ts +144 -0
- package/dist/vue/components/TCommandPalette.d.ts +587 -0
- package/dist/vue/components/TDataTable.d.ts +367 -0
- package/dist/vue/components/TDebugOverlay.d.ts +43 -0
- package/dist/vue/components/TDialog.d.ts +255 -0
- package/dist/vue/components/TFeedback.d.ts +635 -0
- package/dist/vue/components/TFlow.d.ts +85 -0
- package/dist/vue/components/TForm.d.ts +1230 -0
- package/dist/vue/components/TInput.d.ts +545 -0
- package/dist/vue/components/TInputBox.d.ts +158 -0
- package/dist/vue/components/TJsonEditor.d.ts +165 -0
- package/dist/vue/components/TLink.d.ts +239 -0
- package/dist/vue/components/TLinkifyText.d.ts +141 -0
- package/dist/vue/components/TList.d.ts +119 -0
- package/dist/vue/components/TLogLinksPanel.d.ts +238 -0
- package/dist/vue/components/TLogMinimap.d.ts +263 -0
- package/dist/vue/components/TLogScrollbar.d.ts +236 -0
- package/dist/vue/components/TLogSearchBar.d.ts +267 -0
- package/dist/vue/components/TLogSearchPager.d.ts +162 -0
- package/dist/vue/components/TLogSearchResults.d.ts +200 -0
- package/dist/vue/components/TLogView.d.ts +536 -0
- package/dist/vue/components/TLogVirtualLinksPanel.d.ts +141 -0
- package/dist/vue/components/TLogVirtualSearchResults.d.ts +146 -0
- package/dist/vue/components/TMarkdownText.d.ts +134 -0
- package/dist/vue/components/TMultilineModal.d.ts +62 -0
- package/dist/vue/components/TNavigation.d.ts +324 -0
- package/dist/vue/components/TOverlay.d.ts +366 -0
- package/dist/vue/components/TPanels.d.ts +244 -0
- package/dist/vue/components/TPathPicker.d.ts +213 -0
- package/dist/vue/components/TRenderLayer.d.ts +16 -0
- package/dist/vue/components/TRenderPlane.d.ts +17 -0
- package/dist/vue/components/TSelect.d.ts +335 -0
- package/dist/vue/components/TTable.d.ts +317 -0
- package/dist/vue/components/TText.d.ts +116 -0
- package/dist/vue/components/TThinkingView.d.ts +233 -0
- package/dist/vue/components/TToolCallView.d.ts +384 -0
- package/dist/vue/components/TTranscriptView.d.ts +221 -0
- package/dist/vue/components/TTransition.d.ts +83 -0
- package/dist/vue/components/TTree.d.ts +200 -0
- package/dist/vue/components/TUserMessageView.d.ts +344 -0
- package/dist/vue/components/TView.d.ts +127 -0
- package/dist/vue/components/TVirtualList.d.ts +182 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +168 -0
- package/dist/vue/components/TVirtualRows.d.ts +247 -0
- package/dist/vue/components/TerminalProvider.d.ts +218 -0
- package/dist/vue/components/input/host.d.ts +17 -0
- package/dist/vue/components/input/plugins/hostPlugin.d.ts +7 -0
- package/dist/vue/components/input/plugins/hostPlugin.node.d.ts +15 -0
- package/dist/vue/components/input/plugins/mentionUtils.d.ts +17 -0
- package/dist/vue/components/input/plugins/nodeMentionPathProvider.d.ts +2 -0
- package/dist/vue/components/input/plugins/promptMentionPlugin.d.ts +8 -0
- package/dist/vue/components/input/plugins/promptMentionState.d.ts +98 -0
- package/dist/vue/components/input/plugins/restrictText.d.ts +27 -0
- package/dist/vue/components/input/plugins/types.d.ts +90 -0
- package/dist/vue/components/input/utils/inlineText.d.ts +57 -0
- package/dist/vue/components/input/utils/inlineTextTokens.d.ts +34 -0
- package/dist/vue/components/input/utils/primitives.d.ts +3 -0
- package/dist/vue/components/input/utils/wordNavigation.d.ts +6 -0
- package/dist/vue/components/link/host.d.ts +15 -0
- package/dist/vue/components/list/list-geometry.d.ts +16 -0
- package/dist/vue/components/list/list-paint.d.ts +1 -0
- package/dist/vue/components/list/scroll-state.d.ts +25 -0
- package/dist/vue/components/list/selection-state.d.ts +6 -0
- package/dist/vue/components/simple-utils.d.ts +5 -0
- package/dist/vue/components/terminal-provider/copy-toast.d.ts +6 -0
- package/dist/vue/components/terminal-provider/portals.d.ts +17 -0
- package/dist/vue/components/terminal-provider/scheduler.d.ts +29 -0
- package/dist/vue/components/terminal-provider/selection-config.d.ts +15 -0
- package/dist/vue/components/terminal-provider/utils.d.ts +5 -0
- package/dist/vue/composables/use-layout.d.ts +2 -0
- package/dist/vue/composables/use-render-node.d.ts +19 -0
- package/dist/vue/composables/use-render-stack.d.ts +3 -0
- package/dist/vue/composables/use-runtime.d.ts +5 -0
- package/dist/vue/composables/use-terminal-node.d.ts +14 -0
- package/dist/vue/composables/use-terminal.d.ts +2 -0
- package/dist/vue/composables/use-visibility.d.ts +12 -0
- package/dist/vue/context.d.ts +153 -0
- package/dist/vue/index.d.ts +69 -0
- package/dist/vue/injection-key.d.ts +2 -0
- package/dist/vue/linkify.d.ts +11 -0
- package/dist/vue/log/append-only-log-store.d.ts +2 -0
- package/dist/vue/log/tlog-keymap.d.ts +28 -0
- package/dist/vue/log/tlog-plugins.d.ts +144 -0
- package/dist/vue/log/tlog-session.d.ts +81 -0
- package/dist/vue/log/tlog-theme.d.ts +68 -0
- package/dist/vue/log/types.d.ts +43 -0
- package/dist/vue/log/use-tlog-link-controller.d.ts +31 -0
- package/dist/vue/log/use-tlog-retained-index.d.ts +26 -0
- package/dist/vue/log/use-tlog-search-controller.d.ts +51 -0
- package/dist/vue/log/use-tlog-search-results-page.d.ts +31 -0
- package/dist/vue/log/use-tlog-virtual-search-results.d.ts +22 -0
- package/dist/vue/markdown/ast.d.ts +3 -0
- package/dist/vue/markdown/block-source.d.ts +22 -0
- package/dist/vue/markdown/document.d.ts +20 -0
- package/dist/vue/markdown/layout.d.ts +21 -0
- package/dist/vue/markdown/parser.d.ts +11 -0
- package/dist/vue/markdown/render.d.ts +10 -0
- package/dist/vue/markdown/theme.d.ts +186 -0
- package/dist/vue/markdown/types.d.ts +59 -0
- package/dist/vue/overlay.d.ts +27 -0
- package/dist/vue/render/context.d.ts +3 -0
- package/dist/vue/render/render-manager.d.ts +94 -0
- package/dist/vue/router/RouterView.d.ts +25 -0
- package/dist/vue/router/composables.d.ts +4 -0
- package/dist/vue/router/context.d.ts +4 -0
- package/dist/vue/router/router.d.ts +7 -0
- package/dist/vue/router/types.d.ts +29 -0
- package/dist/vue/scheduler/frame-mailbox.d.ts +55 -0
- package/dist/vue/scheduler/frame-scheduler.d.ts +51 -0
- package/dist/vue/theme.d.ts +48 -0
- package/dist/vue/transcript/hit-regions.d.ts +2 -0
- package/dist/vue/transcript/layout.d.ts +20 -0
- package/dist/vue/transcript/plain-text.d.ts +2 -0
- package/dist/vue/transcript/types.d.ts +122 -0
- package/dist/vue/utils/frame-task.d.ts +6 -0
- package/dist/vue/utils/rect.d.ts +4 -0
- package/dist/vue/utils/row-scroll.d.ts +25 -0
- package/dist/vue/utils/style-cache.d.ts +3 -0
- package/dist/vue/utils/text.d.ts +27 -0
- package/dist/vue/utils/wheel-scroll.d.ts +18 -0
- package/dist/vue.cjs +23668 -0
- package/dist/vue.d.cts +1 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +3957 -0
- package/dist/{wheel-scroll-CiNsasLf.js → wheel-scroll-vBRaQ7p-.js} +404 -405
- package/package.json +185 -35
- package/dist/path-suggest-BeV6n7m-.js +0 -3
- package/dist/sgr-Tko2EQ0U.js +0 -484
- package/dist/theme-Bsm65g8k.d.ts +0 -32
- package/dist/types-ClIV2h1o.d.ts +0 -103
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import type { PropType } from "vue";
|
|
2
|
+
import type { WidthProvider } from "../../core/buffer/width.js";
|
|
3
|
+
import type { PathPickerProvider } from "../../core/path-provider-types.js";
|
|
4
|
+
import type { Style } from "../../core/types.js";
|
|
5
|
+
import type { TerminalEventRecord } from "../../events/recording.js";
|
|
6
|
+
import type { DomRendererOptions } from "../../renderer/dom/dom-renderer.js";
|
|
7
|
+
import type { ClipboardApi } from "../../runtime/index.js";
|
|
8
|
+
import type { TerminalSelectionCopyPayload } from "../../selection/terminal-selection.js";
|
|
9
|
+
import type { TInputPlugin } from "./input/plugins/types.js";
|
|
10
|
+
import type { TuiThemeOverrides } from "../theme.js";
|
|
11
|
+
import { type TerminalLinkOpenerLike } from "./link/host.js";
|
|
12
|
+
import { type TerminalProviderSelectionConfig } from "./terminal-provider/selection-config.js";
|
|
13
|
+
export type { TerminalProviderSelectionConfig, TerminalProviderSelectionOptions, } from "./terminal-provider/selection-config.js";
|
|
14
|
+
export declare const TerminalProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
cols: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
rows: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
widthProvider: {
|
|
24
|
+
type: PropType<WidthProvider>;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
defaultStyle: {
|
|
28
|
+
type: PropType<Style>;
|
|
29
|
+
default: () => {};
|
|
30
|
+
};
|
|
31
|
+
theme: {
|
|
32
|
+
type: PropType<TuiThemeOverrides>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
autoResize: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
minCols: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
minRows: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
recordEvents: {
|
|
48
|
+
type: PropType<((e: TerminalEventRecord) => void) | undefined>;
|
|
49
|
+
default: undefined;
|
|
50
|
+
};
|
|
51
|
+
inputPlugins: {
|
|
52
|
+
type: PropType<readonly TInputPlugin[]>;
|
|
53
|
+
default: () => Readonly<{
|
|
54
|
+
name: string;
|
|
55
|
+
install: (ctx: import("../index.js").TInputPluginContext) => void;
|
|
56
|
+
}>[];
|
|
57
|
+
};
|
|
58
|
+
pathPickerProvider: {
|
|
59
|
+
type: PropType<PathPickerProvider>;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
linkOpener: {
|
|
63
|
+
type: PropType<TerminalLinkOpenerLike>;
|
|
64
|
+
default: undefined;
|
|
65
|
+
};
|
|
66
|
+
debugIme: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
debugTrace: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
domRendererOptions: {
|
|
75
|
+
type: PropType<DomRendererOptions>;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
clipboard: {
|
|
79
|
+
type: PropType<ClipboardApi>;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
selection: {
|
|
83
|
+
type: PropType<TerminalProviderSelectionConfig>;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
89
|
+
selectionCopy: (_payload: TerminalSelectionCopyPayload) => true;
|
|
90
|
+
}, string, (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps), Readonly<import("vue").ExtractPropTypes<{
|
|
91
|
+
cols: {
|
|
92
|
+
type: NumberConstructor;
|
|
93
|
+
required: true;
|
|
94
|
+
};
|
|
95
|
+
rows: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
required: true;
|
|
98
|
+
};
|
|
99
|
+
widthProvider: {
|
|
100
|
+
type: PropType<WidthProvider>;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
103
|
+
defaultStyle: {
|
|
104
|
+
type: PropType<Style>;
|
|
105
|
+
default: () => {};
|
|
106
|
+
};
|
|
107
|
+
theme: {
|
|
108
|
+
type: PropType<TuiThemeOverrides>;
|
|
109
|
+
default: undefined;
|
|
110
|
+
};
|
|
111
|
+
autoResize: {
|
|
112
|
+
type: BooleanConstructor;
|
|
113
|
+
default: boolean;
|
|
114
|
+
};
|
|
115
|
+
minCols: {
|
|
116
|
+
type: NumberConstructor;
|
|
117
|
+
default: number;
|
|
118
|
+
};
|
|
119
|
+
minRows: {
|
|
120
|
+
type: NumberConstructor;
|
|
121
|
+
default: number;
|
|
122
|
+
};
|
|
123
|
+
recordEvents: {
|
|
124
|
+
type: PropType<((e: TerminalEventRecord) => void) | undefined>;
|
|
125
|
+
default: undefined;
|
|
126
|
+
};
|
|
127
|
+
inputPlugins: {
|
|
128
|
+
type: PropType<readonly TInputPlugin[]>;
|
|
129
|
+
default: () => Readonly<{
|
|
130
|
+
name: string;
|
|
131
|
+
install: (ctx: import("../index.js").TInputPluginContext) => void;
|
|
132
|
+
}>[];
|
|
133
|
+
};
|
|
134
|
+
pathPickerProvider: {
|
|
135
|
+
type: PropType<PathPickerProvider>;
|
|
136
|
+
default: undefined;
|
|
137
|
+
};
|
|
138
|
+
linkOpener: {
|
|
139
|
+
type: PropType<TerminalLinkOpenerLike>;
|
|
140
|
+
default: undefined;
|
|
141
|
+
};
|
|
142
|
+
debugIme: {
|
|
143
|
+
type: BooleanConstructor;
|
|
144
|
+
default: boolean;
|
|
145
|
+
};
|
|
146
|
+
debugTrace: {
|
|
147
|
+
type: BooleanConstructor;
|
|
148
|
+
default: boolean;
|
|
149
|
+
};
|
|
150
|
+
domRendererOptions: {
|
|
151
|
+
type: PropType<DomRendererOptions>;
|
|
152
|
+
default: undefined;
|
|
153
|
+
};
|
|
154
|
+
clipboard: {
|
|
155
|
+
type: PropType<ClipboardApi>;
|
|
156
|
+
default: undefined;
|
|
157
|
+
};
|
|
158
|
+
selection: {
|
|
159
|
+
type: PropType<TerminalProviderSelectionConfig>;
|
|
160
|
+
default: boolean;
|
|
161
|
+
};
|
|
162
|
+
}>> & Readonly<{
|
|
163
|
+
onSelectionCopy?: ((_payload: Readonly<{
|
|
164
|
+
text: string;
|
|
165
|
+
rows: number;
|
|
166
|
+
chars: number;
|
|
167
|
+
ok: boolean;
|
|
168
|
+
error?: unknown;
|
|
169
|
+
}>) => any) | undefined;
|
|
170
|
+
}>, {
|
|
171
|
+
widthProvider: WidthProvider;
|
|
172
|
+
debugIme: boolean;
|
|
173
|
+
clipboard: Readonly<{
|
|
174
|
+
supported: boolean;
|
|
175
|
+
readText: () => Promise<string>;
|
|
176
|
+
writeText: (text: string) => Promise<void>;
|
|
177
|
+
}>;
|
|
178
|
+
selection: TerminalProviderSelectionConfig;
|
|
179
|
+
defaultStyle: Readonly<{
|
|
180
|
+
fg?: string;
|
|
181
|
+
bg?: string;
|
|
182
|
+
bold?: boolean;
|
|
183
|
+
dim?: boolean;
|
|
184
|
+
italic?: boolean;
|
|
185
|
+
underline?: boolean;
|
|
186
|
+
inverse?: boolean;
|
|
187
|
+
href?: string;
|
|
188
|
+
}>;
|
|
189
|
+
theme: Readonly<{
|
|
190
|
+
colors?: import("../theme.js").TuiThemeColorTokens;
|
|
191
|
+
components?: import("../theme.js").TuiThemeComponentTokens;
|
|
192
|
+
}>;
|
|
193
|
+
inputPlugins: readonly Readonly<{
|
|
194
|
+
name: string;
|
|
195
|
+
install: (ctx: import("../index.js").TInputPluginContext) => void;
|
|
196
|
+
}>[];
|
|
197
|
+
pathPickerProvider: Readonly<{
|
|
198
|
+
listDir: (absDir: string) => Promise<import("../../cli.js").FsDirEntry[]>;
|
|
199
|
+
stat: (absPath: string) => Promise<import("../../cli.js").FsStat>;
|
|
200
|
+
suggest?: (info: Readonly<{
|
|
201
|
+
workspaceAbs: string;
|
|
202
|
+
input: string;
|
|
203
|
+
mode: import("../../cli.js").PathPickMode;
|
|
204
|
+
max: number;
|
|
205
|
+
showHidden?: boolean;
|
|
206
|
+
maxDepth?: number;
|
|
207
|
+
gitignore?: "blocking" | "nonBlocking";
|
|
208
|
+
}>) => Promise<import("../../cli.js").SuggestPathsResult>;
|
|
209
|
+
resolvePath?: (workspaceAbs: string, input: string) => string | Promise<string>;
|
|
210
|
+
}>;
|
|
211
|
+
linkOpener: TerminalLinkOpenerLike;
|
|
212
|
+
autoResize: boolean;
|
|
213
|
+
minCols: number;
|
|
214
|
+
minRows: number;
|
|
215
|
+
recordEvents: ((e: TerminalEventRecord) => void) | undefined;
|
|
216
|
+
debugTrace: boolean;
|
|
217
|
+
domRendererOptions: DomRendererOptions;
|
|
218
|
+
}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ResolveTInputPathInfo = Readonly<{
|
|
2
|
+
workspace: string;
|
|
3
|
+
input: string;
|
|
4
|
+
preserveBackslash?: boolean;
|
|
5
|
+
homeDir?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type TInputHostAdapter = Readonly<{
|
|
8
|
+
isTerminalLike?: boolean;
|
|
9
|
+
resolvePath?: (info: ResolveTInputPathInfo) => string;
|
|
10
|
+
pathToHref?: (pathLike: string) => string | undefined;
|
|
11
|
+
readClipboardText?: () => Promise<string>;
|
|
12
|
+
writeClipboardText?: (text: string) => Promise<boolean>;
|
|
13
|
+
showToast?: (message: string) => void;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function resolveDefaultTInputPath(info: ResolveTInputPathInfo): string;
|
|
16
|
+
export declare function fileUrlToPathLike(input: string): string | null;
|
|
17
|
+
export declare function pathToTerminalFileHref(pathLike: string): string | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TInputHostAdapter } from "../host.js";
|
|
2
|
+
import type { TInputPlugin } from "./types.js";
|
|
3
|
+
export declare function createTInputHostPlugin(adapterOrFactory?: TInputHostAdapter | (() => TInputHostAdapter)): TInputPlugin;
|
|
4
|
+
export declare const defaultTInputHostPlugin: Readonly<{
|
|
5
|
+
name: string;
|
|
6
|
+
install: (ctx: import("./types.js").TInputPluginContext) => void;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TInputHostAdapter } from "../host.js";
|
|
2
|
+
export type CreateDefaultTInputHostAdapterOptions = Readonly<{
|
|
3
|
+
clipboardCommandTimeoutMs?: number;
|
|
4
|
+
clipboardTotalTimeoutMs?: number;
|
|
5
|
+
/** Max bytes for OSC52 clipboard writes. */
|
|
6
|
+
clipboardWriteMaxBytes?: number;
|
|
7
|
+
/** @deprecated Use clipboardWriteMaxBytes. */
|
|
8
|
+
clipboardMaxBytes?: number;
|
|
9
|
+
clipboardReadMaxBytes?: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function createDefaultTInputHostAdapter(options?: CreateDefaultTInputHostAdapterOptions): TInputHostAdapter;
|
|
12
|
+
export declare const defaultTInputHostPlugin: Readonly<{
|
|
13
|
+
name: string;
|
|
14
|
+
install: (ctx: import("./types.js").TInputPluginContext) => void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Style } from "../../../../core/types.js";
|
|
2
|
+
export declare function isCommitMention(value: string): boolean;
|
|
3
|
+
export declare function getCommitIdFromMention(value: string): string | null;
|
|
4
|
+
export declare function createPasteImagePlaceholderPath(id: number): string;
|
|
5
|
+
export declare function isPasteImagePlaceholderPath(absPath: string): boolean;
|
|
6
|
+
export declare function basenameFromPath(path: string): string;
|
|
7
|
+
export declare function getFileExtension(path: string): string;
|
|
8
|
+
export declare function isImageFile(extension: string): boolean;
|
|
9
|
+
export declare function isVideoFile(extension: string): boolean;
|
|
10
|
+
export declare function isAudioFile(extension: string): boolean;
|
|
11
|
+
export declare function isDocumentFile(extension: string): boolean;
|
|
12
|
+
export declare function isCodeFile(extension: string): boolean;
|
|
13
|
+
export declare function mentionLabelFromAbsPath(absPath: string, opts?: Readonly<{
|
|
14
|
+
index?: number;
|
|
15
|
+
}>): string;
|
|
16
|
+
export type MentionFsKind = "file" | "directory" | "other";
|
|
17
|
+
export declare function mentionChipStyle(baseStyle: Style, _absPath: string, _fsKind?: MentionFsKind): Style;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
|
|
2
|
+
import type { TInputPlugin } from "./types.js";
|
|
3
|
+
export type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
|
|
4
|
+
export type PromptMentionPluginOptions = Readonly<{
|
|
5
|
+
mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
|
|
6
|
+
mentionPathProvider?: MentionPathProvider;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function createPromptMentionPlugin(options?: PromptMentionPluginOptions): TInputPlugin;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { FsEntryKind } from "../../../../core/path-provider-types.js";
|
|
3
|
+
import type { PathPickMode, PathSuggestion } from "../../../../core/path-suggest.js";
|
|
4
|
+
import type { Terminal } from "../../../../core/types.js";
|
|
5
|
+
import type { Rect } from "../../../../events/manager/types.js";
|
|
6
|
+
export type PromptSuggestion = Readonly<{
|
|
7
|
+
value: string;
|
|
8
|
+
insert?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
detail?: string;
|
|
11
|
+
keywords?: readonly string[];
|
|
12
|
+
mentionValue?: string;
|
|
13
|
+
mentionBehavior?: "collect" | "inline";
|
|
14
|
+
onSelect?: (info: Readonly<{
|
|
15
|
+
value: string;
|
|
16
|
+
query: string;
|
|
17
|
+
}>) => void | boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export type MentionSuggestionProvider = (info: Readonly<{
|
|
20
|
+
query: string;
|
|
21
|
+
tokenText: string;
|
|
22
|
+
trigger: string;
|
|
23
|
+
workspace: string;
|
|
24
|
+
maxItems: number;
|
|
25
|
+
}>) => readonly PromptSuggestion[] | Promise<readonly PromptSuggestion[]>;
|
|
26
|
+
export type MentionPathProvider = Readonly<{
|
|
27
|
+
stat?: (absPath: string) => FsEntryKind | null | undefined | Promise<FsEntryKind | null | undefined>;
|
|
28
|
+
suggest?: (info: Readonly<{
|
|
29
|
+
workspaceAbs: string;
|
|
30
|
+
input: string;
|
|
31
|
+
mode: PathPickMode;
|
|
32
|
+
max: number;
|
|
33
|
+
showHidden: boolean;
|
|
34
|
+
maxDepth: number;
|
|
35
|
+
}>) => readonly PathSuggestion[] | Promise<readonly PathSuggestion[]>;
|
|
36
|
+
}>;
|
|
37
|
+
export type PromptContext = Readonly<{
|
|
38
|
+
tokenStart: number;
|
|
39
|
+
tokenEnd: number;
|
|
40
|
+
tokenText: string;
|
|
41
|
+
query: string;
|
|
42
|
+
key: string;
|
|
43
|
+
trigger: string;
|
|
44
|
+
}>;
|
|
45
|
+
type PromptMatch = Readonly<{
|
|
46
|
+
item: PromptSuggestion;
|
|
47
|
+
score: number;
|
|
48
|
+
order: number;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function fuzzyScore(query: string, candidate: string): number | null;
|
|
51
|
+
export type UsePromptMentionStateOptions = Readonly<{
|
|
52
|
+
props: Readonly<{
|
|
53
|
+
promptSuggestions: readonly PromptSuggestion[];
|
|
54
|
+
promptTrigger: string;
|
|
55
|
+
promptTriggers?: readonly string[];
|
|
56
|
+
promptMaxItems: number;
|
|
57
|
+
promptAlign: "input" | "center";
|
|
58
|
+
mentionTrigger: string;
|
|
59
|
+
mentionWorkspace: string;
|
|
60
|
+
mentionMode: PathPickMode;
|
|
61
|
+
mentionShowHidden: boolean;
|
|
62
|
+
mentionSuggestions: readonly PromptSuggestion[];
|
|
63
|
+
mentionMaxItems: number;
|
|
64
|
+
mentions: readonly string[];
|
|
65
|
+
skillTrigger?: string;
|
|
66
|
+
skillSuggestions?: readonly PromptSuggestion[];
|
|
67
|
+
}>;
|
|
68
|
+
mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
|
|
69
|
+
mentionPathProvider?: MentionPathProvider;
|
|
70
|
+
focused: Ref<boolean>;
|
|
71
|
+
cursor: Ref<number>;
|
|
72
|
+
getValue: () => string;
|
|
73
|
+
rawAbsRect: ComputedRef<Rect>;
|
|
74
|
+
terminal: Terminal;
|
|
75
|
+
scheduler: Readonly<{
|
|
76
|
+
invalidate: () => void;
|
|
77
|
+
}>;
|
|
78
|
+
multilineToken: string;
|
|
79
|
+
mentionToken: string;
|
|
80
|
+
}>;
|
|
81
|
+
export declare function usePromptMentionState(options: UsePromptMentionStateOptions): Readonly<{
|
|
82
|
+
promptActive: Ref<number>;
|
|
83
|
+
promptSuppressedKey: Ref<string | null>;
|
|
84
|
+
mentionKindByPath: Map<string, "file" | "directory" | "other">;
|
|
85
|
+
mentionKindVersion: Ref<number>;
|
|
86
|
+
promptContext: ComputedRef<PromptContext | null>;
|
|
87
|
+
mentionContext: ComputedRef<PromptContext | null>;
|
|
88
|
+
activeContext: ComputedRef<PromptContext | null>;
|
|
89
|
+
/** Full match list (not windowed). */
|
|
90
|
+
promptMatches: ComputedRef<readonly PromptMatch[]>;
|
|
91
|
+
/** Windowed list used for rendering and click mapping. */
|
|
92
|
+
promptMatchesVisible: ComputedRef<readonly PromptMatch[]>;
|
|
93
|
+
promptWindowStart: ComputedRef<number>;
|
|
94
|
+
promptActiveVisible: ComputedRef<number>;
|
|
95
|
+
promptVisible: ComputedRef<boolean>;
|
|
96
|
+
promptRect: ComputedRef<Rect>;
|
|
97
|
+
}>;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TInputPlugin } from "./types.js";
|
|
2
|
+
export type TextRestrictionRule = Readonly<{
|
|
3
|
+
allowChars: RegExp;
|
|
4
|
+
} | {
|
|
5
|
+
denyChars: RegExp;
|
|
6
|
+
} | {
|
|
7
|
+
replace: Readonly<{
|
|
8
|
+
from: RegExp;
|
|
9
|
+
to: string;
|
|
10
|
+
}>;
|
|
11
|
+
} | {
|
|
12
|
+
allow: RegExp;
|
|
13
|
+
} | {
|
|
14
|
+
filter: (info: Readonly<{
|
|
15
|
+
text: string;
|
|
16
|
+
value: string;
|
|
17
|
+
cursor: number;
|
|
18
|
+
selection: null | Readonly<{
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
}>;
|
|
22
|
+
}>) => string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function createTextRestrictionPlugin(options: Readonly<{
|
|
25
|
+
name?: string;
|
|
26
|
+
rules: readonly TextRestrictionRule[];
|
|
27
|
+
}>): TInputPlugin;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { PathPickMode } from "../../../../core/path-suggest.js";
|
|
3
|
+
import type { TerminalRenderPlane } from "../../../../core/render-plane.js";
|
|
4
|
+
import type { Style, Terminal } from "../../../../core/types.js";
|
|
5
|
+
import type { Rect, TerminalKeyboardEvent } from "../../../../events/manager/types.js";
|
|
6
|
+
import type { TerminalScheduler } from "../../../context.js";
|
|
7
|
+
import type { TInputHostAdapter } from "../host.js";
|
|
8
|
+
export type PromptSuggestion = Readonly<{
|
|
9
|
+
value: string;
|
|
10
|
+
insert?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
keywords?: readonly string[];
|
|
14
|
+
mentionValue?: string;
|
|
15
|
+
mentionBehavior?: "collect" | "inline";
|
|
16
|
+
onSelect?: (info: Readonly<{
|
|
17
|
+
value: string;
|
|
18
|
+
query: string;
|
|
19
|
+
}>) => void | boolean;
|
|
20
|
+
}>;
|
|
21
|
+
export type TInputPluginContext = Readonly<{
|
|
22
|
+
getProps: () => Readonly<{
|
|
23
|
+
zIndex: number;
|
|
24
|
+
style?: Style;
|
|
25
|
+
promptSuggestions: readonly PromptSuggestion[];
|
|
26
|
+
promptTrigger: string;
|
|
27
|
+
promptTriggers?: readonly string[];
|
|
28
|
+
promptMaxItems: number;
|
|
29
|
+
promptAlign: "input" | "center";
|
|
30
|
+
promptSelectedStyle?: Style;
|
|
31
|
+
promptPopupStyle?: Style;
|
|
32
|
+
promptPopupBorderStyle?: Style;
|
|
33
|
+
promptPopupMatchStyle?: Style;
|
|
34
|
+
mentionTrigger: string;
|
|
35
|
+
mentionWorkspace: string;
|
|
36
|
+
mentionMode: PathPickMode;
|
|
37
|
+
mentionShowHidden: boolean;
|
|
38
|
+
mentionSuggestions: readonly PromptSuggestion[];
|
|
39
|
+
mentionMaxItems: number;
|
|
40
|
+
mentionChipStyle?: Style;
|
|
41
|
+
collectMentions: boolean;
|
|
42
|
+
mentions: readonly string[];
|
|
43
|
+
skillTrigger?: string;
|
|
44
|
+
skillSuggestions?: readonly PromptSuggestion[];
|
|
45
|
+
}>;
|
|
46
|
+
emit: (event: string, ...args: any[]) => void;
|
|
47
|
+
terminal: Terminal;
|
|
48
|
+
scheduler: TerminalScheduler;
|
|
49
|
+
defaultStyle: Ref<Style>;
|
|
50
|
+
render: Readonly<{
|
|
51
|
+
rootStack: any;
|
|
52
|
+
createStack: (parent: any, z: number) => any;
|
|
53
|
+
invalidatePlane: (plane: TerminalRenderPlane) => void;
|
|
54
|
+
}>;
|
|
55
|
+
visible: Ref<boolean>;
|
|
56
|
+
rawAbsRect: ComputedRef<Rect>;
|
|
57
|
+
eventZ: ComputedRef<number>;
|
|
58
|
+
focused: Ref<boolean>;
|
|
59
|
+
cursor: Ref<number>;
|
|
60
|
+
getValue: () => string;
|
|
61
|
+
insertText: (text: string) => void;
|
|
62
|
+
pushUndoSnapshot: (nextValue: string) => void;
|
|
63
|
+
applyEdit: (nextValue: string, nextCursor: number) => void;
|
|
64
|
+
registerKeydownInterceptor: (fn: (e: TerminalKeyboardEvent) => boolean) => void;
|
|
65
|
+
registerTextFilter: (fn: (info: Readonly<{
|
|
66
|
+
text: string;
|
|
67
|
+
value: string;
|
|
68
|
+
cursor: number;
|
|
69
|
+
selection: null | Readonly<{
|
|
70
|
+
start: number;
|
|
71
|
+
end: number;
|
|
72
|
+
}>;
|
|
73
|
+
}>) => string) => void;
|
|
74
|
+
registerChipStyleProvider: (provider: Readonly<{
|
|
75
|
+
getStyle: (baseStyle: Style, chip: Readonly<{
|
|
76
|
+
kind: "multiline" | "mention";
|
|
77
|
+
absPath?: string;
|
|
78
|
+
}>) => Style | null | undefined;
|
|
79
|
+
version: Ref<number>;
|
|
80
|
+
}> | null) => void;
|
|
81
|
+
registerHostAdapter: (adapter: TInputHostAdapter | null) => void;
|
|
82
|
+
resolvePath: (input: string, opts?: Readonly<{
|
|
83
|
+
preserveBackslash?: boolean;
|
|
84
|
+
}>) => string;
|
|
85
|
+
mentionToken: string;
|
|
86
|
+
}>;
|
|
87
|
+
export type TInputPlugin = Readonly<{
|
|
88
|
+
name: string;
|
|
89
|
+
install: (ctx: TInputPluginContext) => void;
|
|
90
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { textCellWidth as baseTextCellWidth } from "../../../utils/text.js";
|
|
2
|
+
export declare const textCellWidth: typeof baseTextCellWidth;
|
|
3
|
+
export declare function padEndByCells(text: string, width: number): string;
|
|
4
|
+
export declare function sliceByCellsWindow(text: string, startCell: number, width: number): string;
|
|
5
|
+
export type LineInfo = Readonly<{
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type WrappedLineInfo = Readonly<{
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function computeLines(value: string): LineInfo[];
|
|
14
|
+
export declare function countMultilineTokens(value: string, multilineToken: string, endIndex?: number): number;
|
|
15
|
+
export declare function countMentionTokens(value: string, mentionToken: string, endIndex?: number): number;
|
|
16
|
+
export declare function tokenIndexAt(value: string, multilineToken: string, index: number): number;
|
|
17
|
+
export declare function mentionIndexAt(value: string, mentionToken: string, index: number): number;
|
|
18
|
+
export declare function textCellWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, start: number, end: number): number;
|
|
19
|
+
export declare function wrapToLinesInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, width: number): WrappedLineInfo[];
|
|
20
|
+
export declare function wrapToLinesFirstWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, firstWidth: number, width: number): WrappedLineInfo[];
|
|
21
|
+
export declare function indexToWrappedCellColFirstWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number, firstWidth: number, width: number): {
|
|
22
|
+
line: number;
|
|
23
|
+
col: number;
|
|
24
|
+
lines: WrappedLineInfo[];
|
|
25
|
+
};
|
|
26
|
+
export declare function indexToLineCellColInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number): {
|
|
27
|
+
line: number;
|
|
28
|
+
col: number;
|
|
29
|
+
lines: LineInfo[];
|
|
30
|
+
};
|
|
31
|
+
export type InlineHit = Readonly<{
|
|
32
|
+
kind: "multiline" | "mention";
|
|
33
|
+
index: number;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function lineCellColToIndexInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, col: number): {
|
|
36
|
+
index: number;
|
|
37
|
+
hit: InlineHit | null;
|
|
38
|
+
};
|
|
39
|
+
export type InlineChipRender = Readonly<{
|
|
40
|
+
startCell: number;
|
|
41
|
+
label: string;
|
|
42
|
+
kind: "multiline" | "mention";
|
|
43
|
+
index: number;
|
|
44
|
+
absPath?: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function buildInlineRow(value: string, displayValue: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, rowTextW: number, offX: number): {
|
|
47
|
+
text: string;
|
|
48
|
+
chips: InlineChipRender[];
|
|
49
|
+
};
|
|
50
|
+
export type InlineSelectionSegment = Readonly<{
|
|
51
|
+
startCell: number;
|
|
52
|
+
text: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function buildInlineSelectionSegments(value: string, displayValue: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, selection: Readonly<{
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
}>, rowTextW: number, offX: number): InlineSelectionSegment[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InlineHit, LineInfo, WrappedLineInfo } from "./inlineText.js";
|
|
2
|
+
import { buildInlineRow as buildInlineRowCore, buildInlineSelectionSegments as buildInlineSelectionSegmentsCore } from "./inlineText.js";
|
|
3
|
+
export declare const MULTILINE_TOKEN = "\uFFFC";
|
|
4
|
+
export declare const MENTION_TOKEN = "\uFFF9";
|
|
5
|
+
export declare function isMultilineToken(value: string, index: number): boolean;
|
|
6
|
+
export declare function isMentionToken(value: string, index: number): boolean;
|
|
7
|
+
export declare function countMultilineTokens(value: string, endIndex?: number): number;
|
|
8
|
+
export declare function countMentionTokens(value: string, endIndex?: number): number;
|
|
9
|
+
export declare function tokenIndexAt(value: string, index: number): number;
|
|
10
|
+
export declare function mentionIndexAt(value: string, index: number): number;
|
|
11
|
+
export declare function wrapToLinesFirstWidthInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, firstWidth: number, width: number): WrappedLineInfo[];
|
|
12
|
+
export declare function indexToWrappedCellColFirstWidthInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number, firstWidth: number, width: number): {
|
|
13
|
+
line: number;
|
|
14
|
+
col: number;
|
|
15
|
+
lines: WrappedLineInfo[];
|
|
16
|
+
};
|
|
17
|
+
export declare function indexToLineCellColInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number): {
|
|
18
|
+
line: number;
|
|
19
|
+
col: number;
|
|
20
|
+
lines: LineInfo[];
|
|
21
|
+
};
|
|
22
|
+
export declare function lineCellColToIndexInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, col: number): {
|
|
23
|
+
index: number;
|
|
24
|
+
hit: InlineHit | null;
|
|
25
|
+
};
|
|
26
|
+
export declare function wrappedCellColToIndexInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, info: WrappedLineInfo, col: number): {
|
|
27
|
+
index: number;
|
|
28
|
+
hit: InlineHit | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function buildInlineRow(value: string, displayValue: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, rowTextW: number, offX: number): ReturnType<typeof buildInlineRowCore>;
|
|
31
|
+
export declare function buildInlineSelectionSegments(value: string, displayValue: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, selection: Readonly<{
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
}>, rowTextW: number, offX: number): ReturnType<typeof buildInlineSelectionSegmentsCore>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
export type TerminalLinkOpenSource = "click" | "key" | "hint";
|
|
3
|
+
export type TerminalLinkOpenContext = Readonly<{
|
|
4
|
+
source: TerminalLinkOpenSource;
|
|
5
|
+
label?: string;
|
|
6
|
+
cellX?: number;
|
|
7
|
+
cellY?: number;
|
|
8
|
+
}>;
|
|
9
|
+
export interface TerminalLinkOpener {
|
|
10
|
+
openExternal: (href: string, context: TerminalLinkOpenContext) => boolean | Promise<boolean>;
|
|
11
|
+
}
|
|
12
|
+
export type TerminalLinkOpenerLike = TerminalLinkOpener | ((href: string, context: TerminalLinkOpenContext) => boolean | Promise<boolean>);
|
|
13
|
+
export declare const TerminalLinkOpenerContextKey: import("vue").InjectionKey<Readonly<Ref<TerminalLinkOpener | undefined>>>;
|
|
14
|
+
export declare function normalizeTerminalLinkOpener(opener: TerminalLinkOpenerLike | undefined): TerminalLinkOpener | undefined;
|
|
15
|
+
export declare function createBrowserLinkOpener(): TerminalLinkOpener;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Rect } from "../../../events/manager/types.js";
|
|
2
|
+
export type ListClipOffsets = Readonly<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
export type ListVisibleRange = Readonly<{
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function clipOffsets(full: Rect, clip: Rect): ListClipOffsets;
|
|
12
|
+
export declare function maxScrollTop(itemsLength: number, clipY: number, clipH: number): number;
|
|
13
|
+
export declare function maxScrollTopForClamp(fullH: number, clipH: number, itemsLength: number, clipY: number): number | null;
|
|
14
|
+
export declare function clampScrollTop(value: number, max: number | null): number;
|
|
15
|
+
export declare function visibleRange(scrollTop: number, itemsLength: number, full: Rect, clip: Rect): ListVisibleRange;
|
|
16
|
+
export declare function hasPaintableViewport(visible: boolean, rect: Rect): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatClippedInlineCellLine(raw: string, fullWidth: number, clipX: number, width: number): string;
|