@volar/monaco 1.3.0-alpha.3 → 1.3.0-alpha.3-patch.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/worker.d.ts CHANGED
@@ -20,5 +20,10 @@ declare class CdnDtsHost {
20
20
  getVersion(): Promise<number>;
21
21
  readFile(fileName: string): string | Promise<string | undefined>;
22
22
  fetch(fileName: string, url: string): Promise<string | undefined>;
23
+ /**
24
+ * save / load with json
25
+ */
26
+ toJson(): Promise<Record<string, string | null>>;
27
+ fromJson(json: Record<string, string | null>): void;
23
28
  }
24
29
  export {};
package/out/worker.js CHANGED
@@ -219,6 +219,24 @@ class CdnDtsHost {
219
219
  }
220
220
  });
221
221
  }
222
+ /**
223
+ * save / load with json
224
+ */
225
+ toJson() {
226
+ var _a;
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const json = {};
229
+ for (const [fileName, file] of this.files) {
230
+ json[fileName] = (_a = (yield file)) !== null && _a !== void 0 ? _a : null;
231
+ }
232
+ return json;
233
+ });
234
+ }
235
+ fromJson(json) {
236
+ for (const [fileName, file] of Object.entries(json)) {
237
+ this.files.set(fileName, file !== null && file !== void 0 ? file : undefined);
238
+ }
239
+ }
222
240
  }
223
241
  function createDtsClient(server) {
224
242
  const fetchTasks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/monaco",
3
- "version": "1.3.0-alpha.3",
3
+ "version": "1.3.0-alpha.3-patch.1",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -20,6 +20,5 @@
20
20
  "monaco-editor-core": "^0.36.0",
21
21
  "vscode-languageserver-protocol": "^3.17.3",
22
22
  "vscode-uri": "^3.0.7"
23
- },
24
- "gitHead": "03c8fff84531d8740863da5f9350e0d9382b5784"
23
+ }
25
24
  }
package/out/dts.d.ts DELETED
File without changes
package/out/dts.js DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=dts.js.map