@@ -15,36 +15,36 @@ namespace ts {
15
15
/**
16
16
* Information of the file eg. its version, signature etc
17
17
*/
18
- fileInfos : ReadonlyMap < Path , BuilderState . FileInfo > ;
18
+ fileInfos : ReadonlyESMap < Path , BuilderState . FileInfo > ;
19
19
/**
20
20
* Contains the map of ReferencedSet=Referenced files of the file if module emit is enabled
21
21
* Otherwise undefined
22
22
* Thus non undefined value indicates, module emit
23
23
*/
24
- readonly referencedMap ?: ReadonlyMap < Path , BuilderState . ReferencedSet > | undefined ;
24
+ readonly referencedMap ?: ReadonlyESMap < Path , BuilderState . ReferencedSet > | undefined ;
25
25
/**
26
26
* Contains the map of exported modules ReferencedSet=exported module files from the file if module emit is enabled
27
27
* Otherwise undefined
28
28
*/
29
- readonly exportedModulesMap ?: ReadonlyMap < Path , BuilderState . ReferencedSet > | undefined ;
29
+ readonly exportedModulesMap ?: ReadonlyESMap < Path , BuilderState . ReferencedSet > | undefined ;
30
30
}
31
31
32
32
export interface BuilderState {
33
33
/**
34
34
* Information of the file eg. its version, signature etc
35
35
*/
36
- fileInfos : Map < Path , BuilderState . FileInfo > ;
36
+ fileInfos : ESMap < Path , BuilderState . FileInfo > ;
37
37
/**
38
38
* Contains the map of ReferencedSet=Referenced files of the file if module emit is enabled
39
39
* Otherwise undefined
40
40
* Thus non undefined value indicates, module emit
41
41
*/
42
- readonly referencedMap : ReadonlyMap < Path , BuilderState . ReferencedSet > | undefined ;
42
+ readonly referencedMap : ReadonlyESMap < Path , BuilderState . ReferencedSet > | undefined ;
43
43
/**
44
44
* Contains the map of exported modules ReferencedSet=exported module files from the file if module emit is enabled
45
45
* Otherwise undefined
46
46
*/
47
- readonly exportedModulesMap : Map < Path , BuilderState . ReferencedSet > | undefined ;
47
+ readonly exportedModulesMap : ESMap < Path , BuilderState . ReferencedSet > | undefined ;
48
48
/**
49
49
* Map of files that have already called update signature.
50
50
* That means hence forth these files are assumed to have
@@ -83,7 +83,7 @@ namespace ts {
83
83
* Exported modules to from declaration emit being computed.
84
84
* This can contain false in the affected file path to specify that there are no exported module(types from other modules) for this file
85
85
*/
86
- export type ComputingExportedModulesMap = Map < Path , ReferencedSet | false > ;
86
+ export type ComputingExportedModulesMap = ESMap < Path , ReferencedSet | false > ;
87
87
88
88
/**
89
89
* Get the referencedFile from the imported module symbol
@@ -192,7 +192,7 @@ namespace ts {
192
192
/**
193
193
* Returns true if oldState is reusable, that is the emitKind = module/non module has not changed
194
194
*/
195
- export function canReuseOldState ( newReferencedMap : ReadonlyMap < Path , ReferencedSet > | undefined , oldState : Readonly < ReusableBuilderState > | undefined ) {
195
+ export function canReuseOldState ( newReferencedMap : ReadonlyESMap < Path , ReferencedSet > | undefined , oldState : Readonly < ReusableBuilderState > | undefined ) {
196
196
return oldState && ! oldState . referencedMap === ! newReferencedMap ;
197
197
}
198
198
@@ -258,7 +258,7 @@ namespace ts {
258
258
/**
259
259
* Gets the files affected by the path from the program
260
260
*/
261
- export function getFilesAffectedBy ( state : BuilderState , programOfThisState : Program , path : Path , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash , cacheToUpdateSignature ?: Map < Path , string > , exportedModulesMapCache ?: ComputingExportedModulesMap ) : readonly SourceFile [ ] {
261
+ export function getFilesAffectedBy ( state : BuilderState , programOfThisState : Program , path : Path , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash , cacheToUpdateSignature ?: ESMap < Path , string > , exportedModulesMapCache ?: ComputingExportedModulesMap ) : readonly SourceFile [ ] {
262
262
// Since the operation could be cancelled, the signatures are always stored in the cache
263
263
// They will be committed once it is safe to use them
264
264
// eg when calling this api from tsserver, if there is no cancellation of the operation
@@ -285,7 +285,7 @@ namespace ts {
285
285
* Updates the signatures from the cache into state's fileinfo signatures
286
286
* This should be called whenever it is safe to commit the state of the builder
287
287
*/
288
- export function updateSignaturesFromCache ( state : BuilderState , signatureCache : Map < Path , string > ) {
288
+ export function updateSignaturesFromCache ( state : BuilderState , signatureCache : ESMap < Path , string > ) {
289
289
signatureCache . forEach ( ( signature , path ) => updateSignatureOfFile ( state , signature , path ) ) ;
290
290
}
291
291
@@ -297,7 +297,7 @@ namespace ts {
297
297
/**
298
298
* Returns if the shape of the signature has changed since last emit
299
299
*/
300
- export function updateShapeSignature ( state : Readonly < BuilderState > , programOfThisState : Program , sourceFile : SourceFile , cacheToUpdateSignature : Map < Path , string > , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash , exportedModulesMapCache ?: ComputingExportedModulesMap ) {
300
+ export function updateShapeSignature ( state : Readonly < BuilderState > , programOfThisState : Program , sourceFile : SourceFile , cacheToUpdateSignature : ESMap < Path , string > , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash , exportedModulesMapCache ?: ComputingExportedModulesMap ) {
301
301
Debug . assert ( ! ! sourceFile ) ;
302
302
Debug . assert ( ! exportedModulesMapCache || ! ! state . exportedModulesMap , "Compute visible to outside map only if visibleToOutsideReferencedMap present in the state" ) ;
303
303
@@ -518,7 +518,7 @@ namespace ts {
518
518
/**
519
519
* When program emits modular code, gets the files affected by the sourceFile whose shape has changed
520
520
*/
521
- function getFilesAffectedByUpdatedShapeWhenModuleEmit ( state : BuilderState , programOfThisState : Program , sourceFileWithUpdatedShape : SourceFile , cacheToUpdateSignature : Map < Path , string > , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash | undefined , exportedModulesMapCache : ComputingExportedModulesMap | undefined ) {
521
+ function getFilesAffectedByUpdatedShapeWhenModuleEmit ( state : BuilderState , programOfThisState : Program , sourceFileWithUpdatedShape : SourceFile , cacheToUpdateSignature : ESMap < Path , string > , cancellationToken : CancellationToken | undefined , computeHash : ComputeHash | undefined , exportedModulesMapCache : ComputingExportedModulesMap | undefined ) {
522
522
if ( isFileAffectingGlobalScope ( sourceFileWithUpdatedShape ) ) {
523
523
return getAllFilesExcludingDefaultLibraryFile ( state , programOfThisState , sourceFileWithUpdatedShape ) ;
524
524
}
0 commit comments