@spyglassmc/core 0.1.2 → 0.2.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 (187) hide show
  1. package/README.md +7 -0
  2. package/lib/browser.d.ts +2 -0
  3. package/lib/browser.js +2 -0
  4. package/lib/common/TwoWayMap.js +4 -10
  5. package/lib/common/externals/BrowserExternals.d.ts +3 -0
  6. package/lib/common/externals/BrowserExternals.js +191 -0
  7. package/lib/common/externals/NodeJsExternals.d.ts +3 -0
  8. package/lib/common/externals/NodeJsExternals.js +151 -0
  9. package/lib/common/externals/downloader.d.ts +31 -0
  10. package/lib/common/externals/downloader.js +32 -0
  11. package/lib/common/externals/index.d.ts +96 -0
  12. package/lib/common/externals/index.js +2 -0
  13. package/lib/common/index.d.ts +2 -1
  14. package/lib/common/index.js +2 -17
  15. package/lib/common/util.d.ts +15 -15
  16. package/lib/common/util.js +30 -77
  17. package/lib/index.d.ts +7 -7
  18. package/lib/index.js +7 -23
  19. package/lib/node/AstNode.d.ts +3 -3
  20. package/lib/node/AstNode.js +10 -16
  21. package/lib/node/BooleanNode.d.ts +2 -2
  22. package/lib/node/BooleanNode.js +4 -7
  23. package/lib/node/CommentNode.d.ts +1 -1
  24. package/lib/node/CommentNode.js +2 -5
  25. package/lib/node/ErrorNode.d.ts +1 -1
  26. package/lib/node/ErrorNode.js +2 -5
  27. package/lib/node/FileNode.d.ts +3 -3
  28. package/lib/node/FileNode.js +2 -5
  29. package/lib/node/FloatNode.d.ts +2 -2
  30. package/lib/node/FloatNode.js +4 -7
  31. package/lib/node/IntegerNode.d.ts +2 -2
  32. package/lib/node/IntegerNode.js +4 -7
  33. package/lib/node/ListNode.d.ts +2 -2
  34. package/lib/node/ListNode.js +2 -5
  35. package/lib/node/LiteralNode.d.ts +3 -3
  36. package/lib/node/LiteralNode.js +4 -7
  37. package/lib/node/LongNode.d.ts +2 -2
  38. package/lib/node/LongNode.js +4 -7
  39. package/lib/node/RecordNode.d.ts +2 -2
  40. package/lib/node/RecordNode.js +2 -5
  41. package/lib/node/ResourceLocationNode.d.ts +5 -5
  42. package/lib/node/ResourceLocationNode.js +9 -12
  43. package/lib/node/Sequence.d.ts +2 -2
  44. package/lib/node/Sequence.js +4 -7
  45. package/lib/node/StringNode.d.ts +4 -4
  46. package/lib/node/StringNode.js +9 -12
  47. package/lib/node/SymbolNode.d.ts +3 -3
  48. package/lib/node/SymbolNode.js +4 -7
  49. package/lib/node/index.d.ts +15 -15
  50. package/lib/node/index.js +15 -31
  51. package/lib/nodejs.d.ts +2 -0
  52. package/lib/nodejs.js +2 -0
  53. package/lib/parser/Parser.d.ts +3 -3
  54. package/lib/parser/Parser.js +1 -4
  55. package/lib/parser/boolean.d.ts +2 -2
  56. package/lib/parser/boolean.js +3 -6
  57. package/lib/parser/comment.d.ts +2 -2
  58. package/lib/parser/comment.js +5 -9
  59. package/lib/parser/empty.d.ts +1 -1
  60. package/lib/parser/empty.js +1 -5
  61. package/lib/parser/error.d.ts +2 -2
  62. package/lib/parser/error.js +5 -9
  63. package/lib/parser/file.d.ts +3 -3
  64. package/lib/parser/file.js +9 -13
  65. package/lib/parser/float.d.ts +4 -4
  66. package/lib/parser/float.js +12 -16
  67. package/lib/parser/index.d.ts +16 -16
  68. package/lib/parser/index.js +16 -38
  69. package/lib/parser/integer.d.ts +4 -4
  70. package/lib/parser/integer.js +10 -14
  71. package/lib/parser/list.d.ts +2 -2
  72. package/lib/parser/list.js +15 -19
  73. package/lib/parser/literal.d.ts +2 -2
  74. package/lib/parser/literal.js +5 -9
  75. package/lib/parser/long.d.ts +4 -4
  76. package/lib/parser/long.js +10 -14
  77. package/lib/parser/record.d.ts +3 -3
  78. package/lib/parser/record.js +20 -24
  79. package/lib/parser/resourceLocation.d.ts +2 -2
  80. package/lib/parser/resourceLocation.js +14 -18
  81. package/lib/parser/string.d.ts +5 -5
  82. package/lib/parser/string.js +36 -42
  83. package/lib/parser/symbol.d.ts +3 -3
  84. package/lib/parser/symbol.js +3 -7
  85. package/lib/parser/util.d.ts +5 -5
  86. package/lib/parser/util.js +38 -56
  87. package/lib/processor/ColorInfoProvider.d.ts +1 -1
  88. package/lib/processor/ColorInfoProvider.js +6 -9
  89. package/lib/processor/InlayHintProvider.d.ts +2 -2
  90. package/lib/processor/InlayHintProvider.js +1 -2
  91. package/lib/processor/SignatureHelpProvider.d.ts +2 -2
  92. package/lib/processor/SignatureHelpProvider.js +1 -2
  93. package/lib/processor/checker/Checker.d.ts +2 -2
  94. package/lib/processor/checker/Checker.js +1 -5
  95. package/lib/processor/checker/builtin.d.ts +4 -4
  96. package/lib/processor/checker/builtin.js +19 -30
  97. package/lib/processor/checker/index.d.ts +2 -2
  98. package/lib/processor/checker/index.js +2 -31
  99. package/lib/processor/colorizer/Colorizer.d.ts +4 -4
  100. package/lib/processor/colorizer/Colorizer.js +8 -11
  101. package/lib/processor/colorizer/builtin.d.ts +3 -3
  102. package/lib/processor/colorizer/builtin.js +33 -46
  103. package/lib/processor/colorizer/index.d.ts +2 -2
  104. package/lib/processor/colorizer/index.js +2 -31
  105. package/lib/processor/completer/Completer.d.ts +4 -4
  106. package/lib/processor/completer/Completer.js +14 -33
  107. package/lib/processor/completer/builtin.d.ts +7 -7
  108. package/lib/processor/completer/builtin.js +46 -62
  109. package/lib/processor/completer/index.d.ts +2 -2
  110. package/lib/processor/completer/index.js +2 -31
  111. package/lib/processor/formatter/Formatter.d.ts +2 -2
  112. package/lib/processor/formatter/Formatter.js +2 -7
  113. package/lib/processor/formatter/builtin.d.ts +3 -3
  114. package/lib/processor/formatter/builtin.js +22 -36
  115. package/lib/processor/formatter/index.d.ts +2 -2
  116. package/lib/processor/formatter/index.js +2 -31
  117. package/lib/processor/index.d.ts +9 -9
  118. package/lib/processor/index.js +9 -25
  119. package/lib/processor/linter/Linter.d.ts +2 -2
  120. package/lib/processor/linter/Linter.js +1 -2
  121. package/lib/processor/linter/builtin/undeclaredSymbol.d.ts +2 -2
  122. package/lib/processor/linter/builtin/undeclaredSymbol.js +20 -24
  123. package/lib/processor/linter/builtin.d.ts +3 -3
  124. package/lib/processor/linter/builtin.js +19 -26
  125. package/lib/processor/linter/index.d.ts +2 -2
  126. package/lib/processor/linter/index.js +2 -31
  127. package/lib/processor/util.d.ts +2 -2
  128. package/lib/processor/util.js +4 -9
  129. package/lib/service/CacheService.d.ts +6 -6
  130. package/lib/service/CacheService.js +32 -56
  131. package/lib/service/Config.d.ts +11 -12
  132. package/lib/service/Config.js +50 -45
  133. package/lib/service/Context.d.ts +13 -13
  134. package/lib/service/Context.js +29 -32
  135. package/lib/service/Dependency.js +2 -5
  136. package/lib/service/Downloader.d.ts +10 -40
  137. package/lib/service/Downloader.js +37 -110
  138. package/lib/service/ErrorReporter.d.ts +2 -2
  139. package/lib/service/ErrorReporter.js +10 -14
  140. package/lib/service/FileService.d.ts +16 -14
  141. package/lib/service/FileService.js +55 -92
  142. package/lib/service/Hover.d.ts +2 -2
  143. package/lib/service/Hover.js +4 -7
  144. package/lib/service/Logger.js +2 -5
  145. package/lib/service/MetaRegistry.d.ts +12 -12
  146. package/lib/service/MetaRegistry.js +62 -73
  147. package/lib/service/Operations.js +3 -9
  148. package/lib/service/Profiler.d.ts +1 -1
  149. package/lib/service/Profiler.js +25 -41
  150. package/lib/service/Project.d.ts +47 -51
  151. package/lib/service/Project.js +199 -239
  152. package/lib/service/Service.d.ts +17 -27
  153. package/lib/service/Service.js +37 -43
  154. package/lib/service/SymbolLocations.d.ts +3 -3
  155. package/lib/service/SymbolLocations.js +4 -7
  156. package/lib/service/SymbolRegistrar.d.ts +1 -1
  157. package/lib/service/SymbolRegistrar.js +1 -2
  158. package/lib/service/fileUtil.d.ts +15 -45
  159. package/lib/service/fileUtil.js +38 -143
  160. package/lib/service/index.d.ts +17 -17
  161. package/lib/service/index.js +17 -35
  162. package/lib/source/IndexMap.d.ts +1 -1
  163. package/lib/source/IndexMap.js +7 -10
  164. package/lib/source/LanguageError.d.ts +2 -2
  165. package/lib/source/LanguageError.js +2 -5
  166. package/lib/source/Location.d.ts +3 -3
  167. package/lib/source/Location.js +6 -9
  168. package/lib/source/Offset.d.ts +1 -1
  169. package/lib/source/Offset.js +4 -7
  170. package/lib/source/Position.js +2 -5
  171. package/lib/source/PositionRange.d.ts +2 -2
  172. package/lib/source/PositionRange.js +14 -17
  173. package/lib/source/Range.d.ts +1 -1
  174. package/lib/source/Range.js +7 -10
  175. package/lib/source/Source.d.ts +3 -3
  176. package/lib/source/Source.js +28 -29
  177. package/lib/source/index.d.ts +8 -8
  178. package/lib/source/index.js +8 -24
  179. package/lib/symbol/Symbol.d.ts +2 -2
  180. package/lib/symbol/Symbol.js +49 -65
  181. package/lib/symbol/SymbolUtil.d.ts +22 -25
  182. package/lib/symbol/SymbolUtil.js +150 -151
  183. package/lib/symbol/UriBinder.d.ts +1 -1
  184. package/lib/symbol/UriBinder.js +1 -2
  185. package/lib/symbol/index.d.ts +3 -3
  186. package/lib/symbol/index.js +3 -19
  187. package/package.json +7 -4
@@ -1,66 +1,52 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _ProfilerImpl_finalized, _ProfilerImpl_startTime, _ProfilerImpl_lastTime, _ProfilerImpl_tasks, _ProfilerImpl_longestTaskNameLength, _ProfilerFactory_enabledProfilers;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ProfilerFactory = void 0;
16
- const perf_hooks_1 = require("perf_hooks");
17
- const Logger_1 = require("./Logger");
1
+ import { Logger } from './Logger.js';
18
2
  const TotalTaskName = 'Total';
19
3
  class ProfilerImpl {
4
+ id;
5
+ logger;
6
+ #finalized = false;
7
+ #startTime;
8
+ #lastTime;
9
+ #tasks = [];
10
+ #longestTaskNameLength = 0;
20
11
  constructor(id, logger) {
21
12
  this.id = id;
22
13
  this.logger = logger;
23
- _ProfilerImpl_finalized.set(this, false);
24
- _ProfilerImpl_startTime.set(this, void 0);
25
- _ProfilerImpl_lastTime.set(this, void 0);
26
- _ProfilerImpl_tasks.set(this, []);
27
- _ProfilerImpl_longestTaskNameLength.set(this, 0);
28
- __classPrivateFieldSet(this, _ProfilerImpl_startTime, __classPrivateFieldSet(this, _ProfilerImpl_lastTime, perf_hooks_1.performance.now(), "f"), "f");
14
+ this.#startTime = this.#lastTime = performance.now();
29
15
  }
30
16
  task(name) {
31
- if (__classPrivateFieldGet(this, _ProfilerImpl_finalized, "f")) {
17
+ if (this.#finalized) {
32
18
  throw new Error('The profiler is finalized.');
33
19
  }
34
- const time = perf_hooks_1.performance.now();
35
- __classPrivateFieldGet(this, _ProfilerImpl_tasks, "f").push([name, time - __classPrivateFieldGet(this, _ProfilerImpl_lastTime, "f")]);
36
- __classPrivateFieldSet(this, _ProfilerImpl_lastTime, time, "f");
37
- __classPrivateFieldSet(this, _ProfilerImpl_longestTaskNameLength, Math.max(__classPrivateFieldGet(this, _ProfilerImpl_longestTaskNameLength, "f"), name.length), "f");
20
+ const time = performance.now();
21
+ this.#tasks.push([name, time - this.#lastTime]);
22
+ this.#lastTime = time;
23
+ this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, name.length);
38
24
  this.logger.info(`[Profiler: ${this.id}] Done: ${name}`);
39
25
  return this;
40
26
  }
41
27
  finalize() {
42
- __classPrivateFieldSet(this, _ProfilerImpl_finalized, true, "f");
43
- __classPrivateFieldGet(this, _ProfilerImpl_tasks, "f").push([TotalTaskName, __classPrivateFieldGet(this, _ProfilerImpl_lastTime, "f") - __classPrivateFieldGet(this, _ProfilerImpl_startTime, "f")]);
44
- __classPrivateFieldSet(this, _ProfilerImpl_longestTaskNameLength, Math.max(__classPrivateFieldGet(this, _ProfilerImpl_longestTaskNameLength, "f"), TotalTaskName.length), "f");
28
+ this.#finalized = true;
29
+ this.#tasks.push([TotalTaskName, this.#lastTime - this.#startTime]);
30
+ this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, TotalTaskName.length);
45
31
  this.logger.info(`[Profiler: ${this.id}] == Summary ==`);
46
- for (const [name, time] of __classPrivateFieldGet(this, _ProfilerImpl_tasks, "f")) {
47
- this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(__classPrivateFieldGet(this, _ProfilerImpl_longestTaskNameLength, "f") - name.length)} - ${time} ms`);
32
+ for (const [name, time] of this.#tasks) {
33
+ this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(this.#longestTaskNameLength - name.length)} - ${time} ms`);
48
34
  }
49
35
  }
50
36
  }
51
- _ProfilerImpl_finalized = new WeakMap(), _ProfilerImpl_startTime = new WeakMap(), _ProfilerImpl_lastTime = new WeakMap(), _ProfilerImpl_tasks = new WeakMap(), _ProfilerImpl_longestTaskNameLength = new WeakMap();
52
37
  class NoopImpl {
53
38
  task() { return this; }
54
39
  finalize() { }
55
40
  }
56
- class ProfilerFactory {
41
+ export class ProfilerFactory {
42
+ logger;
43
+ #enabledProfilers;
57
44
  constructor(logger, enabledProfilers) {
58
45
  this.logger = logger;
59
- _ProfilerFactory_enabledProfilers.set(this, void 0);
60
- __classPrivateFieldSet(this, _ProfilerFactory_enabledProfilers, new Set(enabledProfilers), "f");
46
+ this.#enabledProfilers = new Set(enabledProfilers);
61
47
  }
62
48
  get(id) {
63
- if (__classPrivateFieldGet(this, _ProfilerFactory_enabledProfilers, "f").has(id)) {
49
+ if (this.#enabledProfilers.has(id)) {
64
50
  return new ProfilerImpl(id, this.logger);
65
51
  }
66
52
  else {
@@ -68,9 +54,7 @@ class ProfilerFactory {
68
54
  }
69
55
  }
70
56
  static noop() {
71
- return new ProfilerFactory(Logger_1.Logger.noop(), []);
57
+ return new ProfilerFactory(Logger.noop(), []);
72
58
  }
73
59
  }
74
- exports.ProfilerFactory = ProfilerFactory;
75
- _ProfilerFactory_enabledProfilers = new WeakMap();
76
60
  //# sourceMappingURL=Profiler.js.map
@@ -1,32 +1,33 @@
1
- /// <reference types="node" />
2
- import EventEmitter from 'events';
3
1
  import type { TextDocumentContentChangeEvent } from 'vscode-languageserver-textdocument';
4
2
  import { TextDocument } from 'vscode-languageserver-textdocument';
5
- import type { AstNode } from '../node';
6
- import { FileNode } from '../node';
7
- import type { LanguageError } from '../source';
8
- import { SymbolUtil } from '../symbol';
9
- import { CacheService } from './CacheService';
10
- import type { Config } from './Config';
11
- import { Downloader } from './Downloader';
12
- import { FileService } from './FileService';
13
- import type { RootUriString } from './fileUtil';
14
- import { Logger } from './Logger';
15
- import { MetaRegistry } from './MetaRegistry';
16
- import { ProfilerFactory } from './Profiler';
17
- export declare type ProjectInitializerContext = Pick<Project, 'cacheRoot' | 'config' | 'downloader' | 'logger' | 'meta' | 'projectRoot'>;
3
+ import type { ExternalEventEmitter, Externals } from '../common/index.js';
4
+ import type { AstNode } from '../node/index.js';
5
+ import { FileNode } from '../node/index.js';
6
+ import type { LanguageError } from '../source/index.js';
7
+ import { SymbolUtil } from '../symbol/index.js';
8
+ import { CacheService } from './CacheService.js';
9
+ import type { Config } from './Config.js';
10
+ import { Downloader } from './Downloader.js';
11
+ import { FileService } from './FileService.js';
12
+ import type { RootUriString } from './fileUtil.js';
13
+ import { Logger } from './Logger.js';
14
+ import { MetaRegistry } from './MetaRegistry.js';
15
+ import { ProfilerFactory } from './Profiler.js';
16
+ export declare type ProjectInitializerContext = Pick<Project, 'cacheRoot' | 'config' | 'downloader' | 'externals' | 'logger' | 'meta' | 'projectRoot'>;
18
17
  export declare type ProjectInitializer = (this: void, ctx: ProjectInitializerContext) => PromiseLike<Record<string, string> | void> | Record<string, string> | void;
19
- interface Options {
20
- cacheRoot: string;
18
+ export interface ProjectOptions {
19
+ cacheRoot: RootUriString;
20
+ defaultConfig?: Config;
21
21
  downloader?: Downloader;
22
+ externals: Externals;
22
23
  fs?: FileService;
23
24
  initializers?: readonly ProjectInitializer[];
24
25
  logger?: Logger;
25
26
  profilers?: ProfilerFactory;
26
27
  /**
27
- * A file path to the root of this project.
28
+ * A file URI to the root of this project.
28
29
  */
29
- projectPath: string;
30
+ projectRoot: RootUriString;
30
31
  symbols?: SymbolUtil;
31
32
  }
32
33
  export interface DocAndNode {
@@ -50,48 +51,22 @@ interface SymbolRegistrarEvent {
50
51
  id: string;
51
52
  checksum: string | undefined;
52
53
  }
53
- export declare type ProjectData = Pick<Project, 'cacheRoot' | 'config' | 'downloader' | 'ensureParsedAndChecked' | 'fs' | 'get' | 'logger' | 'meta' | 'profilers' | 'projectRoot' | 'roots' | 'symbols' | 'ctx'>;
54
- export declare namespace ProjectData {
55
- function mock(data?: Partial<ProjectData>): ProjectData;
56
- }
57
- export interface Project extends EventEmitter {
58
- on(event: 'documentErrorred', callbackFn: (data: DocumentErrorEvent) => void): this;
59
- on(event: 'documentUpdated', callbackFn: (data: DocumentEvent) => void): this;
60
- on(event: 'documentRemoved', callbackFn: (data: FileEvent) => void): this;
61
- on(event: `file${'Created' | 'Modified' | 'Deleted'}`, callbackFn: (data: FileEvent) => void): this;
62
- on(event: 'ready', callbackFn: (data: EmptyEvent) => void): this;
63
- on(event: 'rootsUpdated', callbackFn: (data: RootsEvent) => void): this;
64
- on(event: 'symbolRegistrarExecuted', callbackFn: (data: SymbolRegistrarEvent) => void): this;
65
- once(event: 'documentErrorred', callbackFn: (data: DocumentErrorEvent) => void): this;
66
- once(event: 'documentUpdated', callbackFn: (data: DocumentEvent) => void): this;
67
- once(event: 'documentRemoved', callbackFn: (data: FileEvent) => void): this;
68
- once(event: `file${'Created' | 'Modified' | 'Deleted'}`, callbackFn: (data: FileEvent) => void): this;
69
- once(event: 'ready', callbackFn: (data: EmptyEvent) => void): this;
70
- once(event: 'rootsUpdated', callbackFn: (data: RootsEvent) => void): this;
71
- once(event: 'symbolRegistrarExecuted', callbackFn: (data: SymbolRegistrarEvent) => void): this;
72
- emit(event: 'documentErrorred', data: DocumentErrorEvent): boolean;
73
- emit(event: 'documentUpdated', data: DocumentEvent): boolean;
74
- emit(event: 'documentRemoved', data: FileEvent): boolean;
75
- emit(event: `file${'Created' | 'Modified' | 'Deleted'}`, data: FileEvent): boolean;
76
- emit(event: 'ready', data: EmptyEvent): boolean;
77
- emit(event: 'rootsUpdated', data: RootsEvent): boolean;
78
- emit(event: 'symbolRegistrarExecuted', data: SymbolRegistrarEvent): boolean;
79
- }
54
+ export declare type ProjectData = Pick<Project, 'cacheRoot' | 'config' | 'downloader' | 'ensureParsedAndChecked' | 'externals' | 'fs' | 'get' | 'logger' | 'meta' | 'profilers' | 'projectRoot' | 'roots' | 'symbols' | 'ctx'>;
80
55
  /**
81
56
  * Manage all tracked documents and errors.
82
57
  */
83
- export declare class Project extends EventEmitter {
58
+ export declare class Project implements ExternalEventEmitter {
84
59
  #private;
85
60
  private static readonly RootSuffix;
86
61
  readonly cacheService: CacheService;
87
62
  get isReady(): boolean;
88
63
  config: Config;
89
64
  readonly downloader: Downloader;
65
+ readonly externals: Externals;
90
66
  readonly fs: FileService;
91
67
  readonly logger: Logger;
92
68
  readonly meta: MetaRegistry;
93
69
  readonly profilers: ProfilerFactory;
94
- readonly projectPath: string;
95
70
  readonly projectRoot: RootUriString;
96
71
  symbols: SymbolUtil;
97
72
  /**
@@ -109,10 +84,31 @@ export declare class Project extends EventEmitter {
109
84
  */
110
85
  get ctx(): Record<string, string>;
111
86
  /**
112
- * File path to a directory where all cache files of Spyglass should be stored.
87
+ * File URI to a directory where all cache files of Spyglass should be stored.
113
88
  */
114
- get cacheRoot(): string;
89
+ get cacheRoot(): RootUriString;
115
90
  private updateRoots;
91
+ on(event: 'documentErrorred', callbackFn: (data: DocumentErrorEvent) => void): this;
92
+ on(event: 'documentUpdated', callbackFn: (data: DocumentEvent) => void): this;
93
+ on(event: 'documentRemoved', callbackFn: (data: FileEvent) => void): this;
94
+ on(event: `file${'Created' | 'Modified' | 'Deleted'}`, callbackFn: (data: FileEvent) => void): this;
95
+ on(event: 'ready', callbackFn: (data: EmptyEvent) => void): this;
96
+ on(event: 'rootsUpdated', callbackFn: (data: RootsEvent) => void): this;
97
+ on(event: 'symbolRegistrarExecuted', callbackFn: (data: SymbolRegistrarEvent) => void): this;
98
+ once(event: 'documentErrorred', callbackFn: (data: DocumentErrorEvent) => void): this;
99
+ once(event: 'documentUpdated', callbackFn: (data: DocumentEvent) => void): this;
100
+ once(event: 'documentRemoved', callbackFn: (data: FileEvent) => void): this;
101
+ once(event: `file${'Created' | 'Modified' | 'Deleted'}`, callbackFn: (data: FileEvent) => void): this;
102
+ once(event: 'ready', callbackFn: (data: EmptyEvent) => void): this;
103
+ once(event: 'rootsUpdated', callbackFn: (data: RootsEvent) => void): this;
104
+ once(event: 'symbolRegistrarExecuted', callbackFn: (data: SymbolRegistrarEvent) => void): this;
105
+ emit(event: 'documentErrorred', data: DocumentErrorEvent): boolean;
106
+ emit(event: 'documentUpdated', data: DocumentEvent): boolean;
107
+ emit(event: 'documentRemoved', data: FileEvent): boolean;
108
+ emit(event: `file${'Created' | 'Modified' | 'Deleted'}`, data: FileEvent): boolean;
109
+ emit(event: 'ready', data: EmptyEvent): boolean;
110
+ emit(event: 'rootsUpdated', data: RootsEvent): boolean;
111
+ emit(event: 'symbolRegistrarExecuted', data: SymbolRegistrarEvent): boolean;
116
112
  /**
117
113
  * Get all files that are tracked and supported.
118
114
  *
@@ -120,7 +116,7 @@ export declare class Project extends EventEmitter {
120
116
  * are not loaded into the memory.
121
117
  */
122
118
  getTrackedFiles(): string[];
123
- constructor({ cacheRoot, downloader, fs, initializers, logger, profilers, projectPath, }: Options);
119
+ constructor({ cacheRoot, defaultConfig, downloader, externals, fs, initializers, logger, profilers, projectRoot, }: ProjectOptions);
124
120
  private setInitPromise;
125
121
  private setReadyPromise;
126
122
  init(): Promise<this>;