diff --git a/lib/internal/bootstrap/realm.js b/lib/internal/bootstrap/realm.js index 4e0167bb18ae49..641f6ca9cd2357 100644 --- a/lib/internal/bootstrap/realm.js +++ b/lib/internal/bootstrap/realm.js @@ -170,13 +170,9 @@ const experimentalModuleList = new SafeSet(); }; } -/** - * @typedef {import('../../../typings/bindings').InternalBindingMap} InternalBindingMap - */ // Set up internalBinding() in the closure. -// Do not use `internalBinding` variable name due to the breakage of TypeScript autocompletion. /** - * @type {(binding: T) => InternalBindingMap[T]} + * @type {import('../../../typings/bindings').InternalBinding} */ let internalBinding; { diff --git a/typings/bindings.d.ts b/typings/bindings.d.ts index d1ad6d29201039..1ed65174c85f22 100644 --- a/typings/bindings.d.ts +++ b/typings/bindings.d.ts @@ -33,3 +33,5 @@ export type InternalBindingMap = { util: UtilBindings; worker: WorkerBinding; } + +export type InternalBinding = (binding: T) => InternalBindingMap[T];