@@ -29,6 +29,7 @@ import {
29
29
Options ,
30
30
ValueFactory ,
31
31
ModuleExport ,
32
+ Module ,
32
33
LoadingType ,
33
34
} from './types'
34
35
@@ -99,7 +100,7 @@ export function hash(...valueList : string[]) : string {
99
100
* preventCache usage: non-fatal error
100
101
* @internal
101
102
*/
102
- export async function withCache ( cacheInstance : Cache , key : string [ ] , valueFactory : ValueFactory ) {
103
+ export async function withCache ( cacheInstance : Cache , key : string [ ] , valueFactory : ValueFactory ) : Promise < any > {
103
104
104
105
let cachePrevented = false ;
105
106
@@ -198,7 +199,7 @@ export function parseDeps(fileAst : t.File) : string[] {
198
199
/**
199
200
* @internal
200
201
*/
201
- export async function transformJSCode ( source : string , moduleSourceType : boolean , filename : string , options : Options ) {
202
+ export async function transformJSCode ( source : string , moduleSourceType : boolean , filename : string , options : Options ) : Promise < [ string [ ] , string ] > {
202
203
203
204
const { additionalBabelPlugins = [ ] , log } = options ;
204
205
@@ -286,7 +287,7 @@ export async function loadModuleInternal(currentPath : string, modulePath : stri
286
287
* Create a cjs module
287
288
* @internal
288
289
*/
289
- export function createModule ( filename : string , source : string , options : Options ) {
290
+ export function createModule ( filename : string , source : string , options : Options ) : Module {
290
291
291
292
const { moduleCache, pathHandlers : { resolve } , getResource } = options ;
292
293
@@ -319,7 +320,7 @@ export function createModule(filename : string, source : string, options : Optio
319
320
/**
320
321
* @internal
321
322
*/
322
- export async function createJSModule ( source : string , moduleSourceType : boolean , filename : string , options : Options ) {
323
+ export async function createJSModule ( source : string , moduleSourceType : boolean , filename : string , options : Options ) : Promise < ModuleExport > {
323
324
324
325
const { compiledCache } = options ;
325
326
@@ -337,7 +338,7 @@ export async function createJSModule(source : string, moduleSourceType : boolean
337
338
* Just load and cache given dependencies.
338
339
* @internal
339
340
*/
340
- export async function loadDeps ( filename : string , deps : string [ ] , options : Options ) {
341
+ export async function loadDeps ( filename : string , deps : string [ ] , options : Options ) : Promise < void > {
341
342
342
343
await Promise . all ( deps . map ( dep => loadModuleInternal ( filename , dep , options ) ) )
343
344
}
0 commit comments