@codingame/monaco-vscode-api 1.76.8 → 1.78.0-next.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.
Files changed (332) hide show
  1. package/README.md +87 -49
  2. package/dist/Bibtex.tmLanguage.js +2 -0
  3. package/dist/Handlebars.tmLanguage.js +2 -0
  4. package/dist/JSON.tmLanguage.js +2 -0
  5. package/dist/JSONC.tmLanguage.js +2 -0
  6. package/dist/JavaScript.tmLanguage.js +2 -0
  7. package/dist/JavaScriptReact.tmLanguage.js +2 -0
  8. package/dist/LaTeX.tmLanguage.js +2 -0
  9. package/dist/MagicPython.tmLanguage.js +2 -0
  10. package/dist/MagicRegExp.tmLanguage.js +2 -0
  11. package/dist/Red-color-theme.js +2 -0
  12. package/dist/Regular Expressions (JavaScript).js +2 -0
  13. package/dist/TeX.tmLanguage.js +2 -0
  14. package/dist/TypeScript.tmLanguage.js +2 -0
  15. package/dist/TypeScriptReact.tmLanguage.js +2 -0
  16. package/dist/_.contribution.js +1 -1
  17. package/dist/abyss-color-theme.js +2 -0
  18. package/dist/api.js +1 -3
  19. package/dist/api2.js +421 -18091
  20. package/dist/asp-vb-net.tmlanguage.js +2 -0
  21. package/dist/assets/diffLineDeleted.mp3 +0 -0
  22. package/dist/assets/diffLineInserted.mp3 +0 -0
  23. package/dist/assets/diffLineModified.mp3 +0 -0
  24. package/dist/audioCue.js +108 -478
  25. package/dist/bat.js +9 -0
  26. package/dist/batchfile.js +2 -0
  27. package/dist/batchfile.tmLanguage.js +2 -0
  28. package/dist/button.js +35 -8
  29. package/dist/c.js +2 -0
  30. package/dist/c.tmLanguage.js +2 -0
  31. package/dist/clojure.js +8 -0
  32. package/dist/clojure.tmLanguage.js +2 -0
  33. package/dist/coffeescript.js +9 -0
  34. package/dist/coffeescript.tmLanguage.js +2 -0
  35. package/dist/coffeescript2.js +2 -0
  36. package/dist/configuration.d.ts +269 -4
  37. package/dist/configuration.js +4326 -328
  38. package/dist/configuration2.js +14 -324
  39. package/dist/cpp-grammar-bailout.tmLanguage.js +2 -0
  40. package/dist/cpp.embedded.macro.tmLanguage.js +2 -0
  41. package/dist/cpp.js +16 -0
  42. package/dist/cpp.tmLanguage.js +2 -0
  43. package/dist/cpp2.js +2 -0
  44. package/dist/csharp.js +9 -0
  45. package/dist/csharp.tmLanguage.js +2 -0
  46. package/dist/csharp2.js +2 -0
  47. package/dist/cshtml.tmLanguage.js +2 -0
  48. package/dist/css.js +8 -0
  49. package/dist/css.tmLanguage.js +2 -0
  50. package/dist/cuda-cpp.tmLanguage.js +2 -0
  51. package/dist/dark_plus.js +2 -0
  52. package/dist/dark_plus_experimental.js +2 -0
  53. package/dist/dark_vs.js +2 -0
  54. package/dist/dart.js +8 -0
  55. package/dist/dart.tmLanguage.js +2 -0
  56. package/dist/debug.js +12115 -12209
  57. package/dist/default-extensions/bat.js +12 -0
  58. package/dist/default-extensions/clojure.js +11 -0
  59. package/dist/default-extensions/coffeescript.js +12 -0
  60. package/dist/default-extensions/cpp.js +19 -0
  61. package/dist/default-extensions/csharp.js +12 -0
  62. package/dist/default-extensions/css.js +11 -0
  63. package/dist/default-extensions/dart.js +11 -0
  64. package/dist/default-extensions/diff.js +11 -0
  65. package/dist/default-extensions/docker.js +11 -0
  66. package/dist/default-extensions/fsharp.js +12 -0
  67. package/dist/default-extensions/go.js +11 -0
  68. package/dist/default-extensions/groovy.js +12 -0
  69. package/dist/default-extensions/handlebars.js +11 -0
  70. package/dist/default-extensions/hlsl.js +11 -0
  71. package/dist/default-extensions/html.js +13 -0
  72. package/dist/default-extensions/ini.js +13 -0
  73. package/dist/default-extensions/java.js +12 -0
  74. package/dist/default-extensions/javascript.js +17 -0
  75. package/dist/default-extensions/json.js +13 -0
  76. package/dist/default-extensions/julia.js +11 -0
  77. package/dist/default-extensions/latex.js +14 -0
  78. package/dist/default-extensions/less.js +11 -0
  79. package/dist/default-extensions/log.js +10 -0
  80. package/dist/default-extensions/lua.js +11 -0
  81. package/dist/default-extensions/make.js +11 -0
  82. package/dist/default-extensions/markdown-basics.js +12 -0
  83. package/dist/default-extensions/objective-c.js +13 -0
  84. package/dist/default-extensions/perl.js +13 -0
  85. package/dist/default-extensions/php.js +13 -0
  86. package/dist/default-extensions/powershell.js +11 -0
  87. package/dist/default-extensions/pug.js +11 -0
  88. package/dist/default-extensions/python.js +12 -0
  89. package/dist/default-extensions/r.js +11 -0
  90. package/dist/default-extensions/razor.js +11 -0
  91. package/dist/default-extensions/ruby.js +11 -0
  92. package/dist/default-extensions/rust.js +11 -0
  93. package/dist/default-extensions/scss.js +12 -0
  94. package/dist/default-extensions/shaderlab.js +11 -0
  95. package/dist/default-extensions/shellscript.js +11 -0
  96. package/dist/default-extensions/sql.js +11 -0
  97. package/dist/default-extensions/swift.js +12 -0
  98. package/dist/default-extensions/theme-abyss.js +10 -0
  99. package/dist/default-extensions/theme-defaults.js +18 -0
  100. package/dist/default-extensions/theme-kimbie-dark.js +10 -0
  101. package/dist/default-extensions/theme-monokai-dimmed.js +10 -0
  102. package/dist/default-extensions/theme-monokai.js +10 -0
  103. package/dist/default-extensions/theme-quietlight.js +10 -0
  104. package/dist/default-extensions/theme-red.js +10 -0
  105. package/dist/default-extensions/theme-seti.js +10 -0
  106. package/dist/default-extensions/theme-solarized-dark.js +10 -0
  107. package/dist/default-extensions/theme-solarized-light.js +10 -0
  108. package/dist/default-extensions/theme-tomorrow-night-blue.js +10 -0
  109. package/dist/default-extensions/typescript-basics.js +17 -0
  110. package/dist/default-extensions/vb.js +12 -0
  111. package/dist/default-extensions/xml.js +13 -0
  112. package/dist/default-extensions/yaml.js +13 -0
  113. package/dist/dialogs.js +12 -216
  114. package/dist/diff.js +8 -0
  115. package/dist/diff.tmLanguage.js +2 -0
  116. package/dist/dimmed-monokai-color-theme.js +2 -0
  117. package/dist/docker.js +8 -0
  118. package/dist/docker.tmLanguage.js +2 -0
  119. package/dist/dom.js +101 -0
  120. package/dist/extensionManagement.js +4 -0
  121. package/dist/extensions.d.ts +368 -23
  122. package/dist/extensions.js +4 -85
  123. package/dist/extensionsRegistry.js +63 -64
  124. package/dist/files.d.ts +845 -0
  125. package/dist/files.js +1805 -1151
  126. package/dist/files2.js +32 -0
  127. package/dist/fsharp.js +9 -0
  128. package/dist/fsharp.tmLanguage.js +2 -0
  129. package/dist/fsharp2.js +2 -0
  130. package/dist/go.js +8 -0
  131. package/dist/go.tmLanguage.js +2 -0
  132. package/dist/groovy.js +9 -0
  133. package/dist/groovy.tmLanguage.js +2 -0
  134. package/dist/groovy2.js +2 -0
  135. package/dist/handlebars.js +8 -0
  136. package/dist/hc_black.js +2 -0
  137. package/dist/hc_light.js +2 -0
  138. package/dist/hlsl.js +8 -0
  139. package/dist/hlsl.tmLanguage.js +2 -0
  140. package/dist/html-derivative.tmLanguage.js +2 -0
  141. package/dist/html.js +10 -0
  142. package/dist/html.tmLanguage.js +2 -0
  143. package/dist/html.tmLanguage2.js +2 -0
  144. package/dist/html2.js +2 -0
  145. package/dist/ini.js +10 -0
  146. package/dist/ini.language-configuration.js +2 -0
  147. package/dist/ini.tmLanguage.js +2 -0
  148. package/dist/injection.js +1 -1
  149. package/dist/java.js +9 -0
  150. package/dist/java.tmLanguage.js +2 -0
  151. package/dist/java2.js +2 -0
  152. package/dist/javascript-language-configuration.js +2 -0
  153. package/dist/javascript.js +14 -0
  154. package/dist/javascript2.js +2 -0
  155. package/dist/jsdoc.js.injection.tmLanguage.js +2 -0
  156. package/dist/jsdoc.ts.injection.tmLanguage.js +2 -0
  157. package/dist/json.js +10 -0
  158. package/dist/jsonErrorMessages.js +1 -1
  159. package/dist/julia.js +8 -0
  160. package/dist/julia.tmLanguage.js +2 -0
  161. package/dist/keybindings.d.ts +1 -10
  162. package/dist/keybindings.js +291 -353
  163. package/dist/kimbie-dark-color-theme.js +2 -0
  164. package/dist/language-configuration.js +2 -0
  165. package/dist/language-configuration10.js +2 -0
  166. package/dist/language-configuration11.js +2 -0
  167. package/dist/language-configuration12.js +2 -0
  168. package/dist/language-configuration13.js +2 -0
  169. package/dist/language-configuration14.js +2 -0
  170. package/dist/language-configuration15.js +2 -0
  171. package/dist/language-configuration16.js +2 -0
  172. package/dist/language-configuration17.js +2 -0
  173. package/dist/language-configuration18.js +2 -0
  174. package/dist/language-configuration19.js +2 -0
  175. package/dist/language-configuration2.js +2 -0
  176. package/dist/language-configuration20.js +2 -0
  177. package/dist/language-configuration21.js +2 -0
  178. package/dist/language-configuration22.js +2 -0
  179. package/dist/language-configuration23.js +2 -0
  180. package/dist/language-configuration24.js +2 -0
  181. package/dist/language-configuration25.js +2 -0
  182. package/dist/language-configuration26.js +2 -0
  183. package/dist/language-configuration27.js +2 -0
  184. package/dist/language-configuration28.js +2 -0
  185. package/dist/language-configuration29.js +2 -0
  186. package/dist/language-configuration3.js +2 -0
  187. package/dist/language-configuration30.js +2 -0
  188. package/dist/language-configuration31.js +2 -0
  189. package/dist/language-configuration32.js +2 -0
  190. package/dist/language-configuration33.js +2 -0
  191. package/dist/language-configuration34.js +2 -0
  192. package/dist/language-configuration35.js +2 -0
  193. package/dist/language-configuration36.js +2 -0
  194. package/dist/language-configuration37.js +2 -0
  195. package/dist/language-configuration38.js +2 -0
  196. package/dist/language-configuration39.js +2 -0
  197. package/dist/language-configuration4.js +2 -0
  198. package/dist/language-configuration5.js +2 -0
  199. package/dist/language-configuration6.js +2 -0
  200. package/dist/language-configuration7.js +2 -0
  201. package/dist/language-configuration8.js +2 -0
  202. package/dist/language-configuration9.js +2 -0
  203. package/dist/languageService.js +5 -6
  204. package/dist/languages.d.ts +66 -1
  205. package/dist/languages.js +924 -5
  206. package/dist/latex.js +11 -0
  207. package/dist/layout.contribution.darwin.js +1 -1
  208. package/dist/layout.contribution.linux.js +1 -1
  209. package/dist/layout.contribution.win.js +1 -1
  210. package/dist/layout.js +4 -10
  211. package/dist/layoutService.js +10 -2
  212. package/dist/less.js +8 -0
  213. package/dist/less.tmLanguage.js +2 -0
  214. package/dist/light_plus.js +2 -0
  215. package/dist/light_plus_experimental.js +2 -0
  216. package/dist/light_vs.js +2 -0
  217. package/dist/log.js +7 -0
  218. package/dist/log.tmLanguage.js +2 -0
  219. package/dist/lua.js +8 -0
  220. package/dist/lua.tmLanguage.js +2 -0
  221. package/dist/make.js +8 -0
  222. package/dist/make.tmLanguage.js +2 -0
  223. package/dist/markdown-basics.js +9 -0
  224. package/dist/markdown-latex-combined.tmLanguage.js +2 -0
  225. package/dist/markdown.js +2 -0
  226. package/dist/markdown.tmLanguage.js +2 -0
  227. package/dist/memento.js +91 -0
  228. package/dist/modelEditor.d.ts +1480 -138
  229. package/dist/modelEditor.js +8700 -326
  230. package/dist/monaco.d.ts +987 -15
  231. package/dist/monaco.js +40 -10
  232. package/dist/monokai-color-theme.js +2 -0
  233. package/dist/notifications.js +86 -64
  234. package/dist/objective-c.js +10 -0
  235. package/dist/objective-c.tmLanguage.js +2 -0
  236. package/dist/objective-c__.tmLanguage.js +2 -0
  237. package/dist/perl.js +10 -0
  238. package/dist/perl.language-configuration.js +2 -0
  239. package/dist/perl.tmLanguage.js +2 -0
  240. package/dist/perl6.language-configuration.js +2 -0
  241. package/dist/perl6.tmLanguage.js +2 -0
  242. package/dist/php.js +10 -0
  243. package/dist/php.tmLanguage.js +2 -0
  244. package/dist/php2.js +2 -0
  245. package/dist/platform.js +105 -0
  246. package/dist/platform.tmLanguage.js +2 -0
  247. package/dist/polyfill.js +51922 -11067
  248. package/dist/powershell.js +8 -0
  249. package/dist/powershell.tmLanguage.js +2 -0
  250. package/dist/preferences.js +2532 -0
  251. package/dist/properties.language-configuration.js +2 -0
  252. package/dist/pug.js +8 -0
  253. package/dist/pug.tmLanguage.js +2 -0
  254. package/dist/python.js +9 -0
  255. package/dist/quietlight-color-theme.js +2 -0
  256. package/dist/r.js +8 -0
  257. package/dist/r.tmLanguage.js +2 -0
  258. package/dist/razor.js +8 -0
  259. package/dist/rollup-vsix-plugin.d.ts +8 -0
  260. package/dist/rollup-vsix-plugin.js +104 -0
  261. package/dist/ruby.js +8 -0
  262. package/dist/ruby.tmLanguage.js +2 -0
  263. package/dist/rust.js +8 -0
  264. package/dist/rust.tmLanguage.js +2 -0
  265. package/dist/sassdoc.tmLanguage.js +2 -0
  266. package/dist/scss.js +9 -0
  267. package/dist/scss.tmLanguage.js +2 -0
  268. package/dist/services.d.ts +12988 -12840
  269. package/dist/services.js +1 -1
  270. package/dist/shaderlab.js +8 -0
  271. package/dist/shaderlab.tmLanguage.js +2 -0
  272. package/dist/shell-unix-bash.tmLanguage.js +2 -0
  273. package/dist/shellscript.js +8 -0
  274. package/dist/snippets.js +6 -11
  275. package/dist/snippetsService.js +7 -10
  276. package/dist/solarized-dark-color-theme.js +2 -0
  277. package/dist/solarized-light-color-theme.js +2 -0
  278. package/dist/sql.js +8 -0
  279. package/dist/sql.tmLanguage.js +2 -0
  280. package/dist/swift.js +9 -0
  281. package/dist/swift.tmLanguage.js +2 -0
  282. package/dist/swift2.js +2 -0
  283. package/dist/tags-language-configuration.js +2 -0
  284. package/dist/textmate.d.ts +0 -264
  285. package/dist/textmate.js +402 -66
  286. package/dist/theme-abyss.js +7 -0
  287. package/dist/theme-defaults.js +15 -0
  288. package/dist/theme-kimbie-dark.js +7 -0
  289. package/dist/theme-monokai-dimmed.js +7 -0
  290. package/dist/theme-monokai.js +7 -0
  291. package/dist/theme-quietlight.js +7 -0
  292. package/dist/theme-red.js +7 -0
  293. package/dist/theme-seti.js +7 -0
  294. package/dist/theme-solarized-dark.js +7 -0
  295. package/dist/theme-solarized-light.js +7 -0
  296. package/dist/theme-tomorrow-night-blue.js +7 -0
  297. package/dist/theme.js +6 -11
  298. package/dist/{contextkeys.js → theme2.js} +165 -143
  299. package/dist/tokenClassificationRegistry.js +46 -2
  300. package/dist/tomorrow-night-blue-color-theme.js +2 -0
  301. package/dist/typescript-basics.js +14 -0
  302. package/dist/typescript.js +2 -0
  303. package/dist/unboundCommands.js +41 -0
  304. package/dist/utils.js +345 -0
  305. package/dist/vb.js +9 -0
  306. package/dist/vb2.js +2 -0
  307. package/dist/vs-seti-icon-theme.js +2 -0
  308. package/dist/vs_minimal-icon-theme.js +2 -0
  309. package/dist/xml.js +10 -0
  310. package/dist/xml.language-configuration.js +2 -0
  311. package/dist/xml.tmLanguage.js +2 -0
  312. package/dist/xsl.language-configuration.js +2 -0
  313. package/dist/xsl.tmLanguage.js +2 -0
  314. package/dist/yaml.js +10 -0
  315. package/dist/yaml.tmLanguage.js +2 -0
  316. package/package.json +50 -33
  317. package/dist/async.js +0 -301
  318. package/dist/cancellation.js +0 -3
  319. package/dist/configurationRegistry.js +0 -441
  320. package/dist/extensionResourceLoader.js +0 -96
  321. package/dist/labels.js +0 -14
  322. package/dist/languageConfiguration.js +0 -919
  323. package/dist/missing-services.js +0 -5554
  324. package/dist/resources.js +0 -197
  325. package/dist/services2.js +0 -3467
  326. package/dist/textFileEditorModel.js +0 -2985
  327. package/dist/tokenClassification.d.ts +0 -7
  328. package/dist/tokenClassification.js +0 -277
  329. package/dist/variableResolver.js +0 -1711
  330. package/dist/workbenchThemeService.js +0 -46
  331. package/dist/workspaceContext.js +0 -50
  332. /package/dist/{languageConfiguration.d.ts → preferences.d.ts} +0 -0
@@ -0,0 +1,845 @@
1
+ import * as monaco from 'monaco-editor';
2
+ import * as vscode from 'vscode';
3
+
4
+ /**
5
+ * An object that performs a cleanup operation when `.dispose()` is called.
6
+ *
7
+ * Some examples of how disposables are used:
8
+ *
9
+ * - An event listener that removes itself when `.dispose()` is called.
10
+ * - A resource such as a file system watcher that cleans up the resource when `.dispose()` is called.
11
+ * - The return value from registering a provider. When `.dispose()` is called, the provider is unregistered.
12
+ */
13
+ interface IDisposable {
14
+ dispose(): void;
15
+ }
16
+ /**
17
+ * Manages a collection of disposable values.
18
+ *
19
+ * This is the preferred way to manage multiple disposables. A `DisposableStore` is safer to work with than an
20
+ * `IDisposable[]` as it considers edge cases, such as registering the same value multiple times or adding an item to a
21
+ * store that has already been disposed of.
22
+ */
23
+ declare class DisposableStore implements IDisposable {
24
+ static DISABLE_DISPOSED_WARNING: boolean;
25
+ private readonly _toDispose;
26
+ private _isDisposed;
27
+ constructor();
28
+ /**
29
+ * Dispose of all registered disposables and mark this object as disposed.
30
+ *
31
+ * Any future disposables added to this object will be disposed of on `add`.
32
+ */
33
+ dispose(): void;
34
+ /**
35
+ * @return `true` if this object has been disposed of.
36
+ */
37
+ get isDisposed(): boolean;
38
+ /**
39
+ * Dispose of all registered disposables but do not mark this object as disposed.
40
+ */
41
+ clear(): void;
42
+ /**
43
+ * Add a new {@link IDisposable disposable} to the collection.
44
+ */
45
+ add<T extends IDisposable>(o: T): T;
46
+ }
47
+
48
+ interface CancellationToken {
49
+ /**
50
+ * A flag signalling is cancellation has been requested.
51
+ */
52
+ readonly isCancellationRequested: boolean;
53
+ /**
54
+ * An event which fires when cancellation is requested. This event
55
+ * only ever fires `once` as cancellation can only happen once. Listeners
56
+ * that are registered after cancellation will be called (next event loop run),
57
+ * but also only once.
58
+ *
59
+ * @event
60
+ */
61
+ readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, disposables?: IDisposable[]) => IDisposable;
62
+ }
63
+ declare namespace CancellationToken {
64
+ function isCancellationToken(thing: unknown): thing is CancellationToken;
65
+ const None: Readonly<CancellationToken>;
66
+ const Cancelled: Readonly<CancellationToken>;
67
+ }
68
+
69
+ interface IObservable<T, TChange = void> {
70
+ readonly TChange: TChange;
71
+ /**
72
+ * Reads the current value.
73
+ *
74
+ * Must not be called from {@link IObserver.handleChange}.
75
+ */
76
+ get(): T;
77
+ /**
78
+ * Adds an observer.
79
+ */
80
+ addObserver(observer: IObserver): void;
81
+ removeObserver(observer: IObserver): void;
82
+ /**
83
+ * Subscribes the reader to this observable and returns the current value of this observable.
84
+ */
85
+ read(reader: IReader): T;
86
+ map<TNew>(fn: (value: T) => TNew): IObservable<TNew>;
87
+ readonly debugName: string;
88
+ }
89
+ interface IReader {
90
+ /**
91
+ * Reports an observable that was read.
92
+ *
93
+ * Is called by {@link IObservable.read}.
94
+ */
95
+ subscribeTo<T>(observable: IObservable<T, any>): void;
96
+ }
97
+ interface IObserver {
98
+ /**
99
+ * Indicates that an update operation is about to begin.
100
+ *
101
+ * During an update, invariants might not hold for subscribed observables and
102
+ * change events might be delayed.
103
+ * However, all changes must be reported before all update operations are over.
104
+ */
105
+ beginUpdate<T>(observable: IObservable<T>): void;
106
+ /**
107
+ * Is called by a subscribed observable immediately after it notices a change.
108
+ *
109
+ * When {@link IObservable.get} returns and no change has been reported,
110
+ * there has been no change for that observable.
111
+ *
112
+ * Implementations must not call into other observables!
113
+ * The change should be processed when {@link IObserver.endUpdate} is called.
114
+ */
115
+ handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void;
116
+ /**
117
+ * Indicates that an update operation has completed.
118
+ */
119
+ endUpdate<T>(observable: IObservable<T>): void;
120
+ }
121
+
122
+ /**
123
+ * Can be passed into the Delayed to defer using a microtask
124
+ * */
125
+ declare const MicrotaskDelay: unique symbol;
126
+
127
+ /**
128
+ * An event with zero or one parameters that can be subscribed to. The event is a function itself.
129
+ */
130
+ type Event<T> = vscode.Event<T>
131
+ declare namespace Event {
132
+ const None: Event<any>;
133
+ /**
134
+ * Given an event, returns another event which debounces calls and defers the listeners to a later task via a shared
135
+ * `setTimeout`. The event is converted into a signal (`Event<void>`) to avoid additional object creation as a
136
+ * result of merging events and to try prevent race conditions that could arise when using related deferred and
137
+ * non-deferred events.
138
+ *
139
+ * This is useful for deferring non-critical work (eg. general UI updates) to ensure it does not block critical work
140
+ * (eg. latency of keypress to text rendered).
141
+ *
142
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
143
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
144
+ * returned event causes this utility to leak a listener on the original event.
145
+ *
146
+ * @param event The event source for the new event.
147
+ * @param disposable A disposable store to add the new EventEmitter to.
148
+ */
149
+ function defer(event: Event<unknown>, disposable?: DisposableStore): Event<void>;
150
+ /**
151
+ * Given an event, returns another event which only fires once.
152
+ *
153
+ * @param event The event source for the new event.
154
+ */
155
+ function once<T>(event: Event<T>): Event<T>;
156
+ /**
157
+ * Maps an event of one type into an event of another type using a mapping function, similar to how
158
+ * `Array.prototype.map` works.
159
+ *
160
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
161
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
162
+ * returned event causes this utility to leak a listener on the original event.
163
+ *
164
+ * @param event The event source for the new event.
165
+ * @param map The mapping function.
166
+ * @param disposable A disposable store to add the new EventEmitter to.
167
+ */
168
+ function map<I, O>(event: Event<I>, map: (i: I) => O, disposable?: DisposableStore): Event<O>;
169
+ /**
170
+ * Wraps an event in another event that performs some function on the event object before firing.
171
+ *
172
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
173
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
174
+ * returned event causes this utility to leak a listener on the original event.
175
+ *
176
+ * @param event The event source for the new event.
177
+ * @param each The function to perform on the event object.
178
+ * @param disposable A disposable store to add the new EventEmitter to.
179
+ */
180
+ function forEach<I>(event: Event<I>, each: (i: I) => void, disposable?: DisposableStore): Event<I>;
181
+ /**
182
+ * Wraps an event in another event that fires only when some condition is met.
183
+ *
184
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
185
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
186
+ * returned event causes this utility to leak a listener on the original event.
187
+ *
188
+ * @param event The event source for the new event.
189
+ * @param filter The filter function that defines the condition. The event will fire for the object if this function
190
+ * returns true.
191
+ * @param disposable A disposable store to add the new EventEmitter to.
192
+ */
193
+ function filter<T, U>(event: Event<T | U>, filter: (e: T | U) => e is T, disposable?: DisposableStore): Event<T>;
194
+ function filter<T>(event: Event<T>, filter: (e: T) => boolean, disposable?: DisposableStore): Event<T>;
195
+ function filter<T, R>(event: Event<T | R>, filter: (e: T | R) => e is R, disposable?: DisposableStore): Event<R>;
196
+ /**
197
+ * Given an event, returns the same event but typed as `Event<void>`.
198
+ */
199
+ function signal<T>(event: Event<T>): Event<void>;
200
+ /**
201
+ * Given a collection of events, returns a single event which emits whenever any of the provided events emit.
202
+ */
203
+ function any<T>(...events: Event<T>[]): Event<T>;
204
+ function any(...events: Event<any>[]): Event<void>;
205
+ /**
206
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
207
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
208
+ * returned event causes this utility to leak a listener on the original event.
209
+ */
210
+ function reduce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, initial?: O, disposable?: DisposableStore): Event<O>;
211
+ /**
212
+ * Given an event, creates a new emitter that event that will debounce events based on {@link delay} and give an
213
+ * array event object of all events that fired.
214
+ *
215
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
216
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
217
+ * returned event causes this utility to leak a listener on the original event.
218
+ *
219
+ * @param event The original event to debounce.
220
+ * @param merge A function that reduces all events into a single event.
221
+ * @param delay The number of milliseconds to debounce.
222
+ * @param leading Whether to fire a leading event without debouncing.
223
+ * @param flushOnListenerRemove Whether to fire all debounced events when a listener is removed. If this is not
224
+ * specified, some events could go missing. Use this if it's important that all events are processed, even if the
225
+ * listener gets disposed before the debounced event fires.
226
+ * @param leakWarningThreshold See {@link EmitterOptions.leakWarningThreshold}.
227
+ * @param disposable A disposable store to register the debounce emitter to.
228
+ */
229
+ function debounce<T>(event: Event<T>, merge: (last: T | undefined, event: T) => T, delay?: number | typeof MicrotaskDelay, leading?: boolean, flushOnListenerRemove?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<T>;
230
+ function debounce<I, O>(event: Event<I>, merge: (last: O | undefined, event: I) => O, delay?: number | typeof MicrotaskDelay, leading?: boolean, flushOnListenerRemove?: boolean, leakWarningThreshold?: number, disposable?: DisposableStore): Event<O>;
231
+ /**
232
+ * Debounces an event, firing after some delay (default=0) with an array of all event original objects.
233
+ *
234
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
235
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
236
+ * returned event causes this utility to leak a listener on the original event.
237
+ */
238
+ function accumulate<T>(event: Event<T>, delay?: number, disposable?: DisposableStore): Event<T[]>;
239
+ /**
240
+ * Filters an event such that some condition is _not_ met more than once in a row, effectively ensuring duplicate
241
+ * event objects from different sources do not fire the same event object.
242
+ *
243
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
244
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
245
+ * returned event causes this utility to leak a listener on the original event.
246
+ *
247
+ * @param event The event source for the new event.
248
+ * @param equals The equality condition.
249
+ * @param disposable A disposable store to add the new EventEmitter to.
250
+ *
251
+ * @example
252
+ * ```
253
+ * // Fire only one time when a single window is opened or focused
254
+ * Event.latch(Event.any(onDidOpenWindow, onDidFocusWindow))
255
+ * ```
256
+ */
257
+ function latch<T>(event: Event<T>, equals?: (a: T, b: T) => boolean, disposable?: DisposableStore): Event<T>;
258
+ /**
259
+ * Splits an event whose parameter is a union type into 2 separate events for each type in the union.
260
+ *
261
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
262
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
263
+ * returned event causes this utility to leak a listener on the original event.
264
+ *
265
+ * @example
266
+ * ```
267
+ * const event = new EventEmitter<number | undefined>().event;
268
+ * const [numberEvent, undefinedEvent] = Event.split(event, isUndefined);
269
+ * ```
270
+ *
271
+ * @param event The event source for the new event.
272
+ * @param isT A function that determines what event is of the first type.
273
+ * @param disposable A disposable store to add the new EventEmitter to.
274
+ */
275
+ function split<T, U>(event: Event<T | U>, isT: (e: T | U) => e is T, disposable?: DisposableStore): [Event<T>, Event<U>];
276
+ /**
277
+ * Buffers an event until it has a listener attached.
278
+ *
279
+ * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned
280
+ * event is accessible to "third parties", e.g the event is a public property. Otherwise a leaked listener on the
281
+ * returned event causes this utility to leak a listener on the original event.
282
+ *
283
+ * @param event The event source for the new event.
284
+ * @param flushAfterTimeout Determines whether to flush the buffer after a timeout immediately or after a
285
+ * `setTimeout` when the first event listener is added.
286
+ * @param _buffer Internal: A source event array used for tests.
287
+ *
288
+ * @example
289
+ * ```
290
+ * // Start accumulating events, when the first listener is attached, flush
291
+ * // the event after a timeout such that multiple listeners attached before
292
+ * // the timeout would receive the event
293
+ * this.onInstallExtension = Event.buffer(service.onInstallExtension, true);
294
+ * ```
295
+ */
296
+ function buffer<T>(event: Event<T>, flushAfterTimeout?: boolean, _buffer?: T[]): Event<T>;
297
+ interface IChainableEvent<T> extends IDisposable {
298
+ event: Event<T>;
299
+ map<O>(fn: (i: T) => O): IChainableEvent<O>;
300
+ forEach(fn: (i: T) => void): IChainableEvent<T>;
301
+ filter(fn: (e: T) => boolean): IChainableEvent<T>;
302
+ filter<R>(fn: (e: T | R) => e is R): IChainableEvent<R>;
303
+ reduce<R>(merge: (last: R | undefined, event: T) => R, initial?: R): IChainableEvent<R>;
304
+ latch(): IChainableEvent<T>;
305
+ debounce(merge: (last: T | undefined, event: T) => T, delay?: number, leading?: boolean, flushOnListenerRemove?: boolean, leakWarningThreshold?: number): IChainableEvent<T>;
306
+ debounce<R>(merge: (last: R | undefined, event: T) => R, delay?: number, leading?: boolean, flushOnListenerRemove?: boolean, leakWarningThreshold?: number): IChainableEvent<R>;
307
+ on(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;
308
+ once(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;
309
+ }
310
+ /**
311
+ * Wraps the event in an {@link IChainableEvent}, allowing a more functional programming style.
312
+ *
313
+ * @example
314
+ * ```
315
+ * // Normal
316
+ * const onEnterPressNormal = Event.filter(
317
+ * Event.map(onKeyPress.event, e => new StandardKeyboardEvent(e)),
318
+ * e.keyCode === KeyCode.Enter
319
+ * ).event;
320
+ *
321
+ * // Using chain
322
+ * const onEnterPressChain = Event.chain(onKeyPress.event)
323
+ * .map(e => new StandardKeyboardEvent(e))
324
+ * .filter(e => e.keyCode === KeyCode.Enter)
325
+ * .event;
326
+ * ```
327
+ */
328
+ function chain<T>(event: Event<T>): IChainableEvent<T>;
329
+ interface NodeEventEmitter {
330
+ on(event: string | symbol, listener: Function): unknown;
331
+ removeListener(event: string | symbol, listener: Function): unknown;
332
+ }
333
+ /**
334
+ * Creates an {@link Event} from a node event emitter.
335
+ */
336
+ function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
337
+ interface DOMEventEmitter {
338
+ addEventListener(event: string | symbol, listener: Function): void;
339
+ removeEventListener(event: string | symbol, listener: Function): void;
340
+ }
341
+ /**
342
+ * Creates an {@link Event} from a DOM event emitter.
343
+ */
344
+ function fromDOMEventEmitter<T>(emitter: DOMEventEmitter, eventName: string, map?: (...args: any[]) => T): Event<T>;
345
+ /**
346
+ * Creates a promise out of an event, using the {@link Event.once} helper.
347
+ */
348
+ function toPromise<T>(event: Event<T>): Promise<T>;
349
+ /**
350
+ * Adds a listener to an event and calls the listener immediately with undefined as the event object.
351
+ *
352
+ * @example
353
+ * ```
354
+ * // Initialize the UI and update it when dataChangeEvent fires
355
+ * runAndSubscribe(dataChangeEvent, () => this._updateUI());
356
+ * ```
357
+ */
358
+ function runAndSubscribe<T>(event: Event<T>, handler: (e: T | undefined) => any): IDisposable;
359
+ /**
360
+ * Adds a listener to an event and calls the listener immediately with undefined as the event object. A new
361
+ * {@link DisposableStore} is passed to the listener which is disposed when the returned disposable is disposed.
362
+ */
363
+ function runAndSubscribeWithStore<T>(event: Event<T>, handler: (e: T | undefined, disposableStore: DisposableStore) => any): IDisposable;
364
+ function fromObservable<T>(obs: IObservable<T, any>, store?: DisposableStore): Event<T>;
365
+ }
366
+
367
+ /**
368
+ * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
369
+ * This class is a simple parser which creates the basic component parts
370
+ * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
371
+ * and encoding.
372
+ *
373
+ * ```txt
374
+ * foo://example.com:8042/over/there?name=ferret#nose
375
+ * \_/ \______________/\_________/ \_________/ \__/
376
+ * | | | | |
377
+ * scheme authority path query fragment
378
+ * | _____________________|__
379
+ * / \ / \
380
+ * urn:example:animal:ferret:nose
381
+ * ```
382
+ */
383
+ declare class URI implements UriComponents {
384
+ static isUri(thing: any): thing is URI;
385
+ /**
386
+ * scheme is the 'http' part of 'http://www.example.com/some/path?query#fragment'.
387
+ * The part before the first colon.
388
+ */
389
+ readonly scheme: string;
390
+ /**
391
+ * authority is the 'www.example.com' part of 'http://www.example.com/some/path?query#fragment'.
392
+ * The part between the first double slashes and the next slash.
393
+ */
394
+ readonly authority: string;
395
+ /**
396
+ * path is the '/some/path' part of 'http://www.example.com/some/path?query#fragment'.
397
+ */
398
+ readonly path: string;
399
+ /**
400
+ * query is the 'query' part of 'http://www.example.com/some/path?query#fragment'.
401
+ */
402
+ readonly query: string;
403
+ /**
404
+ * fragment is the 'fragment' part of 'http://www.example.com/some/path?query#fragment'.
405
+ */
406
+ readonly fragment: string;
407
+ /**
408
+ * @internal
409
+ */
410
+ protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
411
+ /**
412
+ * @internal
413
+ */
414
+ protected constructor(components: UriComponents);
415
+ /**
416
+ * Returns a string representing the corresponding file system path of this URI.
417
+ * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
418
+ * platform specific path separator.
419
+ *
420
+ * * Will *not* validate the path for invalid characters and semantics.
421
+ * * Will *not* look at the scheme of this URI.
422
+ * * The result shall *not* be used for display purposes but for accessing a file on disk.
423
+ *
424
+ *
425
+ * The *difference* to `URI#path` is the use of the platform specific separator and the handling
426
+ * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
427
+ *
428
+ * ```ts
429
+ const u = URI.parse('file://server/c$/folder/file.txt')
430
+ u.authority === 'server'
431
+ u.path === '/shares/c$/file.txt'
432
+ u.fsPath === '\\server\c$\folder\file.txt'
433
+ ```
434
+ *
435
+ * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
436
+ * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
437
+ * with URIs that represent files on disk (`file` scheme).
438
+ */
439
+ get fsPath(): string;
440
+ with(change: {
441
+ scheme?: string;
442
+ authority?: string | null;
443
+ path?: string | null;
444
+ query?: string | null;
445
+ fragment?: string | null;
446
+ }): URI;
447
+ /**
448
+ * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
449
+ * `file:///usr/home`, or `scheme:with/path`.
450
+ *
451
+ * @param value A string which represents an URI (see `URI#toString`).
452
+ */
453
+ static parse(value: string, _strict?: boolean): URI;
454
+ /**
455
+ * Creates a new URI from a file system path, e.g. `c:\my\files`,
456
+ * `/usr/home`, or `\\server\share\some\path`.
457
+ *
458
+ * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
459
+ * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
460
+ * `URI.parse('file://' + path)` because the path might contain characters that are
461
+ * interpreted (# and ?). See the following sample:
462
+ * ```ts
463
+ const good = URI.file('/coding/c#/project1');
464
+ good.scheme === 'file';
465
+ good.path === '/coding/c#/project1';
466
+ good.fragment === '';
467
+ const bad = URI.parse('file://' + '/coding/c#/project1');
468
+ bad.scheme === 'file';
469
+ bad.path === '/coding/c'; // path is now broken
470
+ bad.fragment === '/project1';
471
+ ```
472
+ *
473
+ * @param path A file system path (see `URI#fsPath`)
474
+ */
475
+ static file(path: string): URI;
476
+ static from(components: {
477
+ scheme: string;
478
+ authority?: string;
479
+ path?: string;
480
+ query?: string;
481
+ fragment?: string;
482
+ }): URI;
483
+ /**
484
+ * Join a URI path with path fragments and normalizes the resulting path.
485
+ *
486
+ * @param uri The input URI.
487
+ * @param pathFragment The path fragment to add to the URI path.
488
+ * @returns The resulting URI.
489
+ */
490
+ static joinPath(uri: URI, ...pathFragment: string[]): URI;
491
+ /**
492
+ * Creates a string representation for this URI. It's guaranteed that calling
493
+ * `URI.parse` with the result of this function creates an URI which is equal
494
+ * to this URI.
495
+ *
496
+ * * The result shall *not* be used for display purposes but for externalization or transport.
497
+ * * The result will be encoded using the percentage encoding and encoding happens mostly
498
+ * ignore the scheme-specific encoding rules.
499
+ *
500
+ * @param skipEncoding Do not encode the result, default is `false`
501
+ */
502
+ toString(skipEncoding?: boolean): string;
503
+ toJSON(): UriComponents;
504
+ static revive(data: UriComponents | URI): URI;
505
+ static revive(data: UriComponents | URI | undefined): URI | undefined;
506
+ static revive(data: UriComponents | URI | null): URI | null;
507
+ static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
508
+ }
509
+ interface UriComponents {
510
+ scheme: string;
511
+ authority: string;
512
+ path: string;
513
+ query: string;
514
+ fragment: string;
515
+ }
516
+
517
+ interface IRelativePattern {
518
+ /**
519
+ * A base file path to which this pattern will be matched against relatively.
520
+ */
521
+ readonly base: string;
522
+ /**
523
+ * A file glob pattern like `*.{ts,js}` that will be matched on file paths
524
+ * relative to the base path.
525
+ *
526
+ * Example: Given a base of `/home/work/folder` and a file path of `/home/work/folder/index.js`,
527
+ * the file glob pattern will match on `index.js`.
528
+ */
529
+ readonly pattern: string;
530
+ }
531
+
532
+ type IEditorOverrideServices = monaco.editor.IEditorOverrideServices
533
+
534
+ interface ReadableStreamEvents<T> {
535
+ /**
536
+ * The 'data' event is emitted whenever the stream is
537
+ * relinquishing ownership of a chunk of data to a consumer.
538
+ *
539
+ * NOTE: PLEASE UNDERSTAND THAT ADDING A DATA LISTENER CAN
540
+ * TURN THE STREAM INTO FLOWING MODE. IT IS THEREFOR THE
541
+ * LAST LISTENER THAT SHOULD BE ADDED AND NOT THE FIRST
542
+ *
543
+ * Use `listenStream` as a helper method to listen to
544
+ * stream events in the right order.
545
+ */
546
+ on(event: 'data', callback: (data: T) => void): void;
547
+ /**
548
+ * Emitted when any error occurs.
549
+ */
550
+ on(event: 'error', callback: (err: Error) => void): void;
551
+ /**
552
+ * The 'end' event is emitted when there is no more data
553
+ * to be consumed from the stream. The 'end' event will
554
+ * not be emitted unless the data is completely consumed.
555
+ */
556
+ on(event: 'end', callback: () => void): void;
557
+ }
558
+
559
+ interface IFileOverwriteOptions {
560
+ /**
561
+ * Set to `true` to overwrite a file if it exists. Will
562
+ * throw an error otherwise if the file does exist.
563
+ */
564
+ readonly overwrite: boolean;
565
+ }
566
+ interface IFileUnlockOptions {
567
+ /**
568
+ * Set to `true` to try to remove any write locks the file might
569
+ * have. A file that is write locked will throw an error for any
570
+ * attempt to write to unless `unlock: true` is provided.
571
+ */
572
+ readonly unlock: boolean;
573
+ }
574
+ interface IFileReadLimits {
575
+ /**
576
+ * If the file exceeds the given size, an error of kind
577
+ * `FILE_TOO_LARGE` will be thrown.
578
+ */
579
+ size?: number;
580
+ /**
581
+ * If the file exceeds the given size, an error of kind
582
+ * `FILE_EXCEEDS_MEMORY_LIMIT` will be thrown.
583
+ */
584
+ memory?: number;
585
+ }
586
+ interface IFileReadStreamOptions {
587
+ /**
588
+ * Is an integer specifying where to begin reading from in the file. If position is undefined,
589
+ * data will be read from the current file position.
590
+ */
591
+ readonly position?: number;
592
+ /**
593
+ * Is an integer specifying how many bytes to read from the file. By default, all bytes
594
+ * will be read.
595
+ */
596
+ readonly length?: number;
597
+ /**
598
+ * If provided, the size of the file will be checked against the limits
599
+ * and an error will be thrown if any limit is exceeded.
600
+ */
601
+ readonly limits?: IFileReadLimits;
602
+ }
603
+ interface IFileWriteOptions extends IFileOverwriteOptions, IFileUnlockOptions {
604
+ /**
605
+ * Set to `true` to create a file when it does not exist. Will
606
+ * throw an error otherwise if the file does not exist.
607
+ */
608
+ readonly create: boolean;
609
+ }
610
+ type IFileOpenOptions = IFileOpenForReadOptions | IFileOpenForWriteOptions;
611
+ interface IFileOpenForReadOptions {
612
+ /**
613
+ * A hint that the file should be opened for reading only.
614
+ */
615
+ readonly create: false;
616
+ }
617
+ interface IFileOpenForWriteOptions extends IFileUnlockOptions {
618
+ /**
619
+ * A hint that the file should be opened for reading and writing.
620
+ */
621
+ readonly create: true;
622
+ }
623
+ interface IFileDeleteOptions {
624
+ /**
625
+ * Set to `true` to recursively delete any children of the file. This
626
+ * only applies to folders and can lead to an error unless provided
627
+ * if the folder is not empty.
628
+ */
629
+ readonly recursive: boolean;
630
+ /**
631
+ * Set to `true` to attempt to move the file to trash
632
+ * instead of deleting it permanently from disk. This
633
+ * option maybe not be supported on all providers.
634
+ */
635
+ readonly useTrash: boolean;
636
+ }
637
+ declare enum FileType {
638
+ /**
639
+ * File is unknown (neither file, directory nor symbolic link).
640
+ */
641
+ Unknown = 0,
642
+ /**
643
+ * File is a normal file.
644
+ */
645
+ File = 1,
646
+ /**
647
+ * File is a directory.
648
+ */
649
+ Directory = 2,
650
+ /**
651
+ * File is a symbolic link.
652
+ *
653
+ * Note: even when the file is a symbolic link, you can test for
654
+ * `FileType.File` and `FileType.Directory` to know the type of
655
+ * the target the link points to.
656
+ */
657
+ SymbolicLink = 64
658
+ }
659
+ declare enum FilePermission {
660
+ /**
661
+ * File is readonly.
662
+ */
663
+ Readonly = 1
664
+ }
665
+ interface IStat {
666
+ /**
667
+ * The file type.
668
+ */
669
+ readonly type: FileType;
670
+ /**
671
+ * The last modification date represented as millis from unix epoch.
672
+ */
673
+ readonly mtime: number;
674
+ /**
675
+ * The creation date represented as millis from unix epoch.
676
+ */
677
+ readonly ctime: number;
678
+ /**
679
+ * The size of the file in bytes.
680
+ */
681
+ readonly size: number;
682
+ /**
683
+ * The file permissions.
684
+ */
685
+ readonly permissions?: FilePermission;
686
+ }
687
+ interface IWatchOptions {
688
+ /**
689
+ * Set to `true` to watch for changes recursively in a folder
690
+ * and all of its children.
691
+ */
692
+ readonly recursive: boolean;
693
+ /**
694
+ * A set of glob patterns or paths to exclude from watching.
695
+ * Paths can be relative or absolute and when relative are
696
+ * resolved against the watched folder. Glob patterns are
697
+ * always matched relative to the watched folder.
698
+ */
699
+ excludes: string[];
700
+ /**
701
+ * An optional set of glob patterns or paths to include for
702
+ * watching. If not provided, all paths are considered for
703
+ * events.
704
+ * Paths can be relative or absolute and when relative are
705
+ * resolved against the watched folder. Glob patterns are
706
+ * always matched relative to the watched folder.
707
+ */
708
+ includes?: Array<string | IRelativePattern>;
709
+ }
710
+ declare const enum FileSystemProviderCapabilities {
711
+ /**
712
+ * No capabilities.
713
+ */
714
+ None = 0,
715
+ /**
716
+ * Provider supports unbuffered read/write.
717
+ */
718
+ FileReadWrite = 2,
719
+ /**
720
+ * Provider supports open/read/write/close low level file operations.
721
+ */
722
+ FileOpenReadWriteClose = 4,
723
+ /**
724
+ * Provider supports stream based reading.
725
+ */
726
+ FileReadStream = 16,
727
+ /**
728
+ * Provider supports copy operation.
729
+ */
730
+ FileFolderCopy = 8,
731
+ /**
732
+ * Provider is path case sensitive.
733
+ */
734
+ PathCaseSensitive = 1024,
735
+ /**
736
+ * All files of the provider are readonly.
737
+ */
738
+ Readonly = 2048,
739
+ /**
740
+ * Provider supports to delete via trash.
741
+ */
742
+ Trash = 4096,
743
+ /**
744
+ * Provider support to unlock files for writing.
745
+ */
746
+ FileWriteUnlock = 8192,
747
+ /**
748
+ * Provider support to read files atomically. This implies the
749
+ * provider provides the `FileReadWrite` capability too.
750
+ */
751
+ FileAtomicRead = 16384,
752
+ /**
753
+ * Provider support to clone files atomically.
754
+ */
755
+ FileClone = 32768
756
+ }
757
+ interface IFileSystemProvider {
758
+ readonly capabilities: FileSystemProviderCapabilities;
759
+ readonly onDidChangeCapabilities: Event<void>;
760
+ readonly onDidChangeFile: Event<readonly IFileChange[]>;
761
+ readonly onDidWatchError?: Event<string>;
762
+ watch(resource: URI, opts: IWatchOptions): IDisposable;
763
+ stat(resource: URI): Promise<IStat>;
764
+ mkdir(resource: URI): Promise<void>;
765
+ readdir(resource: URI): Promise<[string, FileType][]>;
766
+ delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
767
+ rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
768
+ copy?(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
769
+ readFile?(resource: URI): Promise<Uint8Array>;
770
+ writeFile?(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
771
+ readFileStream?(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>;
772
+ open?(resource: URI, opts: IFileOpenOptions): Promise<number>;
773
+ close?(fd: number): Promise<void>;
774
+ read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
775
+ write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>;
776
+ cloneFile?(from: URI, to: URI): Promise<void>;
777
+ }
778
+ interface IFileSystemProviderWithFileReadWriteCapability extends IFileSystemProvider {
779
+ readFile(resource: URI): Promise<Uint8Array>;
780
+ writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
781
+ }
782
+ declare enum FileSystemProviderErrorCode {
783
+ FileExists = "EntryExists",
784
+ FileNotFound = "EntryNotFound",
785
+ FileNotADirectory = "EntryNotADirectory",
786
+ FileIsADirectory = "EntryIsADirectory",
787
+ FileExceedsMemoryLimit = "EntryExceedsMemoryLimit",
788
+ FileTooLarge = "EntryTooLarge",
789
+ FileWriteLocked = "EntryWriteLocked",
790
+ NoPermissions = "NoPermissions",
791
+ Unavailable = "Unavailable",
792
+ Unknown = "Unknown"
793
+ }
794
+ interface IFileSystemProviderError extends Error {
795
+ readonly name: string;
796
+ readonly code: FileSystemProviderErrorCode;
797
+ }
798
+ declare class FileSystemProviderError extends Error implements IFileSystemProviderError {
799
+ readonly code: FileSystemProviderErrorCode;
800
+ static create(error: Error | string, code: FileSystemProviderErrorCode): FileSystemProviderError;
801
+ private constructor();
802
+ }
803
+ /**
804
+ * Possible changes that can occur to a file.
805
+ */
806
+ declare const enum FileChangeType {
807
+ UPDATED = 0,
808
+ ADDED = 1,
809
+ DELETED = 2
810
+ }
811
+ /**
812
+ * Identifies a single change in a file.
813
+ */
814
+ interface IFileChange {
815
+ /**
816
+ * The type of change that occurred to the file.
817
+ */
818
+ readonly type: FileChangeType;
819
+ /**
820
+ * The unified resource identifier of the file that changed.
821
+ */
822
+ readonly resource: URI;
823
+ }
824
+
825
+ declare abstract class SimpleTextFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability {
826
+ onDidChangeCapabilities: Event<any>;
827
+ capabilities: number;
828
+ protected abstract getFileContent(resource: URI): Promise<string | undefined>;
829
+ protected abstract setFileContent(resource: URI, content: string, opts: IFileWriteOptions): Promise<void>;
830
+ onDidChangeFile: Event<readonly IFileChange[]>;
831
+ readFile(resource: URI): Promise<Uint8Array>;
832
+ writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
833
+ watch(): IDisposable;
834
+ stat(resource: URI): Promise<IStat>;
835
+ mkdir(): Promise<void>;
836
+ readdir(): Promise<[string, FileType][]>;
837
+ delete(): Promise<void>;
838
+ rename(): Promise<void>;
839
+ onDidWatchError: Event<any>;
840
+ }
841
+ declare function getServiceOverride(): IEditorOverrideServices;
842
+ declare function registerExtensionFile(extensionLocation: URI, path: string, getContent: () => Promise<string>): IDisposable;
843
+ declare function registerFileSystemOverlay(provider: IFileSystemProviderWithFileReadWriteCapability): IDisposable;
844
+
845
+ export { FileChangeType, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, SimpleTextFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };