Skip to content

Commit

Permalink
typings: fix ImportModuleDynamicallyCallback return type
Browse files Browse the repository at this point in the history
PR-URL: #57160
Refs: https://github.com/nodejs/node/pull/56919/files#r1955336054
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
legendecas authored Feb 21, 2025
1 parent 9e6a62f commit 90ab559
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class ModuleLoader {
* @param {string} source Source code. TODO(joyeecheung): pass the raw buffer.
* @param {string} isMain Whether this module is a main module.
* @param {CJSModule|undefined} parent Parent module, if any.
* @returns {{wrap: ModuleWrap, namespace: ModuleNamespaceObject}}
* @returns {{wrap: ModuleWrap, namespace: import('internal/modules/esm/utils').ModuleNamespaceObject}}
*/
importSyncForRequire(mod, filename, source, isMain, parent) {
const url = pathToFileURL(filename).href;
Expand Down
8 changes: 7 additions & 1 deletion lib/internal/modules/esm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,18 @@ function getConditionsSet(conditions) {
return getDefaultConditionsSet();
}

/**
* @typedef {{
* [Symbol.toStringTag]: 'Module',
* }} ModuleNamespaceObject
*/

/**
* @callback ImportModuleDynamicallyCallback
* @param {string} specifier
* @param {ModuleWrap|ContextifyScript|Function|vm.Module} callbackReferrer
* @param {Record<string, string>} attributes
* @returns { Promise<void> }
* @returns {Promise<ModuleNamespaceObject>}
*/

/**
Expand Down

0 comments on commit 90ab559

Please sign in to comment.