brighterscript 1.0.0-alpha.26 → 1.0.0-alpha.27

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 (128) hide show
  1. package/CHANGELOG.md +21 -5
  2. package/dist/AstValidationSegmenter.d.ts +1 -1
  3. package/dist/AstValidationSegmenter.js +2 -3
  4. package/dist/AstValidationSegmenter.js.map +1 -1
  5. package/dist/DiagnosticMessages.d.ts +1 -3
  6. package/dist/DiagnosticMessages.js +5 -8
  7. package/dist/DiagnosticMessages.js.map +1 -1
  8. package/dist/Program.js +24 -25
  9. package/dist/Program.js.map +1 -1
  10. package/dist/Scope.d.ts +2 -8
  11. package/dist/Scope.js +20 -22
  12. package/dist/Scope.js.map +1 -1
  13. package/dist/SymbolTable.d.ts +1 -8
  14. package/dist/SymbolTable.js +1 -10
  15. package/dist/SymbolTable.js.map +1 -1
  16. package/dist/SymbolTableFlag.d.ts +8 -0
  17. package/dist/SymbolTableFlag.js +13 -0
  18. package/dist/SymbolTableFlag.js.map +1 -0
  19. package/dist/XmlScope.d.ts +1 -1
  20. package/dist/XmlScope.js +6 -7
  21. package/dist/XmlScope.js.map +1 -1
  22. package/dist/astUtils/CachedLookups.d.ts +1 -2
  23. package/dist/astUtils/CachedLookups.js +0 -11
  24. package/dist/astUtils/CachedLookups.js.map +1 -1
  25. package/dist/astUtils/creators.js +45 -6
  26. package/dist/astUtils/creators.js.map +1 -1
  27. package/dist/astUtils/reflection.d.ts +2 -0
  28. package/dist/astUtils/reflection.js +11 -3
  29. package/dist/astUtils/reflection.js.map +1 -1
  30. package/dist/astUtils/reflection.spec.js +1 -1
  31. package/dist/astUtils/reflection.spec.js.map +1 -1
  32. package/dist/bscPlugin/completions/CompletionsProcessor.js +20 -20
  33. package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
  34. package/dist/bscPlugin/hover/HoverProcessor.d.ts +1 -0
  35. package/dist/bscPlugin/hover/HoverProcessor.js +26 -6
  36. package/dist/bscPlugin/hover/HoverProcessor.js.map +1 -1
  37. package/dist/bscPlugin/hover/HoverProcessor.spec.js +74 -2
  38. package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
  39. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +2 -3
  40. package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -1
  41. package/dist/bscPlugin/validation/BrsFileValidator.js +25 -26
  42. package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
  43. package/dist/bscPlugin/validation/ScopeValidator.d.ts +6 -0
  44. package/dist/bscPlugin/validation/ScopeValidator.js +70 -20
  45. package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
  46. package/dist/bscPlugin/validation/ScopeValidator.spec.js +92 -10
  47. package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
  48. package/dist/diagnosticUtils.d.ts +1 -1
  49. package/dist/files/BrsFile.Class.spec.js +4 -3
  50. package/dist/files/BrsFile.Class.spec.js.map +1 -1
  51. package/dist/files/BrsFile.d.ts +3 -4
  52. package/dist/files/BrsFile.js +19 -112
  53. package/dist/files/BrsFile.js.map +1 -1
  54. package/dist/files/BrsFile.spec.js +56 -156
  55. package/dist/files/BrsFile.spec.js.map +1 -1
  56. package/dist/files/XmlFile.d.ts +2 -3
  57. package/dist/files/XmlFile.js +0 -2
  58. package/dist/files/XmlFile.js.map +1 -1
  59. package/dist/interfaces.d.ts +77 -83
  60. package/dist/interfaces.js +9 -9
  61. package/dist/interfaces.js.map +1 -1
  62. package/dist/parser/Expression.d.ts +85 -91
  63. package/dist/parser/Expression.js +50 -28
  64. package/dist/parser/Expression.js.map +1 -1
  65. package/dist/parser/Parser.Class.spec.js +15 -16
  66. package/dist/parser/Parser.Class.spec.js.map +1 -1
  67. package/dist/parser/Parser.d.ts +1 -2
  68. package/dist/parser/Parser.js +68 -62
  69. package/dist/parser/Parser.js.map +1 -1
  70. package/dist/parser/Parser.spec.js +27 -28
  71. package/dist/parser/Parser.spec.js.map +1 -1
  72. package/dist/parser/SGParser.js +49 -35
  73. package/dist/parser/SGParser.js.map +1 -1
  74. package/dist/parser/SGTypes.d.ts +36 -24
  75. package/dist/parser/SGTypes.js +26 -55
  76. package/dist/parser/SGTypes.js.map +1 -1
  77. package/dist/parser/Statement.d.ts +138 -139
  78. package/dist/parser/Statement.js +50 -37
  79. package/dist/parser/Statement.js.map +1 -1
  80. package/dist/parser/tests/expression/TypeExpression.spec.js +8 -9
  81. package/dist/parser/tests/expression/TypeExpression.spec.js.map +1 -1
  82. package/dist/parser/tests/statement/TryCatch.spec.js +9 -2
  83. package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
  84. package/dist/roku-types/data.json +70 -52
  85. package/dist/roku-types/index.d.ts +43 -21
  86. package/dist/types/ArrayType.js +1 -2
  87. package/dist/types/ArrayType.js.map +1 -1
  88. package/dist/types/ArrayType.spec.js +7 -8
  89. package/dist/types/ArrayType.spec.js.map +1 -1
  90. package/dist/types/AssociativeArrayType.js +2 -3
  91. package/dist/types/AssociativeArrayType.js.map +1 -1
  92. package/dist/types/BscType.d.ts +1 -1
  93. package/dist/types/BscType.js +2 -3
  94. package/dist/types/BscType.js.map +1 -1
  95. package/dist/types/BuiltInInterfaceAdder.js +7 -8
  96. package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
  97. package/dist/types/BuiltInInterfaceAdder.spec.js +31 -32
  98. package/dist/types/BuiltInInterfaceAdder.spec.js.map +1 -1
  99. package/dist/types/ClassType.spec.js +10 -11
  100. package/dist/types/ClassType.spec.js.map +1 -1
  101. package/dist/types/ComponentType.d.ts +2 -1
  102. package/dist/types/ComponentType.js.map +1 -1
  103. package/dist/types/EnumType.js +2 -3
  104. package/dist/types/EnumType.js.map +1 -1
  105. package/dist/types/InheritableType.js +3 -4
  106. package/dist/types/InheritableType.js.map +1 -1
  107. package/dist/types/InterfaceType.js +2 -3
  108. package/dist/types/InterfaceType.js.map +1 -1
  109. package/dist/types/InterfaceType.spec.js +3 -4
  110. package/dist/types/InterfaceType.spec.js.map +1 -1
  111. package/dist/types/ObjectType.js +1 -2
  112. package/dist/types/ObjectType.js.map +1 -1
  113. package/dist/types/ReferenceType.d.ts +1 -1
  114. package/dist/types/ReferenceType.spec.js +21 -22
  115. package/dist/types/ReferenceType.spec.js.map +1 -1
  116. package/dist/types/UnionType.js +3 -3
  117. package/dist/types/UnionType.js.map +1 -1
  118. package/dist/types/UnionType.spec.js +37 -38
  119. package/dist/types/UnionType.spec.js.map +1 -1
  120. package/dist/types/helper.spec.js +4 -5
  121. package/dist/types/helper.spec.js.map +1 -1
  122. package/dist/util.d.ts +3 -3
  123. package/dist/util.js +20 -19
  124. package/dist/util.js.map +1 -1
  125. package/dist/validators/ClassValidator.d.ts +0 -9
  126. package/dist/validators/ClassValidator.js +3 -46
  127. package/dist/validators/ClassValidator.js.map +1 -1
  128. package/package.json +1 -1
@@ -3,13 +3,12 @@ import type { Range, Diagnostic, CodeAction, SemanticTokenTypes, SemanticTokenMo
3
3
  import type { Scope } from './Scope';
4
4
  import type { BrsFile } from './files/BrsFile';
5
5
  import type { XmlFile } from './files/XmlFile';
6
- import type { FunctionScope } from './FunctionScope';
7
6
  import type { TypedFunctionType } from './types/TypedFunctionType';
8
7
  import type { ParseMode } from './parser/Parser';
9
8
  import type { Program } from './Program';
10
9
  import type { ProgramBuilder } from './ProgramBuilder';
11
10
  import type { ClassStatement, ConstStatement, EnumStatement, FunctionStatement, NamespaceStatement } from './parser/Statement';
12
- import type { AstNode, Expression, Statement } from './parser/AstNode';
11
+ import type { AstNode, AstNodeKind, Expression, Statement } from './parser/AstNode';
13
12
  import type { TranspileState } from './parser/TranspileState';
14
13
  import type { SourceNode } from 'source-map';
15
14
  import type { BscType } from './types/BscType';
@@ -18,8 +17,8 @@ import type { Identifier, Token } from './lexer/Token';
18
17
  import type { BscFile } from './files/BscFile';
19
18
  import type { FileFactory } from './files/Factory';
20
19
  import type { LazyFileData } from './files/LazyFileData';
21
- import type { SymbolTable, SymbolTypeFlag } from './SymbolTable';
22
- import type { CallExpression } from './parser/Expression';
20
+ import type { SymbolTable } from './SymbolTable';
21
+ import type { SymbolTypeFlag } from './SymbolTableFlag';
23
22
  export interface BsDiagnostic extends Diagnostic {
24
23
  file: BscFile;
25
24
  /**
@@ -73,28 +72,6 @@ export interface Callable {
73
72
  */
74
73
  functionStatement: FunctionStatement;
75
74
  }
76
- export interface FunctionCall {
77
- /**
78
- * The full range of this function call (from the start of the function name to its closing paren)
79
- */
80
- range: Range;
81
- expression: CallExpression;
82
- functionScope: FunctionScope;
83
- file: BscFile;
84
- name: string;
85
- args: CallableArg[];
86
- nameRange: Range;
87
- }
88
- /**
89
- * An argument for an expression call.
90
- */
91
- export interface CallableArg {
92
- text: string;
93
- type: BscType;
94
- typeToken: Token;
95
- range: Range;
96
- expression: Expression;
97
- }
98
75
  export interface CallableParam {
99
76
  name: string;
100
77
  type: BscType;
@@ -182,71 +159,71 @@ export interface CompilerPlugin {
182
159
  /**
183
160
  * Called before a new program is created
184
161
  */
185
- beforeProgramCreate?: PluginHandler<BeforeProgramCreateEvent>;
162
+ beforeProgramCreate?(event: BeforeProgramCreateEvent): any;
186
163
  /**
187
164
  * Called after a new program is created
188
165
  */
189
- afterProgramCreate?: PluginHandler<AfterProgramCreateEvent>;
166
+ afterProgramCreate?(event: AfterProgramCreateEvent): any;
190
167
  /**
191
168
  * Called before the program gets prepared for building
192
169
  */
193
- beforePrepareProgram?: PluginHandler<BeforePrepareProgramEvent>;
170
+ beforePrepareProgram?(event: BeforePrepareProgramEvent): any;
194
171
  /**
195
172
  * Called when the program gets prepared for building
196
173
  */
197
- prepareProgram?: PluginHandler<PrepareProgramEvent>;
174
+ prepareProgram?(event: PrepareProgramEvent): any;
198
175
  /**
199
176
  * Called after the program gets prepared for building
200
177
  */
201
- afterPrepareProgram?: PluginHandler<AfterPrepareProgramEvent>;
178
+ afterPrepareProgram?(event: AfterPrepareProgramEvent): any;
202
179
  /**
203
180
  * Called before the entire program is validated
204
181
  */
205
- beforeProgramValidate?: PluginHandler<BeforeProgramValidateEvent>;
182
+ beforeProgramValidate?(event: BeforeProgramValidateEvent): any;
206
183
  /**
207
184
  * Called before the entire program is validated
208
185
  */
209
- onProgramValidate?: PluginHandler<OnProgramValidateEvent>;
186
+ onProgramValidate?(event: OnProgramValidateEvent): any;
210
187
  /**
211
188
  * Called after the program has been validated
212
189
  */
213
- afterProgramValidate?: PluginHandler<AfterProgramValidateEvent>;
190
+ afterProgramValidate?(event: AfterProgramValidateEvent): any;
214
191
  /**
215
192
  * Called right before the program is disposed/destroyed
216
193
  */
217
- beforeProgramDispose?: PluginHandler<BeforeProgramDisposeEvent>;
194
+ beforeProgramDispose?(event: BeforeProgramDisposeEvent): any;
218
195
  /**
219
196
  * Emitted before the program starts collecting completions
220
197
  */
221
- beforeProvideCompletions?: PluginHandler<BeforeProvideCompletionsEvent>;
198
+ beforeProvideCompletions?(event: BeforeProvideCompletionsEvent): any;
222
199
  /**
223
200
  * Use this event to contribute completions
224
201
  */
225
- provideCompletions?: PluginHandler<ProvideCompletionsEvent>;
202
+ provideCompletions?(event: ProvideCompletionsEvent): any;
226
203
  /**
227
204
  * Emitted after the program has finished collecting completions, but before they are sent to the client
228
205
  */
229
- afterProvideCompletions?: PluginHandler<AfterProvideCompletionsEvent>;
206
+ afterProvideCompletions?(event: AfterProvideCompletionsEvent): any;
230
207
  /**
231
208
  * Called before the `provideHover` hook. Use this if you need to prepare any of the in-memory objects before the `provideHover` gets called
232
209
  */
233
- beforeProvideHover?: PluginHandler<BeforeProvideHoverEvent>;
210
+ beforeProvideHover?(event: BeforeProvideHoverEvent): any;
234
211
  /**
235
212
  * Called when bsc looks for hover information. Use this if your plugin wants to contribute hover information.
236
213
  */
237
- provideHover?: PluginHandler<ProvideHoverEvent>;
214
+ provideHover?(event: ProvideHoverEvent): any;
238
215
  /**
239
216
  * Called after the `provideHover` hook. Use this if you want to intercept or sanitize the hover data (even from other plugins) before it gets sent to the client.
240
217
  */
241
- afterProvideHover?: PluginHandler<AfterProvideHoverEvent>;
218
+ afterProvideHover?(event: AfterProvideHoverEvent): any;
242
219
  /**
243
220
  * Called after a scope was created
244
221
  */
245
- afterScopeCreate?: PluginHandler<AfterScopeCreateEvent>;
246
- beforeScopeDispose?: PluginHandler<BeforeScopeDisposeEvent>;
247
- onScopeDispose?: PluginHandler<OnScopeDisposeEvent>;
248
- afterScopeDispose?: PluginHandler<AfterScopeDisposeEvent>;
249
- beforeScopeValidate?: PluginHandler<BeforeScopeValidateEvent>;
222
+ afterScopeCreate?(event: AfterScopeCreateEvent): any;
223
+ beforeScopeDispose?(event: BeforeScopeDisposeEvent): any;
224
+ onScopeDispose?(event: OnScopeDisposeEvent): any;
225
+ afterScopeDispose?(event: AfterScopeDisposeEvent): any;
226
+ beforeScopeValidate?(event: BeforeScopeValidateEvent): any;
250
227
  /**
251
228
  * Called before the `provideDefinition` hook
252
229
  */
@@ -261,120 +238,119 @@ export interface CompilerPlugin {
261
238
  * @param event
262
239
  */
263
240
  afterProvideDefinition?(event: AfterProvideDefinitionEvent): any;
264
- onScopeValidate?: PluginHandler<OnScopeValidateEvent>;
265
- afterScopeValidate?: PluginHandler<BeforeScopeValidateEvent>;
266
- onGetCodeActions?: PluginHandler<OnGetCodeActionsEvent>;
267
- onGetSemanticTokens?: PluginHandler<OnGetSemanticTokensEvent>;
241
+ onScopeValidate?(event: OnScopeValidateEvent): any;
242
+ afterScopeValidate?(event: BeforeScopeValidateEvent): any;
243
+ onGetCodeActions?(event: OnGetCodeActionsEvent): any;
244
+ onGetSemanticTokens?(event: OnGetSemanticTokensEvent): any;
268
245
  /**
269
246
  * Called before plugins are asked to provide files to the program. (excludes virtual files produced by `provideFile` events).
270
247
  * Call the `setFileData()` method to override the file contents.
271
248
  */
272
- beforeProvideFile?: PluginHandler<BeforeProvideFileEvent>;
249
+ beforeProvideFile?(event: BeforeProvideFileEvent): any;
273
250
  /**
274
251
  * Give plugins the opportunity to handle processing a file. (excludes virtual files produced by `provideFile` events)
275
252
  */
276
- provideFile?: PluginHandler<ProvideFileEvent>;
253
+ provideFile?(event: ProvideFileEvent): any;
277
254
  /**
278
255
  * Called after a file was added to the program. (excludes virtual files produced by `provideFile` events)
279
256
  */
280
- afterProvideFile?: PluginHandler<AfterProvideFileEvent>;
257
+ afterProvideFile?(event: AfterProvideFileEvent): any;
281
258
  /**
282
259
  * Called before a file is added to the program.
283
260
  * Includes physical files as well as any virtual files produced by `provideFile` events
284
261
  */
285
- beforeFileAdd?: PluginHandler<BeforeFileAddEvent>;
262
+ beforeFileAdd?(event: BeforeFileAddEvent): any;
286
263
  /**
287
264
  * Called after a file has been added to the program.
288
265
  * Includes physical files as well as any virtual files produced by `provideFile` events
289
266
  */
290
- afterFileAdd?: PluginHandler<AfterFileAddEvent>;
267
+ afterFileAdd?(event: AfterFileAddEvent): any;
291
268
  /**
292
269
  * Called before a file is removed from the program. This includes physical and virtual files
293
270
  */
294
- beforeFileRemove?: PluginHandler<BeforeFileRemoveEvent>;
271
+ beforeFileRemove?(event: BeforeFileRemoveEvent): any;
295
272
  /**
296
273
  * Called after a file has been removed from the program. This includes physical and virtual files
297
274
  */
298
- afterFileRemove?: PluginHandler<AfterFileRemoveEvent>;
275
+ afterFileRemove?(event: AfterFileRemoveEvent): any;
299
276
  /**
300
277
  * Called before each file is validated
301
278
  */
302
- beforeFileValidate?: PluginHandler<BeforeFileValidateEvent>;
279
+ beforeFileValidate?(event: BeforeFileValidateEvent): any;
303
280
  /**
304
281
  * Called during the file validation process. If your plugin contributes file validations, this is a good place to contribute them.
305
282
  */
306
- onFileValidate?: PluginHandler<OnFileValidateEvent>;
283
+ onFileValidate?(event: OnFileValidateEvent): any;
307
284
  /**
308
285
  * Called after each file is validated
309
286
  */
310
- afterFileValidate?: PluginHandler<AfterFileValidateEvent>;
287
+ afterFileValidate?(event: AfterFileValidateEvent): any;
311
288
  /**
312
289
  * Called right before the program builds (i.e. generates the code and puts it in the stagingDir
313
290
  */
314
- beforeBuildProgram?: PluginHandler<BeforeBuildProgramEvent>;
291
+ beforeBuildProgram?(event: BeforeBuildProgramEvent): any;
315
292
  /**
316
293
  * Called right after the program builds (i.e. generates the code and puts it in the stagingDir
317
294
  */
318
- afterBuildProgram?: PluginHandler<AfterBuildProgramEvent>;
295
+ afterBuildProgram?(event: AfterBuildProgramEvent): any;
319
296
  /**
320
297
  * Before preparing the file for building
321
298
  */
322
- beforePrepareFile?: PluginHandler<BeforePrepareFileEvent>;
299
+ beforePrepareFile?(event: BeforePrepareFileEvent): any;
323
300
  /**
324
301
  * Prepare the file for building
325
302
  */
326
- prepareFile?: PluginHandler<PrepareFileEvent>;
303
+ prepareFile?(event: PrepareFileEvent): any;
327
304
  /**
328
305
  * After preparing the file for building
329
306
  */
330
- afterPrepareFile?: PluginHandler<AfterPrepareFileEvent>;
307
+ afterPrepareFile?(event: AfterPrepareFileEvent): any;
331
308
  /**
332
309
  * Before the program turns all file objects into their final buffers
333
310
  */
334
- beforeSerializeProgram?: PluginHandler<BeforeSerializeProgramEvent>;
311
+ beforeSerializeProgram?(event: BeforeSerializeProgramEvent): any;
335
312
  /**
336
313
  * Emitted right at the start of the program turning all file objects into their final buffers
337
314
  */
338
- onSerializeProgram?: PluginHandler<OnSerializeProgramEvent>;
315
+ onSerializeProgram?(event: OnSerializeProgramEvent): any;
339
316
  /**
340
317
  * After the program turns all file objects into their final buffers
341
318
  */
342
- afterSerializeProgram?: PluginHandler<AfterSerializeProgramEvent>;
319
+ afterSerializeProgram?(event: AfterSerializeProgramEvent): any;
343
320
  /**
344
321
  * Before turning the file into its final contents
345
322
  */
346
- beforeSerializeFile?: PluginHandler<BeforeSerializeFileEvent>;
323
+ beforeSerializeFile?(event: BeforeSerializeFileEvent): any;
347
324
  /**
348
325
  * Turn the file into its final contents (i.e. transpile a bs file, compress a jpeg, etc)
349
326
  */
350
- serializeFile?: PluginHandler<SerializeFileEvent>;
327
+ serializeFile?(event: SerializeFileEvent): any;
351
328
  /**
352
329
  * After turning the file into its final contents
353
330
  */
354
- afterSerializeFile?: PluginHandler<AfterSerializeFileEvent>;
331
+ afterSerializeFile?(event: AfterSerializeFileEvent): any;
355
332
  /**
356
333
  * Called before any files are written
357
334
  */
358
- beforeWriteProgram?: PluginHandler<BeforeWriteProgramEvent>;
335
+ beforeWriteProgram?(event: BeforeWriteProgramEvent): any;
359
336
  /**
360
337
  * Called after all files are written
361
338
  */
362
- afterWriteProgram?: PluginHandler<AfterWriteProgramEvent>;
339
+ afterWriteProgram?(event: AfterWriteProgramEvent): any;
363
340
  /**
364
341
  * Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
365
342
  */
366
- beforeWriteFile?: PluginHandler<BeforeWriteFileEvent>;
343
+ beforeWriteFile?(event: BeforeWriteFileEvent): any;
367
344
  /**
368
345
  * Called when a file should be persisted (usually writing to storage). These are raw files that contain the final output. One `File` may produce several of these.
369
346
  * When a plugin has handled a file, it should be pushed to the `handledFiles` set so future plugins don't write the file multiple times
370
347
  */
371
- writeFile?: PluginHandler<WriteFileEvent>;
348
+ writeFile?(event: WriteFileEvent): any;
372
349
  /**
373
350
  * Before a file is written to disk. These are raw files that contain the final output. One `File` may produce several of these
374
351
  */
375
- afterWriteFile?: PluginHandler<AfterWriteFileEvent>;
352
+ afterWriteFile?(event: AfterWriteFileEvent): any;
376
353
  }
377
- export declare type PluginHandler<T, R = void> = (event: T) => R;
378
354
  export interface OnGetCodeActionsEvent<TFile extends BscFile = BscFile> {
379
355
  program: Program;
380
356
  file: TFile;
@@ -726,13 +702,21 @@ export interface GetTypeOptions {
726
702
  ignoreCacheForRetrieval?: boolean;
727
703
  }
728
704
  export declare class TypeChainEntry {
729
- name: string;
730
- type: BscType;
731
- range: Range;
732
- separatorToken: Token;
733
- data: ExtraSymbolData;
734
- constructor(name: string, type: BscType, data: ExtraSymbolData, range: Range, separatorToken?: Token);
705
+ constructor(options: {
706
+ name: string;
707
+ type: BscType;
708
+ data: ExtraSymbolData;
709
+ range: Range;
710
+ separatorToken?: Token;
711
+ kind?: AstNodeKind;
712
+ });
735
713
  get isResolved(): boolean;
714
+ readonly name: string;
715
+ readonly type: BscType;
716
+ readonly data: ExtraSymbolData;
717
+ readonly range: Range;
718
+ readonly separatorToken: Token;
719
+ kind: AstNodeKind;
736
720
  }
737
721
  export interface TypeChainProcessResult {
738
722
  itemName: string;
@@ -773,3 +757,13 @@ export interface NamespaceContainer {
773
757
  namespaces?: Map<string, NamespaceContainer>;
774
758
  symbolTable: SymbolTable;
775
759
  }
760
+ /**
761
+ * Use Writable<T> to remove readonly flag from properties in T
762
+ * Be careful!
763
+ */
764
+ export declare type Writeable<T> = {
765
+ -readonly [P in keyof T]: T[P];
766
+ };
767
+ export declare type DeepWriteable<T> = {
768
+ -readonly [P in keyof T]: DeepWriteable<T[P]>;
769
+ };
@@ -11,15 +11,15 @@ var DiagnosticOrigin;
11
11
  DiagnosticOrigin["ASTSegment"] = "AstSegment";
12
12
  })(DiagnosticOrigin = exports.DiagnosticOrigin || (exports.DiagnosticOrigin = {}));
13
13
  class TypeChainEntry {
14
- constructor(name, type, data, range, separatorToken = (0, creators_1.createToken)(TokenKind_1.TokenKind.Dot)) {
15
- this.name = name;
16
- this.type = type;
17
- this.range = range;
18
- this.separatorToken = separatorToken;
19
- if (data) {
20
- // make a copy of this data
21
- this.data = Object.assign({}, data);
22
- }
14
+ constructor(options) {
15
+ var _a;
16
+ this.name = options.name;
17
+ // make a copy of this data
18
+ this.data = Object.assign({}, options.data);
19
+ this.type = options.type;
20
+ this.range = options.range;
21
+ this.separatorToken = (_a = options.separatorToken) !== null && _a !== void 0 ? _a : (0, creators_1.createToken)(TokenKind_1.TokenKind.Dot);
22
+ this.kind = options.kind;
23
23
  }
24
24
  get isResolved() {
25
25
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAqBA,kDAAkD;AAClD,iDAA8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