modern-monaco 0.0.0-beta.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/LICENSE +21 -0
- package/README.md +359 -0
- package/dist/cache.js +94 -0
- package/dist/editor-core.js +177856 -0
- package/dist/editor-worker.js +13528 -0
- package/dist/index.js +635 -0
- package/dist/lsp/css/setup.js +43 -0
- package/dist/lsp/css/worker.js +40804 -0
- package/dist/lsp/html/setup.js +90 -0
- package/dist/lsp/html/worker.js +16632 -0
- package/dist/lsp/json/setup.js +258 -0
- package/dist/lsp/json/worker.js +7964 -0
- package/dist/lsp/language-service.js +2244 -0
- package/dist/lsp/typescript/libs.js +100 -0
- package/dist/lsp/typescript/setup.js +425 -0
- package/dist/lsp/typescript/worker.js +2858 -0
- package/dist/onig.wasm +0 -0
- package/dist/shiki-wasm.js +9 -0
- package/dist/shiki.js +8744 -0
- package/dist/ssr/index.js +47 -0
- package/dist/ssr/workerd.js +46 -0
- package/dist/util.js +192 -0
- package/dist/workspace.js +611 -0
- package/package.json +67 -0
- package/types/cache.d.ts +7 -0
- package/types/index.d.ts +47 -0
- package/types/jsonSchema.d.ts +90 -0
- package/types/lsp.d.ts +106 -0
- package/types/monaco.d.ts +8284 -0
- package/types/ssr.d.ts +14 -0
- package/types/textmate.d.ts +2 -0
- package/types/vscode.d.ts +303 -0
- package/types/workspace.d.ts +74 -0
package/types/ssr.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type monacoNS from "./monaco.d.ts";
|
|
2
|
+
import type { ShikiInitOptions } from "./index.d.ts";
|
|
3
|
+
|
|
4
|
+
export interface RenderOptions extends monacoNS.editor.IStandaloneEditorConstructionOptions {
|
|
5
|
+
code: string;
|
|
6
|
+
filename?: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
userAgent?: string;
|
|
9
|
+
fontAspectRatio?: number;
|
|
10
|
+
shiki?: ShikiInitOptions;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function renderToString(options: RenderOptions): Promise<string>;
|
|
14
|
+
export function renderToWebComponent(options: RenderOptions): Promise<string>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type TextmateThemeName = "andromeeda" | "aurora-x" | "ayu-dark" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula" | "dracula-soft" | "everforest-dark" | "everforest-light" | "github-dark" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light" | "github-light-default" | "github-light-high-contrast" | "gruvbox-dark-hard" | "gruvbox-dark-medium" | "gruvbox-dark-soft" | "gruvbox-light-hard" | "gruvbox-light-medium" | "gruvbox-light-soft" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "night-owl" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light";
|
|
2
|
+
export type TextmateGrammarName = "abap" | "actionscript-3" | "ada" | "angular-html" | "angular-ts" | "apache" | "apex" | "apl" | "applescript" | "ara" | "asciidoc" | "asm" | "astro" | "awk" | "ballerina" | "bat" | "beancount" | "berry" | "bibtex" | "bicep" | "blade" | "bsl" | "c" | "cadence" | "cairo" | "clarity" | "clojure" | "cmake" | "cobol" | "codeowners" | "codeql" | "coffee" | "common-lisp" | "coq" | "cpp" | "crystal" | "csharp" | "css" | "csv" | "cue" | "cypher" | "d" | "dart" | "dax" | "desktop" | "diff" | "docker" | "dotenv" | "dream-maker" | "edge" | "elixir" | "elm" | "emacs-lisp" | "erb" | "erlang" | "fennel" | "fish" | "fluent" | "fortran-fixed-form" | "fortran-free-form" | "fsharp" | "gdresource" | "gdscript" | "gdshader" | "genie" | "gherkin" | "git-commit" | "git-rebase" | "gleam" | "glimmer-js" | "glimmer-ts" | "glsl" | "gnuplot" | "go" | "graphql" | "groovy" | "hack" | "haml" | "handlebars" | "haskell" | "haxe" | "hcl" | "hjson" | "hlsl" | "html" | "html-derivative" | "http" | "hxml" | "hy" | "imba" | "ini" | "java" | "javascript" | "jinja" | "jison" | "json" | "json5" | "jsonc" | "jsonl" | "jsonnet" | "jssm" | "jsx" | "julia" | "kotlin" | "kusto" | "latex" | "lean" | "less" | "liquid" | "llvm" | "log" | "logo" | "lua" | "luau" | "make" | "markdown" | "marko" | "matlab" | "mdc" | "mdx" | "mermaid" | "mipsasm" | "mojo" | "move" | "narrat" | "nextflow" | "nginx" | "nim" | "nix" | "nushell" | "objective-c" | "objective-cpp" | "ocaml" | "pascal" | "perl" | "php" | "plsql" | "po" | "polar" | "postcss" | "powerquery" | "powershell" | "prisma" | "prolog" | "proto" | "pug" | "puppet" | "purescript" | "python" | "qml" | "qmldir" | "qss" | "r" | "racket" | "raku" | "razor" | "reg" | "regexp" | "rel" | "riscv" | "rst" | "ruby" | "rust" | "sas" | "sass" | "scala" | "scheme" | "scss" | "sdbl" | "shaderlab" | "shellscript" | "shellsession" | "smalltalk" | "solidity" | "soy" | "sparql" | "splunk" | "sql" | "ssh-config" | "stata" | "stylus" | "svelte" | "swift" | "system-verilog" | "systemd" | "talonscript" | "tasl" | "tcl" | "templ" | "terraform" | "tex" | "toml" | "ts-tags" | "tsv" | "tsx" | "turtle" | "twig" | "typescript" | "typespec" | "typst" | "v" | "vala" | "vb" | "verilog" | "vhdl" | "viml" | "vue" | "vue-html" | "vyper" | "wasm" | "wenyan" | "wgsl" | "wikitext" | "wit" | "wolfram" | "xml" | "xsl" | "yaml" | "zenscript" | "zig";
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
import type { CancellationToken } from "./monaco.d.ts";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Impacts the behavior and appearance of the validation message.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The severity level for input box validation.
|
|
13
|
+
*/
|
|
14
|
+
export enum InputBoxValidationSeverity {
|
|
15
|
+
/**
|
|
16
|
+
* Informational severity level.
|
|
17
|
+
*/
|
|
18
|
+
Info = 1,
|
|
19
|
+
/**
|
|
20
|
+
* Warning severity level.
|
|
21
|
+
*/
|
|
22
|
+
Warning = 2,
|
|
23
|
+
/**
|
|
24
|
+
* Error severity level.
|
|
25
|
+
*/
|
|
26
|
+
Error = 3,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Object to configure the behavior of the validation message.
|
|
31
|
+
*/
|
|
32
|
+
export interface InputBoxValidationMessage {
|
|
33
|
+
/**
|
|
34
|
+
* The validation message to display.
|
|
35
|
+
*/
|
|
36
|
+
readonly message: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The severity of the validation message.
|
|
40
|
+
* NOTE: When using `InputBoxValidationSeverity.Error`, the user will not be allowed to accept (hit ENTER) the input.
|
|
41
|
+
* `Info` and `Warning` will still allow the InputBox to accept the input.
|
|
42
|
+
*/
|
|
43
|
+
readonly severity: InputBoxValidationSeverity;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Options to configure the behavior of the input box UI.
|
|
48
|
+
*/
|
|
49
|
+
export interface InputBoxOptions {
|
|
50
|
+
/**
|
|
51
|
+
* An optional string that represents the title of the input box.
|
|
52
|
+
*/
|
|
53
|
+
title?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The value to pre-fill in the input box.
|
|
57
|
+
*/
|
|
58
|
+
value?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Selection of the pre-filled {@linkcode InputBoxOptions.value value}. Defined as tuple of two number where the
|
|
62
|
+
* first is the inclusive start index and the second the exclusive end index. When `undefined` the whole
|
|
63
|
+
* pre-filled value will be selected, when empty (start equals end) only the cursor will be set,
|
|
64
|
+
* otherwise the defined range will be selected.
|
|
65
|
+
*/
|
|
66
|
+
valueSelection?: [number, number];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The text to display underneath the input box.
|
|
70
|
+
*/
|
|
71
|
+
prompt?: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* An optional string to show as placeholder in the input box to guide the user what to type.
|
|
75
|
+
*/
|
|
76
|
+
placeHolder?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Controls if a password input is shown. Password input hides the typed text.
|
|
80
|
+
*/
|
|
81
|
+
password?: boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set to `true` to keep the input box open when focus moves to another part of the editor or to another window.
|
|
85
|
+
* This setting is ignored on iPad and is always false.
|
|
86
|
+
*/
|
|
87
|
+
ignoreFocusOut?: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* An optional function that will be called to validate input and to give a hint
|
|
91
|
+
* to the user.
|
|
92
|
+
*
|
|
93
|
+
* @param value The current value of the input box.
|
|
94
|
+
* @returns Either a human-readable string which is presented as an error message or an {@link InputBoxValidationMessage}
|
|
95
|
+
* which can provide a specific message severity. Return `undefined`, `null`, or the empty string when 'value' is valid.
|
|
96
|
+
*/
|
|
97
|
+
validateInput?(
|
|
98
|
+
value: string,
|
|
99
|
+
): string | InputBoxValidationMessage | undefined | null | Promise<string | InputBoxValidationMessage | undefined | null>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Opens an input box to ask the user for input.
|
|
104
|
+
*
|
|
105
|
+
* The returned value will be `undefined` if the input box was canceled (e.g. pressing ESC). Otherwise the
|
|
106
|
+
* returned value will be the string typed by the user or an empty string if the user did not type
|
|
107
|
+
* anything but dismissed the input box with OK.
|
|
108
|
+
*
|
|
109
|
+
* @param options Configures the behavior of the input box.
|
|
110
|
+
* @param token A token that can be used to signal cancellation.
|
|
111
|
+
* @returns A promise that resolves to a string the user provided or to `undefined` in case of dismissal.
|
|
112
|
+
*/
|
|
113
|
+
export function showInputBox(options?: InputBoxOptions, token?: CancellationToken): Promise<string | undefined>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The kind of {@link QuickPickItem quick pick item}.
|
|
117
|
+
*/
|
|
118
|
+
export enum QuickPickItemKind {
|
|
119
|
+
/**
|
|
120
|
+
* When a {@link QuickPickItem} has a kind of {@link Separator}, the item is just a visual separator and does not represent a real item.
|
|
121
|
+
* The only property that applies is {@link QuickPickItem.label label }. All other properties on {@link QuickPickItem} will be ignored and have no effect.
|
|
122
|
+
*/
|
|
123
|
+
Separator = -1,
|
|
124
|
+
/**
|
|
125
|
+
* The default {@link QuickPickItem.kind} is an item that can be selected in the quick pick.
|
|
126
|
+
*/
|
|
127
|
+
Default = 0,
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Represents an item that can be selected from
|
|
132
|
+
* a list of items.
|
|
133
|
+
*/
|
|
134
|
+
export interface QuickPickItem {
|
|
135
|
+
/**
|
|
136
|
+
* A human-readable string which is rendered prominent. Supports rendering of {@link ThemeIcon theme icons} via
|
|
137
|
+
* the `$(<name>)`-syntax.
|
|
138
|
+
*/
|
|
139
|
+
label: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The kind of QuickPickItem that will determine how this item is rendered in the quick pick. When not specified,
|
|
143
|
+
* the default is {@link QuickPickItemKind.Default}.
|
|
144
|
+
*/
|
|
145
|
+
kind?: QuickPickItemKind;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The icon path or {@link ThemeIcon} for the QuickPickItem.
|
|
149
|
+
*/
|
|
150
|
+
// iconPath?: Uri | {
|
|
151
|
+
// /**
|
|
152
|
+
// * The icon path for the light theme.
|
|
153
|
+
// */
|
|
154
|
+
// light: Uri;
|
|
155
|
+
// /**
|
|
156
|
+
// * The icon path for the dark theme.
|
|
157
|
+
// */
|
|
158
|
+
// dark: Uri;
|
|
159
|
+
// } | ThemeIcon;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* A human-readable string which is rendered less prominent in the same line. Supports rendering of
|
|
163
|
+
* {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.
|
|
164
|
+
*
|
|
165
|
+
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
|
166
|
+
*/
|
|
167
|
+
description?: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A human-readable string which is rendered less prominent in a separate line. Supports rendering of
|
|
171
|
+
* {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.
|
|
172
|
+
*
|
|
173
|
+
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
|
174
|
+
*/
|
|
175
|
+
detail?: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Optional flag indicating if this item is picked initially. This is only honored when using
|
|
179
|
+
* the {@link window.showQuickPick showQuickPick()} API. To do the same thing with
|
|
180
|
+
* the {@link window.createQuickPick createQuickPick()} API, simply set the {@link QuickPick.selectedItems}
|
|
181
|
+
* to the items you want picked initially.
|
|
182
|
+
* (*Note:* This is only honored when the picker allows multiple selections.)
|
|
183
|
+
*
|
|
184
|
+
* @see {@link QuickPickOptions.canPickMany}
|
|
185
|
+
*
|
|
186
|
+
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
|
187
|
+
*/
|
|
188
|
+
picked?: boolean;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Always show this item.
|
|
192
|
+
*
|
|
193
|
+
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
|
194
|
+
*/
|
|
195
|
+
alwaysShow?: boolean;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Optional buttons that will be rendered on this particular item. These buttons will trigger
|
|
199
|
+
* an {@link QuickPickItemButtonEvent} when clicked. Buttons are only rendered when using a quickpick
|
|
200
|
+
* created by the {@link window.createQuickPick createQuickPick()} API. Buttons are not rendered when using
|
|
201
|
+
* the {@link window.showQuickPick showQuickPick()} API.
|
|
202
|
+
*
|
|
203
|
+
* Note: this property is ignored when {@link QuickPickItem.kind kind} is set to {@link QuickPickItemKind.Separator}
|
|
204
|
+
*/
|
|
205
|
+
// buttons?: readonly QuickInputButton[];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Options to configure the behavior of the quick pick UI.
|
|
210
|
+
*/
|
|
211
|
+
export interface QuickPickOptions {
|
|
212
|
+
/**
|
|
213
|
+
* An optional string that represents the title of the quick pick.
|
|
214
|
+
*/
|
|
215
|
+
title?: string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* An optional flag to include the description when filtering the picks.
|
|
219
|
+
*/
|
|
220
|
+
matchOnDescription?: boolean;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* An optional flag to include the detail when filtering the picks.
|
|
224
|
+
*/
|
|
225
|
+
matchOnDetail?: boolean;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* An optional string to show as placeholder in the input box to guide the user what to pick on.
|
|
229
|
+
*/
|
|
230
|
+
placeHolder?: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Set to `true` to keep the picker open when focus moves to another part of the editor or to another window.
|
|
234
|
+
* This setting is ignored on iPad and is always false.
|
|
235
|
+
*/
|
|
236
|
+
ignoreFocusOut?: boolean;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* An optional flag to make the picker accept multiple selections, if true the result is an array of picks.
|
|
240
|
+
*/
|
|
241
|
+
canPickMany?: boolean;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* An optional function that is invoked whenever an item is selected.
|
|
245
|
+
*/
|
|
246
|
+
onDidSelectItem?(item: QuickPickItem | string): any;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Shows a selection list allowing multiple selections.
|
|
251
|
+
*
|
|
252
|
+
* @param items An array of strings, or a promise that resolves to an array of strings.
|
|
253
|
+
* @param options Configures the behavior of the selection list.
|
|
254
|
+
* @param token A token that can be used to signal cancellation.
|
|
255
|
+
* @returns A promise that resolves to the selected items or `undefined`.
|
|
256
|
+
*/
|
|
257
|
+
export function showQuickPick(
|
|
258
|
+
items: readonly string[] | Promise<readonly string[]>,
|
|
259
|
+
options: QuickPickOptions & { /** literal-type defines return type */ canPickMany: true },
|
|
260
|
+
token?: CancellationToken,
|
|
261
|
+
): Promise<string[] | undefined>;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Shows a selection list.
|
|
265
|
+
*
|
|
266
|
+
* @param items An array of strings, or a promise that resolves to an array of strings.
|
|
267
|
+
* @param options Configures the behavior of the selection list.
|
|
268
|
+
* @param token A token that can be used to signal cancellation.
|
|
269
|
+
* @returns A promise that resolves to the selection or `undefined`.
|
|
270
|
+
*/
|
|
271
|
+
export function showQuickPick(
|
|
272
|
+
items: readonly string[] | Promise<readonly string[]>,
|
|
273
|
+
options?: QuickPickOptions,
|
|
274
|
+
token?: CancellationToken,
|
|
275
|
+
): Promise<string | undefined>;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Shows a selection list allowing multiple selections.
|
|
279
|
+
*
|
|
280
|
+
* @param items An array of items, or a promise that resolves to an array of items.
|
|
281
|
+
* @param options Configures the behavior of the selection list.
|
|
282
|
+
* @param token A token that can be used to signal cancellation.
|
|
283
|
+
* @returns A promise that resolves to the selected items or `undefined`.
|
|
284
|
+
*/
|
|
285
|
+
export function showQuickPick<T extends QuickPickItem>(
|
|
286
|
+
items: readonly T[] | Promise<readonly T[]>,
|
|
287
|
+
options: QuickPickOptions & { /** literal-type defines return type */ canPickMany: true },
|
|
288
|
+
token?: CancellationToken,
|
|
289
|
+
): Promise<T[] | undefined>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Shows a selection list.
|
|
293
|
+
*
|
|
294
|
+
* @param items An array of items, or a promise that resolves to an array of items.
|
|
295
|
+
* @param options Configures the behavior of the selection list.
|
|
296
|
+
* @param token A token that can be used to signal cancellation.
|
|
297
|
+
* @returns A promise that resolves to the selected item or `undefined`.
|
|
298
|
+
*/
|
|
299
|
+
export function showQuickPick<T extends QuickPickItem>(
|
|
300
|
+
items: readonly T[] | Promise<readonly T[]>,
|
|
301
|
+
options?: QuickPickOptions,
|
|
302
|
+
token?: CancellationToken,
|
|
303
|
+
): Promise<T | undefined>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { editor } from "./monaco.d.ts";
|
|
2
|
+
import type { showInputBox, showQuickPick } from "./vscode.d.ts";
|
|
3
|
+
|
|
4
|
+
export interface WorkspaceInit {
|
|
5
|
+
/** name of the workspace. */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** initial files in the workspace */
|
|
8
|
+
initialFiles?: Record<string, string | Uint8Array>;
|
|
9
|
+
/** file to open when the editor is loaded at first time */
|
|
10
|
+
entryFile?: string;
|
|
11
|
+
/** whether to use browser history for navigation. */
|
|
12
|
+
browserHistory?: boolean | { basePath: string };
|
|
13
|
+
/** whether to use a server for the workspace. */
|
|
14
|
+
server?: {
|
|
15
|
+
url: string | URL;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class Workspace {
|
|
20
|
+
constructor(options?: WorkspaceInit);
|
|
21
|
+
readonly entryFile?: string;
|
|
22
|
+
readonly fs: FileSystem;
|
|
23
|
+
readonly history: WorkspaceHistory;
|
|
24
|
+
readonly viewState: WorkspaceViewState;
|
|
25
|
+
openTextDocument(uri: string | URL, content?: string): Promise<editor.ITextModel>;
|
|
26
|
+
showInputBox: typeof showInputBox;
|
|
27
|
+
showQuickPick: typeof showQuickPick;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface WorkspaceViewState {
|
|
31
|
+
get(uri: string | URL): Promise<editor.ICodeEditorViewState | undefined>;
|
|
32
|
+
save(uri: string | URL, viewState: editor.ICodeEditorViewState): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface WorkspaceHistoryState {
|
|
36
|
+
readonly current: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface WorkspaceHistory {
|
|
40
|
+
readonly state: WorkspaceHistoryState;
|
|
41
|
+
back(): void;
|
|
42
|
+
forward(): void;
|
|
43
|
+
push(path: string): void;
|
|
44
|
+
replace(path: string): void;
|
|
45
|
+
onChange(callback: (state: WorkspaceHistoryState) => void): () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface FileStat {
|
|
49
|
+
readonly type: number; // 0: unknown, 1: file, 2: directory, 64: symlink
|
|
50
|
+
readonly ctime: number;
|
|
51
|
+
readonly mtime: number;
|
|
52
|
+
readonly version: number;
|
|
53
|
+
readonly size: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface FileSystem {
|
|
57
|
+
copy(source: string, target: string, options?: { overwrite: boolean }): Promise<void>;
|
|
58
|
+
createDirectory(dir: string): Promise<void>;
|
|
59
|
+
delete(filename: string, options?: { recursive: boolean }): Promise<void>;
|
|
60
|
+
readDirectory(filename: string): Promise<[string, number][]>;
|
|
61
|
+
readFile(filename: string): Promise<Uint8Array>;
|
|
62
|
+
readTextFile(filename: string): Promise<string>;
|
|
63
|
+
rename(oldName: string, newName: string, options?: { overwrite: boolean }): Promise<void>;
|
|
64
|
+
stat(filename: string): Promise<FileStat>;
|
|
65
|
+
writeFile(filename: string, content: string | Uint8Array): Promise<void>;
|
|
66
|
+
watch(filename: string, options: { recursive: boolean }, handle: FileSystemWatchHandle): () => void;
|
|
67
|
+
watch(filename: string, handle: FileSystemWatchHandle): () => void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface FileSystemWatchHandle {
|
|
71
|
+
(kind: "create" | "modify" | "remove", filename: string, type?: number): void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class ErrorNotFound extends Error {}
|