@@ -1384,11 +1384,21 @@ export class Checker {
13841384 * declared type cannot be determined the checker yields the error type (use
13851385 * {@link Type.isErrorType} to detect it).
13861386 */
1387- async getDeclaredTypeOfSymbol ( symbol : Symbol ) : Promise < Type > {
1387+ async getDeclaredTypeOfSymbol ( symbol : Symbol ) : Promise < Type > ;
1388+ async getDeclaredTypeOfSymbol ( symbols : readonly Symbol [ ] ) : Promise < Type [ ] > ;
1389+ async getDeclaredTypeOfSymbol ( symbolOrSymbols : Symbol | readonly Symbol [ ] ) : Promise < Type | Type [ ] > {
1390+ if ( Array . isArray ( symbolOrSymbols ) ) {
1391+ const data = await this . client . apiRequest ( "getDeclaredTypesOfSymbols" , {
1392+ snapshot : this . snapshotId ,
1393+ project : this . project . id ,
1394+ symbols : symbolOrSymbols . map ( s => s . id ) ,
1395+ } ) ;
1396+ return data . map ( d => this . objectRegistry . getOrCreateType ( d ) ) ;
1397+ }
13881398 const data = await this . client . apiRequest ( "getDeclaredTypeOfSymbol" , {
13891399 snapshot : this . snapshotId ,
13901400 project : this . project . id ,
1391- symbol : symbol . id ,
1401+ symbol : ( symbolOrSymbols as Symbol ) . id ,
13921402 } ) ;
13931403 return this . objectRegistry . getOrCreateType ( data ) ;
13941404 }
@@ -1859,11 +1869,21 @@ export class Checker {
18591869 * an unresolved alias the checker yields the unknown symbol (use
18601870 * {@link Checker.isUnknownSymbol} to detect it).
18611871 */
1862- async getAliasedSymbol ( symbol : Symbol ) : Promise < Symbol > {
1872+ async getAliasedSymbol ( symbol : Symbol ) : Promise < Symbol > ;
1873+ async getAliasedSymbol ( symbols : readonly Symbol [ ] ) : Promise < Symbol [ ] > ;
1874+ async getAliasedSymbol ( symbolOrSymbols : Symbol | readonly Symbol [ ] ) : Promise < Symbol | Symbol [ ] > {
1875+ if ( Array . isArray ( symbolOrSymbols ) ) {
1876+ const data = await this . client . apiRequest ( "getAliasedSymbols" , {
1877+ snapshot : this . snapshotId ,
1878+ project : this . project . id ,
1879+ symbols : symbolOrSymbols . map ( s => s . id ) ,
1880+ } ) ;
1881+ return data . map ( d => this . objectRegistry . getOrCreateSymbol ( d ) ) ;
1882+ }
18631883 const data = await this . client . apiRequest ( "getAliasedSymbol" , {
18641884 snapshot : this . snapshotId ,
18651885 project : this . project . id ,
1866- symbol : symbol . id ,
1886+ symbol : ( symbolOrSymbols as Symbol ) . id ,
18671887 } ) ;
18681888 return this . objectRegistry . getOrCreateSymbol ( data ) ;
18691889 }
@@ -1880,11 +1900,21 @@ export class Checker {
18801900 } ) ;
18811901 }
18821902
1883- async getImmediateAliasedSymbol ( symbol : Symbol ) : Promise < Symbol | undefined > {
1903+ async getImmediateAliasedSymbol ( symbol : Symbol ) : Promise < Symbol | undefined > ;
1904+ async getImmediateAliasedSymbol ( symbols : readonly Symbol [ ] ) : Promise < ( Symbol | undefined ) [ ] > ;
1905+ async getImmediateAliasedSymbol ( symbolOrSymbols : Symbol | readonly Symbol [ ] ) : Promise < Symbol | ( Symbol | undefined ) [ ] | undefined > {
1906+ if ( Array . isArray ( symbolOrSymbols ) ) {
1907+ const data = await this . client . apiRequest ( "getImmediateAliasedSymbols" , {
1908+ snapshot : this . snapshotId ,
1909+ project : this . project . id ,
1910+ symbols : symbolOrSymbols . map ( s => s . id ) ,
1911+ } ) ;
1912+ return data ? data . map ( d => d ? this . objectRegistry . getOrCreateSymbol ( d ) : undefined ) : symbolOrSymbols . map ( ( ) => undefined ) ;
1913+ }
18841914 const data = await this . client . apiRequest ( "getImmediateAliasedSymbol" , {
18851915 snapshot : this . snapshotId ,
18861916 project : this . project . id ,
1887- symbol : symbol . id ,
1917+ symbol : ( symbolOrSymbols as Symbol ) . id ,
18881918 } ) ;
18891919 return data ? this . objectRegistry . getOrCreateSymbol ( data ) : undefined ;
18901920 }
@@ -1945,21 +1975,44 @@ export class Checker {
19451975 return signature . id === ( await this . getWellKnownSignatures ( ) ) . unknown ;
19461976 }
19471977
1948- async getExportsOfModule ( symbol : Symbol ) : Promise < readonly Symbol [ ] > {
1978+ async getExportsOfModule ( symbol : Symbol ) : Promise < readonly Symbol [ ] > ;
1979+ async getExportsOfModule ( symbols : readonly Symbol [ ] ) : Promise < readonly ( readonly Symbol [ ] ) [ ] > ;
1980+ async getExportsOfModule ( symbolOrSymbols : Symbol | readonly Symbol [ ] ) : Promise < readonly Symbol [ ] | readonly ( readonly Symbol [ ] ) [ ] > {
1981+ if ( Array . isArray ( symbolOrSymbols ) ) {
1982+ const data = await this . client . apiRequest ( "getExportsOfModules" , {
1983+ snapshot : this . snapshotId ,
1984+ project : this . project . id ,
1985+ symbols : symbolOrSymbols . map ( s => s . id ) ,
1986+ } ) ;
1987+ return data . map ( d => d ? d . map ( s => this . objectRegistry . getOrCreateSymbol ( s ) ) : [ ] ) ;
1988+ }
19491989 const data = await this . client . apiRequest ( "getExportsOfModule" , {
19501990 snapshot : this . snapshotId ,
19511991 project : this . project . id ,
1952- symbol : symbol . id ,
1992+ symbol : ( symbolOrSymbols as Symbol ) . id ,
19531993 } ) ;
19541994 return data ? data . map ( d => this . objectRegistry . getOrCreateSymbol ( d ) ) : [ ] ;
19551995 }
19561996
1957- async getMemberInModuleExports ( symbol : Symbol , name : string ) : Promise < Symbol | undefined > {
1997+ async getMemberInModuleExports ( symbol : Symbol , name : string ) : Promise < Symbol | undefined > ;
1998+ async getMemberInModuleExports ( requests : readonly { symbol : Symbol ; name : string ; } [ ] ) : Promise < ( Symbol | undefined ) [ ] > ;
1999+ async getMemberInModuleExports (
2000+ symbolOrRequests : Symbol | readonly { symbol : Symbol ; name : string ; } [ ] ,
2001+ name ?: string ,
2002+ ) : Promise < Symbol | ( Symbol | undefined ) [ ] | undefined > {
2003+ if ( Array . isArray ( symbolOrRequests ) ) {
2004+ const data = await this . client . apiRequest ( "getMembersInModuleExports" , {
2005+ snapshot : this . snapshotId ,
2006+ project : this . project . id ,
2007+ requests : symbolOrRequests . map ( r => ( { symbol : r . symbol . id , name : r . name } ) ) ,
2008+ } ) ;
2009+ return data . map ( d => d ? this . objectRegistry . getOrCreateSymbol ( d ) : undefined ) ;
2010+ }
19582011 const data = await this . client . apiRequest ( "getMemberInModuleExports" , {
19592012 snapshot : this . snapshotId ,
19602013 project : this . project . id ,
1961- symbol : symbol . id ,
1962- name,
2014+ symbol : ( symbolOrRequests as Symbol ) . id ,
2015+ name : name ! ,
19632016 } ) ;
19642017 return data ? this . objectRegistry . getOrCreateSymbol ( data ) : undefined ;
19652018 }
0 commit comments