@opensumi/sumi 2.12.1-next-079c1930 → 2.13.3

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/sumi-browser.d.ts CHANGED
@@ -28,10 +28,120 @@ declare module 'sumi-browser' {
28
28
 
29
29
  import type vscode from 'vscode';
30
30
  import React from 'react';
31
+ import { URI as Uri } from 'vscode-uri';
31
32
 
32
33
  import { ROTATE_TYPE, ANIM_TYPE } from '@opensumi/ide-components';
33
34
 
34
- export { URI } from '@opensumi/ide-core-browser';
35
+ interface IRelativePattern {
36
+ base: string;
37
+ pattern: string;
38
+ }
39
+ class Path {
40
+ static separator: '/';
41
+ static isDrive(segment: string): boolean;
42
+ static splitPath(path: string): string[];
43
+ static isRelative(path: string): boolean;
44
+ static pathDepth(path: string): number;
45
+ static normalizeDrive(path: string): string;
46
+ readonly isAbsolute: boolean;
47
+ readonly isRoot: boolean;
48
+ readonly root: Path | undefined;
49
+ readonly base: string;
50
+ readonly name: string;
51
+ readonly ext: string;
52
+ private _dir;
53
+ private readonly raw;
54
+ constructor(raw: string);
55
+ protected computeRoot(): Path | undefined;
56
+ get dir(): Path;
57
+ protected computeDir(): Path;
58
+ join(...paths: string[]): Path;
59
+ toString(): string;
60
+ relative(path: Path): Path | undefined;
61
+ isEqualOrParent(path: Path): boolean;
62
+ isEqual(path: Path): boolean;
63
+ relativity(path: Path): number;
64
+ }
65
+ export class URI {
66
+ static from(components: {
67
+ scheme: string;
68
+ authority?: string;
69
+ path?: string;
70
+ query?: string;
71
+ fragment?: string;
72
+ }): URI;
73
+ static file(path: string): URI;
74
+ static parse(path: string): URI;
75
+ static isUri(thing: any): thing is URI;
76
+ static isUriString(str: string): boolean;
77
+ static revive(data: any): Uri;
78
+ readonly codeUri: Uri;
79
+ private _path;
80
+ constructor(uri?: string | Uri);
81
+ get displayName(): string;
82
+ /**
83
+ * Return all uri from the current to the top most.
84
+ */
85
+ get allLocations(): URI[];
86
+ get parent(): URI;
87
+ relative(uri: URI): Path | undefined;
88
+ resolve(path: string | Path): URI;
89
+ /**
90
+ * return a new URI replacing the current with the given scheme
91
+ */
92
+ withScheme(scheme: string): URI;
93
+ /**
94
+ * @deprecated
95
+ * return this URI without a scheme
96
+ */
97
+ withoutScheme(): URI;
98
+ /**
99
+ * return a new URI replacing the current with the given authority
100
+ */
101
+ withAuthority(authority: string): URI;
102
+ /**
103
+ * return this URI without a authority
104
+ */
105
+ withoutAuthority(): URI;
106
+ /**
107
+ * return a new URI replacing the current with the given path
108
+ */
109
+ withPath(path: string | Path): URI;
110
+ /**
111
+ * return this URI without a path
112
+ */
113
+ withoutPath(): URI;
114
+ /**
115
+ * return a new URI replacing the current with the given query
116
+ */
117
+ withQuery(query: string): URI;
118
+ /**
119
+ * return this URI without a query
120
+ */
121
+ withoutQuery(): URI;
122
+ /**
123
+ * return a new URI replacing the current with the given fragment
124
+ */
125
+ withFragment(fragment: string): URI;
126
+ /**
127
+ * return this URI without a fragment
128
+ */
129
+ withoutFragment(): URI;
130
+ get scheme(): string;
131
+ get authority(): string;
132
+ get path(): Path;
133
+ get query(): string;
134
+ get fragment(): string;
135
+ toString(skipEncoding?: boolean): string;
136
+ isEqualOrParent(uri: URI): boolean;
137
+ isEqual(uri: URI): boolean;
138
+ matchGlobPattern(pattern: string | IRelativePattern): boolean;
139
+ static getDistinctParents(uris: URI[]): URI[];
140
+ getParsedQuery(): {
141
+ [key: string]: string;
142
+ };
143
+ static stringifyQuery(query: { [key: string]: any }): string;
144
+ }
35
145
 
36
146
  export interface ScrollAreaProps {
37
147
  className?: string;
@@ -45,9 +155,7 @@ declare module 'sumi-browser' {
45
155
  top: number;
46
156
  left: number;
47
157
  }
48
- export class Scroll extends React.Component<ScrollAreaProps, any> {
49
-
50
- }
158
+ export class Scroll extends React.Component<ScrollAreaProps, any> {}
51
159
 
52
160
  export interface ResizeHandleProps {
53
161
  onFinished?: () => void;
@@ -64,7 +172,7 @@ declare module 'sumi-browser' {
64
172
  export const ResizeHandleHorizontal: React.ComponentType<ResizeHandleProps>;
65
173
  export const ResizeHandleVertical: React.ComponentType<ResizeHandleProps>;
66
174
 
67
- export const PlainWebview: React.ComponentType<{ id: string, appendToChild?: boolean, renderRoot?: HTMLElement }>;
175
+ export const PlainWebview: React.ComponentType<{ id: string; appendToChild?: boolean; renderRoot?: HTMLElement }>;
68
176
 
69
177
  // scope 目前不是必要的,可以直接从 extension 拿到 id
70
178
  // 为了兼容已经在使用的插件,暂时先保留声明
@@ -79,7 +187,7 @@ declare module 'sumi-browser' {
79
187
  */
80
188
  export function formatLocalize(key: string, ...args: string[]): string;
81
189
 
82
- export function getIcon(iconKey: string, options?: { rotate?: ROTATE_TYPE, anim?: ANIM_TYPE }): string;
190
+ export function getIcon(iconKey: string, options?: { rotate?: ROTATE_TYPE; anim?: ANIM_TYPE }): string;
83
191
 
84
192
  /**
85
193
  * 获得当前主题的颜色值
@@ -236,28 +344,27 @@ declare module 'sumi-browser' {
236
344
  */
237
345
  tabTitle?: string;
238
346
  /**
239
- * 相对于插件路径的icon地址
240
- * 如果需要更复杂的图标Resolve,需要在kaitian node进程中注册ResourceProvider
241
- */
347
+ * 相对于插件路径的icon地址
348
+ * 如果需要更复杂的图标Resolve,需要在kaitian node进程中注册ResourceProvider
349
+ */
242
350
  tabIconPath?: string;
243
351
  }
244
352
  export namespace commands {
245
-
246
353
  /**
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
- */
354
+ * Executes the command denoted by the given command identifier.
355
+ *
356
+ * * *Note 1:* When executing an editor command not all types are allowed to
357
+ * be passed as arguments. Allowed are the primitive types `string`, `boolean`,
358
+ * `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
359
+ * * *Note 2:* There are no restrictions when executing commands that have been contributed
360
+ * by extensions.
361
+ * * *Note 3:* Can not execute some builtin commands.
362
+ *
363
+ * @param command Identifier of the command to execute.
364
+ * @param rest Parameters passed to the command function.
365
+ * @return A promise that resolves to the returned value of the given command. `undefined` when
366
+ * the command handler function doesn't return anything.
367
+ */
261
368
  export function executeCommand<T>(command: string, ...rest: any[]): Promise<T | undefined>;
262
369
  }
263
370
 
@@ -269,5 +376,4 @@ declare module 'sumi-browser' {
269
376
  export function time(name: string): IReporterTimer;
270
377
  export function point(name: string, msg?: string, extra?: any): void;
271
378
  }
272
-
273
379
  }