@opensumi/sumi 2.12.1-next-079c1930

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 (37) hide show
  1. package/README.md +1 -0
  2. package/build.ts +18 -0
  3. package/index.d.ts +5 -0
  4. package/manifest.json +414 -0
  5. package/package.json +18 -0
  6. package/sumi-browser.d.ts +273 -0
  7. package/sumi-worker/sumi-worker.d.ts +2788 -0
  8. package/sumi-worker/worker.command.d.ts +86 -0
  9. package/sumi-worker/worker.comments.d.ts +273 -0
  10. package/sumi-worker/worker.doc.d.ts +356 -0
  11. package/sumi-worker/worker.editor.d.ts +725 -0
  12. package/sumi-worker/worker.extensions.d.ts +63 -0
  13. package/sumi-worker/worker.language.d.ts +2220 -0
  14. package/sumi-worker/worker.window.d.ts +318 -0
  15. package/sumi-worker.d.ts +7 -0
  16. package/sumi.d.ts +822 -0
  17. package/vscode/typings/vscode.authentication.d.ts +231 -0
  18. package/vscode/typings/vscode.command.d.ts +86 -0
  19. package/vscode/typings/vscode.comments.d.ts +292 -0
  20. package/vscode/typings/vscode.d.ts +3789 -0
  21. package/vscode/typings/vscode.debug.d.ts +684 -0
  22. package/vscode/typings/vscode.doc.d.ts +272 -0
  23. package/vscode/typings/vscode.editor.d.ts +1017 -0
  24. package/vscode/typings/vscode.env.d.ts +153 -0
  25. package/vscode/typings/vscode.extension.d.ts +67 -0
  26. package/vscode/typings/vscode.language.d.ts +2630 -0
  27. package/vscode/typings/vscode.message.d.ts +195 -0
  28. package/vscode/typings/vscode.proposed.d.ts +662 -0
  29. package/vscode/typings/vscode.quickpick.d.ts +491 -0
  30. package/vscode/typings/vscode.scm.d.ts +254 -0
  31. package/vscode/typings/vscode.tasks.d.ts +676 -0
  32. package/vscode/typings/vscode.theme.d.ts +370 -0
  33. package/vscode/typings/vscode.window.d.ts +870 -0
  34. package/vscode/typings/vscode.workspace.d.ts +664 -0
  35. package/vscode/typings-pending/vscode.d.ts +27 -0
  36. package/vscode/typings-pending/vscode.proposed.d.ts +3 -0
  37. package/vscode.d.ts +23 -0
@@ -0,0 +1,273 @@
1
+ interface IComponentMethod {
2
+ [methodName: string]: any; // Function
3
+ }
4
+
5
+ interface IComponentProps<N, W = any> {
6
+ kaitianExtendSet: {
7
+ set<T = IComponentMethod>(methods: T): void;
8
+ };
9
+ kaitianExtendService: {
10
+ node: N;
11
+ worker: W;
12
+ };
13
+ viewState?: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ }
18
+
19
+ /**
20
+ * @deprecated `katian-browser` is deprecated. Please use `sumi-browser` instead.
21
+ */
22
+ declare module 'kaitian-browser' {
23
+ export * from 'sumi-browser';
24
+ }
25
+
26
+ declare module 'sumi-browser' {
27
+ export * from '@opensumi/ide-components';
28
+
29
+ import type vscode from 'vscode';
30
+ import React from 'react';
31
+
32
+ import { ROTATE_TYPE, ANIM_TYPE } from '@opensumi/ide-components';
33
+
34
+ export { URI } from '@opensumi/ide-core-browser';
35
+
36
+ export interface ScrollAreaProps {
37
+ className?: string;
38
+ onScroll?: (position: ScrollPosition) => any;
39
+ atTopClassName?: string;
40
+ style?: any;
41
+ containerStyle?: any;
42
+ }
43
+
44
+ export interface ScrollPosition {
45
+ top: number;
46
+ left: number;
47
+ }
48
+ export class Scroll extends React.Component<ScrollAreaProps, any> {
49
+
50
+ }
51
+
52
+ export interface ResizeHandleProps {
53
+ onFinished?: () => void;
54
+ onResize?: () => void;
55
+ max?: number;
56
+ min?: number;
57
+ preserve?: number;
58
+ className?: string;
59
+ delegate?: (delegate: IResizeHandleDelegate) => void;
60
+ }
61
+ export interface IResizeHandleDelegate {
62
+ setSize(prev: number, next: number): void;
63
+ }
64
+ export const ResizeHandleHorizontal: React.ComponentType<ResizeHandleProps>;
65
+ export const ResizeHandleVertical: React.ComponentType<ResizeHandleProps>;
66
+
67
+ export const PlainWebview: React.ComponentType<{ id: string, appendToChild?: boolean, renderRoot?: HTMLElement }>;
68
+
69
+ // scope 目前不是必要的,可以直接从 extension 拿到 id
70
+ // 为了兼容已经在使用的插件,暂时先保留声明
71
+ export function localize(key: string, defaultMessage?: string, scope?: string): string;
72
+
73
+ /**
74
+ * 格式化国际化文案
75
+ * @example
76
+ * ```js
77
+ * kaitian.formatLocalize('task.label', '任务', '运行');
78
+ * ```
79
+ */
80
+ export function formatLocalize(key: string, ...args: string[]): string;
81
+
82
+ export function getIcon(iconKey: string, options?: { rotate?: ROTATE_TYPE, anim?: ANIM_TYPE }): string;
83
+
84
+ /**
85
+ * 获得当前主题的颜色值
86
+ * 格式 '-分割的颜色名':'颜色值(rgb, rgba或hex)'
87
+ * @example
88
+ * ```json
89
+ * {
90
+ * 'editor-background':'#000000',
91
+ * }
92
+ * ```
93
+ */
94
+ export function getThemeColors(): { [key: string]: string };
95
+
96
+ export enum ToolBarPosition {
97
+ /**
98
+ * 左边
99
+ */
100
+ LEFT = 1,
101
+ /**
102
+ * 中间
103
+ */
104
+ CENTER = 2,
105
+ /**
106
+ * 右边
107
+ */
108
+ RIGHT = 3,
109
+ }
110
+
111
+ export type ISumiBrowserConfig = IKaitianBrowserConfig;
112
+ /**
113
+ * @deprecated `IKaitianBrowserConfig` was renamed to `ISumiBrowserConfig`, use that instead.
114
+ */
115
+ export interface IKaitianBrowserConfig {
116
+ left?: {
117
+ component: ITabBarComponentContribution[];
118
+ };
119
+ right?: {
120
+ component: ITabBarComponentContribution[];
121
+ };
122
+ bottom?: {
123
+ component: ITabBarComponentContribution[];
124
+ };
125
+ editor?: {
126
+ component: IEditorComponentContribution[];
127
+ };
128
+ toolBar?: {
129
+ position?: ToolBarPosition;
130
+ component: IToolBarComponentContribution[];
131
+ };
132
+ }
133
+
134
+ export interface IToolBarComponentContribution {
135
+ /**
136
+ * id
137
+ */
138
+ id: string;
139
+ /**
140
+ * ToolBar 组件主体
141
+ */
142
+ panel: React.ComponentType;
143
+ /**
144
+ * 位置
145
+ */
146
+ position: ToolBarPosition;
147
+ }
148
+ export interface ITabBarComponentContribution {
149
+ /**
150
+ * id
151
+ */
152
+ id: string;
153
+ /**
154
+ * Tabbar组件主体
155
+ */
156
+ panel: React.ComponentType;
157
+ /**
158
+ * 内置icon名称
159
+ */
160
+ icon?: string;
161
+ /**
162
+ * 相对于插件路径的icon地址
163
+ */
164
+ iconPath?: string;
165
+ /**
166
+ * 用于激活的快捷键
167
+ */
168
+ keyBinding?: string;
169
+ /**
170
+ * 名称
171
+ */
172
+ title: string;
173
+ /**
174
+ * 排序权重
175
+ */
176
+ priority?: number;
177
+ /**
178
+ * 禁止面板的resize功能
179
+ */
180
+ noResize?: boolean;
181
+ /**
182
+ * 是否全部展开
183
+ */
184
+ expanded?: boolean;
185
+ }
186
+
187
+ export enum EditorComponentRenderMode {
188
+ ONE_PER_RESOURCE = 1, // 每个resource渲染一个新的
189
+ ONE_PER_GROUP = 2, // 每个Group最多存在一个新的
190
+ ONE_PER_WORKBENCH = 3, // 整个IDE只有一个, 视图会被重用
191
+ }
192
+
193
+ export interface IEditorComponentContribution {
194
+ /**
195
+ * id
196
+ */
197
+ id: string;
198
+ /**
199
+ * 适配的scheme, 如果不填,默认为file协议
200
+ */
201
+ scheme?: string;
202
+ /**
203
+ * editor组件主体
204
+ */
205
+ panel: React.ComponentType;
206
+ /**
207
+ * 渲染方式
208
+ */
209
+ renderMode?: EditorComponentRenderMode;
210
+ /**
211
+ * 仅作用于file协议
212
+ * 要处理的文件的后缀
213
+ */
214
+ fileExt?: string[];
215
+ /**
216
+ * 仅作用于file协议
217
+ * 判断一个path是否要被处理
218
+ * @deprecated
219
+ */
220
+ // shouldPreview?: (path: Path) => boolean;
221
+ /**
222
+ * 判断一个uri是否要被处理(传入参数为vscode uri)
223
+ * 如果不存在handles方法,则默认显示(file协议还要过shouldPreview和fileExt)
224
+ */
225
+ handles?: (uri: vscode.Uri) => boolean;
226
+ /**
227
+ * 如果这个资源有多个打开方式,这个会作为打开方式名称
228
+ */
229
+ title?: string;
230
+ /**
231
+ * 排序权重, 默认为10
232
+ */
233
+ priority?: number;
234
+ /**
235
+ * Tab名称,如果需要更复杂的名称Resolve,需要在kaitian node进程中注册ResourceProvider
236
+ */
237
+ tabTitle?: string;
238
+ /**
239
+ * 相对于插件路径的icon地址
240
+ * 如果需要更复杂的图标Resolve,需要在kaitian node进程中注册ResourceProvider
241
+ */
242
+ tabIconPath?: string;
243
+ }
244
+ export namespace commands {
245
+
246
+ /**
247
+ * Executes the command denoted by the given command identifier.
248
+ *
249
+ * * *Note 1:* When executing an editor command not all types are allowed to
250
+ * be passed as arguments. Allowed are the primitive types `string`, `boolean`,
251
+ * `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
252
+ * * *Note 2:* There are no restrictions when executing commands that have been contributed
253
+ * by extensions.
254
+ * * *Note 3:* Can not execute some builtin commands.
255
+ *
256
+ * @param command Identifier of the command to execute.
257
+ * @param rest Parameters passed to the command function.
258
+ * @return A promise that resolves to the returned value of the given command. `undefined` when
259
+ * the command handler function doesn't return anything.
260
+ */
261
+ export function executeCommand<T>(command: string, ...rest: any[]): Promise<T | undefined>;
262
+ }
263
+
264
+ export interface IReporterTimer {
265
+ timeEnd(msg?: string, extra?: any): number;
266
+ }
267
+
268
+ export namespace reporter {
269
+ export function time(name: string): IReporterTimer;
270
+ export function point(name: string, msg?: string, extra?: any): void;
271
+ }
272
+
273
+ }