16
16
/// <reference path='services.ts' />
17
17
18
18
/* @internal */
19
- let debugObjectHost = ( function ( this : any ) { return this ; } ) ( ) ;
19
+ let debugObjectHost : { CollectGarbage ( ) : void } = ( function ( this : any ) { return this ; } ) ( ) ;
20
20
21
21
// We need to use 'null' to interface with the managed side.
22
22
/* tslint:disable:no-null-keyword */
@@ -119,13 +119,13 @@ namespace ts {
119
119
}
120
120
121
121
export interface Shim {
122
- dispose ( _dummy : any ) : void ;
122
+ dispose ( _dummy : { } ) : void ;
123
123
}
124
124
125
125
export interface LanguageServiceShim extends Shim {
126
126
languageService : LanguageService ;
127
127
128
- dispose ( _dummy : any ) : void ;
128
+ dispose ( _dummy : { } ) : void ;
129
129
130
130
refresh ( throwOnError : boolean ) : void ;
131
131
@@ -417,7 +417,7 @@ namespace ts {
417
417
return this . shimHost . getScriptVersion ( fileName ) ;
418
418
}
419
419
420
- public getLocalizedDiagnosticMessages ( ) : any {
420
+ public getLocalizedDiagnosticMessages ( ) {
421
421
const diagnosticMessagesJson = this . shimHost . getLocalizedDiagnosticMessages ( ) ;
422
422
if ( diagnosticMessagesJson === null || diagnosticMessagesJson === "" ) {
423
423
return null ;
@@ -515,7 +515,7 @@ namespace ts {
515
515
}
516
516
}
517
517
518
- function simpleForwardCall ( logger : Logger , actionDescription : string , action : ( ) => any , logPerformance : boolean ) : any {
518
+ function simpleForwardCall ( logger : Logger , actionDescription : string , action : ( ) => { } , logPerformance : boolean ) : { } {
519
519
let start : number ;
520
520
if ( logPerformance ) {
521
521
logger . log ( actionDescription ) ;
@@ -539,14 +539,14 @@ namespace ts {
539
539
return result ;
540
540
}
541
541
542
- function forwardJSONCall ( logger : Logger , actionDescription : string , action : ( ) => any , logPerformance : boolean ) : string {
542
+ function forwardJSONCall ( logger : Logger , actionDescription : string , action : ( ) => { } , logPerformance : boolean ) : string {
543
543
return < string > forwardCall ( logger , actionDescription , /*returnJson*/ true , action , logPerformance ) ;
544
544
}
545
545
546
546
function forwardCall < T > ( logger : Logger , actionDescription : string , returnJson : boolean , action : ( ) => T , logPerformance : boolean ) : T | string {
547
547
try {
548
548
const result = simpleForwardCall ( logger , actionDescription , action , logPerformance ) ;
549
- return returnJson ? JSON . stringify ( { result } ) : result ;
549
+ return returnJson ? JSON . stringify ( { result } ) : result as T ;
550
550
}
551
551
catch ( err ) {
552
552
if ( err instanceof OperationCanceledException ) {
@@ -563,7 +563,7 @@ namespace ts {
563
563
constructor ( private factory : ShimFactory ) {
564
564
factory . registerShim ( this ) ;
565
565
}
566
- public dispose ( _dummy : any ) : void {
566
+ public dispose ( _dummy : { } ) : void {
567
567
this . factory . unregisterShim ( this ) ;
568
568
}
569
569
}
@@ -601,7 +601,7 @@ namespace ts {
601
601
this . logger = this . host ;
602
602
}
603
603
604
- public forwardJSONCall ( actionDescription : string , action : ( ) => any ) : string {
604
+ public forwardJSONCall ( actionDescription : string , action : ( ) => { } ) : string {
605
605
return forwardJSONCall ( this . logger , actionDescription , action , this . logPerformance ) ;
606
606
}
607
607
@@ -611,7 +611,7 @@ namespace ts {
611
611
* Ensure (almost) deterministic release of internal Javascript resources when
612
612
* some external native objects holds onto us (e.g. Com/Interop).
613
613
*/
614
- public dispose ( dummy : any ) : void {
614
+ public dispose ( dummy : { } ) : void {
615
615
this . logger . log ( "dispose()" ) ;
616
616
this . languageService . dispose ( ) ;
617
617
this . languageService = null ;
@@ -635,7 +635,7 @@ namespace ts {
635
635
public refresh ( throwOnError : boolean ) : void {
636
636
this . forwardJSONCall (
637
637
`refresh(${ throwOnError } )` ,
638
- ( ) => < any > null
638
+ ( ) => null
639
639
) ;
640
640
}
641
641
@@ -644,7 +644,7 @@ namespace ts {
644
644
"cleanupSemanticCache()" ,
645
645
( ) => {
646
646
this . languageService . cleanupSemanticCache ( ) ;
647
- return < any > null ;
647
+ return null ;
648
648
} ) ;
649
649
}
650
650
@@ -980,13 +980,13 @@ namespace ts {
980
980
) ;
981
981
}
982
982
983
- public getEmitOutputObject ( fileName : string ) : any {
983
+ public getEmitOutputObject ( fileName : string ) : EmitOutput {
984
984
return forwardCall (
985
985
this . logger ,
986
986
`getEmitOutput('${ fileName } ')` ,
987
987
/*returnJson*/ false ,
988
988
( ) => this . languageService . getEmitOutput ( fileName ) ,
989
- this . logPerformance ) ;
989
+ this . logPerformance ) as EmitOutput ;
990
990
}
991
991
}
992
992
@@ -1030,7 +1030,7 @@ namespace ts {
1030
1030
super ( factory ) ;
1031
1031
}
1032
1032
1033
- private forwardJSONCall ( actionDescription : string , action : ( ) => any ) : any {
1033
+ private forwardJSONCall ( actionDescription : string , action : ( ) => { } ) : string {
1034
1034
return forwardJSONCall ( this . logger , actionDescription , action , this . logPerformance ) ;
1035
1035
}
1036
1036
@@ -1221,7 +1221,7 @@ namespace ts {
1221
1221
1222
1222
// Here we expose the TypeScript services as an external module
1223
1223
// so that it may be consumed easily like a node module.
1224
- declare const module : any ;
1224
+ declare const module : { exports : { } } ;
1225
1225
if ( typeof module !== "undefined" && module . exports ) {
1226
1226
module . exports = ts ;
1227
1227
}
0 commit comments