@openviking/react 0.0.0-stage → 0.1.1

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 (104) hide show
  1. package/README.md +82 -2
  2. package/dist/3~0.js +8 -0
  3. package/dist/a~0.js +21 -0
  4. package/dist/client/client.d.ts +12 -0
  5. package/dist/client/errors.d.ts +30 -0
  6. package/dist/client/index.d.ts +4 -0
  7. package/dist/client/options.d.ts +101 -0
  8. package/dist/client/provider.d.ts +52 -0
  9. package/dist/client/types.d.ts +160 -0
  10. package/dist/client.js +239 -0
  11. package/dist/components/agent-connect/agent-connect.d.ts +4 -0
  12. package/dist/components/agent-connect/index.d.ts +1 -0
  13. package/dist/components/agent-connect/style.css +16 -0
  14. package/dist/components/agent-connect/style.js +0 -0
  15. package/dist/components/agent-connect/types.d.ts +175 -0
  16. package/dist/components/agent-connect.js +1 -0
  17. package/dist/components/file-preview/file-preview-body.d.ts +15 -0
  18. package/dist/components/file-preview/file-preview-header.d.ts +16 -0
  19. package/dist/components/file-preview/file-preview-icons.d.ts +2 -0
  20. package/dist/components/file-preview/file-preview-labels.d.ts +5 -0
  21. package/dist/components/file-preview/file-preview-operations.d.ts +1 -0
  22. package/dist/components/file-preview/file-preview.d.ts +17 -0
  23. package/dist/components/file-preview/index.d.ts +1 -0
  24. package/dist/components/file-preview/style.css +285 -0
  25. package/dist/components/file-preview/style.js +0 -0
  26. package/dist/components/file-preview/types.d.ts +435 -0
  27. package/dist/components/file-preview/use-file-preview-editing.d.ts +13 -0
  28. package/dist/components/file-preview.js +442 -0
  29. package/dist/components/file-tree/file-tree-body.d.ts +14 -0
  30. package/dist/components/file-tree/file-tree-dom.d.ts +4 -0
  31. package/dist/components/file-tree/file-tree-entry-row.d.ts +6 -0
  32. package/dist/components/file-tree/file-tree-icons.d.ts +8 -0
  33. package/dist/components/file-tree/file-tree-keyboard.d.ts +10 -0
  34. package/dist/components/file-tree/file-tree-labels.d.ts +5 -0
  35. package/dist/components/file-tree/file-tree-row-context.d.ts +24 -0
  36. package/dist/components/file-tree/file-tree-rows.d.ts +12 -0
  37. package/dist/components/file-tree/file-tree-tooltip.d.ts +11 -0
  38. package/dist/components/file-tree/file-tree.d.ts +4 -0
  39. package/dist/components/file-tree/index.d.ts +1 -0
  40. package/dist/components/file-tree/style.css +244 -0
  41. package/dist/components/file-tree/style.js +0 -0
  42. package/dist/components/file-tree/types.d.ts +406 -0
  43. package/dist/components/file-tree/use-file-tree-actions.d.ts +10 -0
  44. package/dist/components/file-tree.js +1 -0
  45. package/dist/components/scope-switcher/index.d.ts +1 -0
  46. package/dist/components/scope-switcher/scope-keyboard.d.ts +2 -0
  47. package/dist/components/scope-switcher/scope-panel.d.ts +5 -0
  48. package/dist/components/scope-switcher/scope-selector.d.ts +2 -0
  49. package/dist/components/scope-switcher/scope-switcher.d.ts +6 -0
  50. package/dist/components/scope-switcher/style.css +248 -0
  51. package/dist/components/scope-switcher/style.js +0 -0
  52. package/dist/components/scope-switcher/types.d.ts +367 -0
  53. package/dist/components/scope-switcher.js +3 -0
  54. package/dist/components/style.css +811 -0
  55. package/dist/components/style.js +0 -0
  56. package/dist/components/tui/index.d.ts +1 -0
  57. package/dist/components/tui/style.css +16 -0
  58. package/dist/components/tui/style.js +0 -0
  59. package/dist/components/tui/tui.d.ts +3 -0
  60. package/dist/components/tui/types.d.ts +485 -0
  61. package/dist/components/tui.js +1 -0
  62. package/dist/f~0.js +284 -0
  63. package/dist/icons/index.d.ts +23 -0
  64. package/dist/icons.js +25 -0
  65. package/dist/index.d.ts +16 -0
  66. package/dist/index.js +8 -0
  67. package/dist/i~0.js +21 -0
  68. package/dist/lk~0.js +220 -0
  69. package/dist/l~0.js +44 -0
  70. package/dist/modules/console/console.d.ts +4 -0
  71. package/dist/modules/console/index.d.ts +1 -0
  72. package/dist/modules/console/style.css +29 -0
  73. package/dist/modules/console/style.js +0 -0
  74. package/dist/modules/console/types.d.ts +101 -0
  75. package/dist/modules/console.js +1 -0
  76. package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +10 -0
  77. package/dist/modules/file-browser/file-browser.d.ts +6 -0
  78. package/dist/modules/file-browser/index.d.ts +1 -0
  79. package/dist/modules/file-browser/style.css +75 -0
  80. package/dist/modules/file-browser/style.js +0 -0
  81. package/dist/modules/file-browser/types.d.ts +101 -0
  82. package/dist/modules/file-browser.js +1 -0
  83. package/dist/modules/scope-cascade/controller.d.ts +6 -0
  84. package/dist/modules/scope-cascade/index.d.ts +3 -0
  85. package/dist/modules/scope-cascade/scope-cascade.d.ts +3 -0
  86. package/dist/modules/scope-cascade/style.css +250 -0
  87. package/dist/modules/scope-cascade/style.js +0 -0
  88. package/dist/modules/scope-cascade/types.d.ts +39 -0
  89. package/dist/modules/scope-cascade/use-scope-cascade.d.ts +5 -0
  90. package/dist/modules/scope-cascade.js +1 -0
  91. package/dist/modules/style.css +385 -0
  92. package/dist/modules/style.js +0 -0
  93. package/dist/modules/task-center/columns.d.ts +129 -0
  94. package/dist/modules/task-center/index.d.ts +1 -0
  95. package/dist/modules/task-center/style.css +29 -0
  96. package/dist/modules/task-center/style.js +0 -0
  97. package/dist/modules/task-center/task-center.d.ts +4 -0
  98. package/dist/modules/task-center/types.d.ts +168 -0
  99. package/dist/modules/task-center.js +1 -0
  100. package/dist/n~0.js +499 -0
  101. package/dist/style.css +1198 -0
  102. package/dist/style.js +0 -0
  103. package/dist/u~0.js +8 -0
  104. package/package.json +103 -4
@@ -0,0 +1,435 @@
1
+ import type { FileViewerResource } from '@ark-design/ui/file-viewer/core';
2
+ import type { ForwardRefExoticComponent, HTMLAttributes, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
3
+ /**
4
+ * 要预览的内容及文件信息。提供多个来源时,按 `content`、`file`、`url`
5
+ * 的顺序使用第一个有值的来源。
6
+ * The content and file information to preview. When multiple sources are
7
+ * provided, the first available one is used in the order `content`, `file`, `url`.
8
+ */
9
+ export interface FilePreviewSource {
10
+ /**
11
+ * 文本内容,适用于 Markdown、JSON、代码等可内联的格式。
12
+ * Text content, for formats that can be inlined such as Markdown, JSON and
13
+ * code.
14
+ */
15
+ content?: string;
16
+ /**
17
+ * 二进制文件,适用于 PDF、Office 文档、表格与 3D 模型等。
18
+ * Binary file, for PDF, Office documents, spreadsheets and 3D models.
19
+ */
20
+ file?: File | Blob;
21
+ /**
22
+ * 文件地址。宿主已经能提供可访问链接时使用,组件不自行鉴权。
23
+ * File URL. Used when the host can already provide an accessible link; the
24
+ * component performs no authentication of its own.
25
+ */
26
+ url?: string;
27
+ /**
28
+ * 文件名,用于识别格式与展示标题。无扩展名的文件按文件名匹配,
29
+ * 例如 `Dockerfile` 与 `Makefile`。
30
+ * File name, used for format detection and the header title. Extensionless
31
+ * files match by name, for example `Dockerfile` and `Makefile`.
32
+ */
33
+ fileName: string;
34
+ /**
35
+ * 完整路径,显示在标题下方。省略时只显示文件名。
36
+ * Full path shown under the title. Only the file name is shown when omitted.
37
+ */
38
+ path?: string;
39
+ /**
40
+ * 显式格式提示,优先级高于扩展名与 MIME。
41
+ * Explicit format hint, taking precedence over extension and MIME.
42
+ */
43
+ fileType?: string;
44
+ }
45
+ /**
46
+ * 所有页签的公共配置,包括标识、标题、图标、文案及标题行操作。
47
+ * Configuration shared by every tab, including identity, title, icon, copy and
48
+ * header actions.
49
+ */
50
+ export interface FilePreviewTabBase {
51
+ /**
52
+ * 页签唯一标识。
53
+ * Unique tab key.
54
+ */
55
+ key: string;
56
+ /**
57
+ * 页签行显示的内容。可以是纯文本,也可以是带样式或图标的节点。
58
+ * What the tab row shows. It can be plain text or a node with styling or
59
+ * icons.
60
+ */
61
+ title?: ReactNode;
62
+ /**
63
+ * 页签图标。省略时按文件格式自动选择,内容页签使用内置的看板图标。
64
+ * Tab icon. Chosen from the file format when omitted; a content tab uses the
65
+ * built-in dashboard icon.
66
+ */
67
+ icon?: ReactNode;
68
+ /**
69
+ * 该页签的文案,逐项覆盖外层 `labels`。未提供的项回落到外层。
70
+ * Copy of this tab, overriding the outer `labels` field by field. Fields left
71
+ * out fall back to the outer ones.
72
+ */
73
+ labels?: Partial<FilePreviewLabels>;
74
+ /**
75
+ * 是否禁用该页签。
76
+ * Whether the tab is disabled.
77
+ */
78
+ disabled?: boolean;
79
+ /**
80
+ * 上级目录成功打开后触发,参数为当前文件路径;失败时不触发。
81
+ * Called after the parent directory opens, with the current file path;
82
+ * not called on failure.
83
+ */
84
+ onOpenParent?: (path: string) => void;
85
+ /**
86
+ * 路径复制成功后触发,参数为已复制的路径;复制失败时不触发。
87
+ * 省略回调不影响复制。文件页签提供 `source.path` 时显示复制路径按钮。
88
+ *
89
+ * Called after path copying succeeds, with the copied path; not called on
90
+ * failure. Omitting it does not affect copying. File tabs with `source.path`
91
+ * show the copy-path button.
92
+ */
93
+ onCopyPath?: (path: string) => void;
94
+ /**
95
+ * 是否显示预览/源码切换,默认 `true`。格式本身没有源码视图时自动隐藏。
96
+ *
97
+ * 只在文件页签上生效。内容页签的正文由宿主渲染,组件没有可切换的两种视图,
98
+ * 传了也不会渲染切换按钮;宿主需要两种视图时在 `content` 里自行实现。
99
+ *
100
+ * Whether to show the preview/source switch, `true` by default. Hidden
101
+ * automatically when the format has no source view.
102
+ *
103
+ * Only meaningful on file tabs. A content tab's body is rendered by the host,
104
+ * so the component has no second view to switch to and renders no control;
105
+ * a host that needs two views implements the switch inside `content`.
106
+ */
107
+ showViewModeSwitch?: boolean;
108
+ /**
109
+ * 内容区标题行的插槽。页签行本身只显示标题与图标,其余元素都在这一层。
110
+ * Slots of the content header row. The tab row itself shows only a title and
111
+ * an icon; everything else renders in this layer.
112
+ */
113
+ slots?: FilePreviewHeaderSlots;
114
+ }
115
+ /**
116
+ * 文件预览页签或宿主自定义内容页签。
117
+ * A file-preview tab or a tab with host-provided content.
118
+ */
119
+ export type FilePreviewTab = FilePreviewFileTab | FilePreviewContentTab;
120
+ /**
121
+ * 按文件格式预览 `source` 的页签。
122
+ * A tab that previews `source` according to its file format.
123
+ */
124
+ export interface FilePreviewFileTab extends FilePreviewTabBase {
125
+ /**
126
+ * 页签类型标记,固定为 `file`。
127
+ * Tab kind discriminator, always `file`.
128
+ */
129
+ kind: 'file';
130
+ /**
131
+ * 要预览的内容及文件信息。
132
+ * The content and file information to preview.
133
+ */
134
+ source: FilePreviewSource;
135
+ /**
136
+ * 文件操作的执行能力;省略对应方法时该操作不可用。
137
+ * File operation capabilities; omitting a method makes its operation unavailable.
138
+ */
139
+ operations?: FilePreviewOperations;
140
+ /**
141
+ * 主文件之外、按 key 读取的伴随资源,例如 3D 模型的贴图。
142
+ * Companion resources read by key alongside the main file, for example
143
+ * textures of a 3D model.
144
+ */
145
+ resources?: readonly FileViewerResource[];
146
+ /**
147
+ * 文件编辑配置;省略时只读。
148
+ * File-editing options; omit them for a read-only preview.
149
+ */
150
+ editing?: FilePreviewEditing;
151
+ /**
152
+ * 文件页签的标题行插槽,在基类之上增加三类状态兜底。
153
+ * Header slots of a file tab, adding the three state fallbacks on top of the
154
+ * base ones.
155
+ */
156
+ slots?: FilePreviewFileTabSlots;
157
+ /**
158
+ * 正文复制成功后触发,参数为已复制的文本;复制失败时不触发。
159
+ * 省略回调不影响复制。仅文件页签提供正文复制,没有可复制文本时按钮禁用。
160
+ *
161
+ * Called after content copying succeeds, with the copied text; not called on
162
+ * failure. Omitting it does not affect copying. Only file tabs provide body
163
+ * copying; the button is disabled when no copyable text is available.
164
+ */
165
+ onCopyContent?: (text: string) => void;
166
+ /**
167
+ * 下载操作成功后触发,失败时不触发。
168
+ * Called after the download operation succeeds; not called on failure.
169
+ */
170
+ onDownload?: () => void;
171
+ /**
172
+ * 正文中的资源成功打开后触发,参数为已打开的 URI;失败时不触发。
173
+ * Called after a content resource opens, with its URI; not called on failure.
174
+ */
175
+ onOpenUri?: (uri: string) => void;
176
+ }
177
+ /**
178
+ * 展示宿主自定义内容的页签,例如看板或图谱。
179
+ * 标题行可通过 `slots` 补充内容与操作;正文及其加载、错误提示由 `content` 提供。
180
+ * A tab with host-provided content, such as a dashboard or graph. Use `slots`
181
+ * for extra header content and actions, and `content` for the body and any
182
+ * loading or error messages.
183
+ */
184
+ export interface FilePreviewContentTab extends FilePreviewTabBase {
185
+ /**
186
+ * 页签类型标记,固定为 `content`。
187
+ * Tab kind discriminator, always `content`.
188
+ */
189
+ kind: 'content';
190
+ /**
191
+ * 页签行显示的内容。内容页签没有 `source.fileName` 可以回落,因此这里是
192
+ * 必填。
193
+ * What the tab row shows. A content tab has no `source.fileName` to fall back
194
+ * to, so it is required here.
195
+ */
196
+ title: ReactNode;
197
+ /**
198
+ * 页签正文,由宿主渲染。
199
+ * The tab body, rendered by the host.
200
+ */
201
+ content: ReactNode;
202
+ }
203
+ /** 文件操作的执行能力。File operation capabilities. */
204
+ export interface FilePreviewOperations {
205
+ /** 打开当前文件的上级目录。Opens the current file's parent directory. */
206
+ openParent?: (path: string) => Promise<void>;
207
+ /** 下载当前文件,完成后返回。Downloads the current file and resolves on completion. */
208
+ download?: () => Promise<void>;
209
+ /** 打开正文引用的资源。Opens a resource referenced by the content. */
210
+ openUri?: (uri: string) => Promise<void>;
211
+ }
212
+ /**
213
+ * 文件编辑配置。省略时只读;可提供编辑所需的完整文本,并处理保存与取消操作。
214
+ * File-editing options. Omit them for a read-only preview. Provide the full
215
+ * text to edit and handle save and cancel actions as needed.
216
+ */
217
+ export interface FilePreviewEditing {
218
+ /**
219
+ * 进入编辑时读取完整文本,适用于截断预览或文件地址。
220
+ * 省略时使用 `content` 或 `file` 中的文本;仅提供 `url` 时需提供此读取函数。
221
+ * 返回 `undefined` 时放弃本次编辑,保持预览态。
222
+ * Provides the full text when editing is requested, for example for a truncated
223
+ * preview or a file URL. When omitted, text from `content` or `file` is used;
224
+ * URL-only sources require this loader. Returning `undefined` cancels the
225
+ * edit request and keeps the preview open.
226
+ */
227
+ loadContent?: (source: FilePreviewSource) => Promise<string | undefined>;
228
+ /**
229
+ * 保存草稿时调用。抛错或 reject 时组件展示失败提示并保留草稿。
230
+ * Invoked when the draft is saved. A thrown error or rejection keeps the
231
+ * draft and shows a failure message.
232
+ */
233
+ save: (value: string) => Promise<void>;
234
+ /**
235
+ * 保存成功后触发,参数为已保存的文本;失败时不触发。
236
+ * Called after saving succeeds, with the saved text; not called on failure.
237
+ */
238
+ onSave?: (value: string) => void;
239
+ /**
240
+ * 取消编辑或切换页签并丢弃草稿后触发,参数为丢弃的文本;保存成功时不触发。
241
+ * Called after cancelling editing or switching tabs discards the draft;
242
+ * receives the discarded text and is not called after a successful save.
243
+ */
244
+ onCancel?: (value: string) => void;
245
+ }
246
+ /**
247
+ * 所有页签共用的内容区标题行插槽。
248
+ * Content-header slots shared by every tab.
249
+ */
250
+ export interface FilePreviewHeaderSlots {
251
+ /**
252
+ * 标题行右侧的额外动作,例如权限设置或删除。
253
+ *
254
+ * 复制与下载使用已有按钮,不需要在这里重复添加。
255
+ *
256
+ * Extra actions on the right of the header, for example permissions or
257
+ * delete.
258
+ *
259
+ * Use the existing copy and download buttons instead of adding duplicates here.
260
+ */
261
+ actions?: ReactNode;
262
+ /**
263
+ * 标题旁的额外内容。宿主想放在文件名之后的任何东西都可以从这里注入,
264
+ * 例如权限标记、状态徽标或版本号;不需要时不传。
265
+ * Extra content next to the title. Anything the host wants after the file
266
+ * name can go here, for example a permission tag, a status badge or a
267
+ * version label; omit it when not needed.
268
+ */
269
+ titleExtra?: ReactNode;
270
+ }
271
+ /**
272
+ * 文件页签的标题行插槽,以及加载、失败或格式不支持时的替代内容。
273
+ * Header slots of a file tab and replacement content for loading, failure or
274
+ * unsupported formats.
275
+ */
276
+ export interface FilePreviewFileTabSlots extends FilePreviewHeaderSlots {
277
+ /**
278
+ * 内容读取中的兜底内容。不传时使用内置加载态。
279
+ * Fallback while the content is being read. A built-in loading state is used
280
+ * when omitted.
281
+ */
282
+ loadingFallback?: ReactNode;
283
+ /**
284
+ * 读取失败时的兜底内容。不传时使用内置错误态与重试入口。
285
+ * Fallback when reading failed. A built-in error state with a retry entry is
286
+ * used when omitted.
287
+ */
288
+ errorFallback?: ReactNode;
289
+ /**
290
+ * 格式不支持时的兜底内容。不传时使用内置提示。
291
+ * Fallback when the format cannot be previewed. A built-in message is used
292
+ * when omitted.
293
+ */
294
+ unsupportedFallback?: ReactNode;
295
+ }
296
+ /**
297
+ * 可替换文案,组件内置英文默认值。
298
+ * Replaceable copy; the component ships English defaults.
299
+ */
300
+ export interface FilePreviewLabels {
301
+ /**
302
+ * 复制内容按钮的文案。
303
+ * Label of the copy-content button.
304
+ */
305
+ copyContent?: string;
306
+ /**
307
+ * 复制内容成功后的提示。
308
+ * Message shown after the content was copied.
309
+ */
310
+ copyContentSuccess?: string;
311
+ /**
312
+ * 没有内容可复制时的提示。
313
+ * Message shown when there is no content to copy.
314
+ */
315
+ copyContentEmpty?: string;
316
+ /**
317
+ * 复制路径按钮的文案。
318
+ * Label of the copy-path button.
319
+ */
320
+ copyPath?: string;
321
+ /**
322
+ * 复制路径成功后的提示。
323
+ * Message shown after the path was copied.
324
+ */
325
+ copyPathSuccess?: string;
326
+ /**
327
+ * 打开上级目录的按钮文案。
328
+ * Label of the control that opens the parent directory.
329
+ */
330
+ openParent?: string;
331
+ /**
332
+ * 进入编辑状态的按钮文案。
333
+ * Label of the control that enters editing.
334
+ */
335
+ edit?: string;
336
+ /**
337
+ * 保存按钮文案。
338
+ * Save button label.
339
+ */
340
+ save?: string;
341
+ /**
342
+ * 取消编辑的按钮文案。
343
+ * Label of the control that leaves editing.
344
+ */
345
+ cancel?: string;
346
+ /**
347
+ * 预览视图的文案。
348
+ * Label of the preview view.
349
+ */
350
+ preview?: string;
351
+ /**
352
+ * 源码视图的文案。
353
+ * Label of the source view.
354
+ */
355
+ source?: string;
356
+ /**
357
+ * 重试按钮文案。
358
+ * Retry button label.
359
+ */
360
+ retry?: string;
361
+ /**
362
+ * 读取失败时的提示。
363
+ * Message shown when reading failed.
364
+ */
365
+ loadFailed?: string;
366
+ /**
367
+ * 保存失败时的提示。
368
+ * Message shown when saving failed.
369
+ */
370
+ saveFailed?: string;
371
+ /**
372
+ * 无法预览该格式时的提示。
373
+ * Message shown when the format cannot be previewed.
374
+ */
375
+ unsupported?: string;
376
+ /**
377
+ * 取回正文时的加载提示。
378
+ * Message shown while the text is being fetched.
379
+ */
380
+ loading?: string;
381
+ /**
382
+ * 下载按钮文案。
383
+ * Label of the download button.
384
+ */
385
+ download?: string;
386
+ /**
387
+ * 无法预览二进制文件时的提示。
388
+ * Message shown when a binary file cannot be previewed.
389
+ */
390
+ binaryUnsupported?: string;
391
+ }
392
+ /**
393
+ * 通过组件 ref 切换或查询当前页签。
394
+ * Switches or queries the active tab through the component ref.
395
+ */
396
+ export interface FilePreviewHandle {
397
+ /**
398
+ * 切到指定 key 的页签。该页签不存在或被禁用时返回 `false`。
399
+ * Switches to the tab with the given key. Returns `false` when the tab does
400
+ * not exist or is disabled.
401
+ */
402
+ setActiveTab: (key: string) => boolean;
403
+ /**
404
+ * 取当前激活页签的 key。
405
+ * Returns the key of the active tab.
406
+ */
407
+ getActiveTab: () => string;
408
+ }
409
+ /**
410
+ * 文件预览配置,支持文件页签与自定义内容页签。
411
+ * 通过页签配置内容与操作,文件页签可提供编辑能力与状态提示。
412
+ * File-preview options supporting file tabs and custom-content tabs.
413
+ * Configure content and actions per tab; file tabs also support editing options
414
+ * and status content.
415
+ */
416
+ export interface FilePreviewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
417
+ /**
418
+ * 页签列表,至少一个。每个页签用 `source` 交给组件按格式渲染,或用
419
+ * `content` 完全自定义渲染。
420
+ * The tab list, at least one entry. Each tab either hands `source` to the
421
+ * component for format rendering or renders fully custom `content`.
422
+ */
423
+ tabs: readonly [FilePreviewTab, ...FilePreviewTab[]];
424
+ /**
425
+ * 所有页签的默认文案,缺省为英文。页签可以逐项覆盖。
426
+ * Default copy for every tab, English by default. A tab can override it field
427
+ * by field.
428
+ */
429
+ labels?: FilePreviewLabels;
430
+ }
431
+ /**
432
+ * 文件预览组件,可通过 ref 切换或查询当前页签。
433
+ * A file-preview component whose ref supports switching and querying tabs.
434
+ */
435
+ export type FilePreviewComponent = ForwardRefExoticComponent<PropsWithoutRef<FilePreviewProps> & RefAttributes<FilePreviewHandle>>;
@@ -0,0 +1,13 @@
1
+ import type { FilePreviewFileTab, FilePreviewTab } from './types.js';
2
+ export declare function useFilePreviewEditing(): {
3
+ editing: boolean;
4
+ loadingEdit: boolean;
5
+ editFailed: boolean;
6
+ saving: boolean;
7
+ saveFailed: boolean;
8
+ draft: string;
9
+ discard: (tab: FilePreviewTab) => void;
10
+ start: (tab: FilePreviewFileTab) => Promise<void>;
11
+ save: (tab: FilePreviewFileTab) => Promise<void>;
12
+ updateDraft: (value: string) => void;
13
+ };