Skip to content

Commit

Permalink
lib: support clion for autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Apr 6, 2023
1 parent f1eda00 commit 3532f6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/internal/bootstrap/realm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {<T extends keyof InternalBindingMap>(binding: T) => InternalBindingMap[T]}
* @type {import('../../../typings/bindings').InternalBinding}
*/
let internalBinding;
{
Expand Down
2 changes: 2 additions & 0 deletions typings/bindings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ export type InternalBindingMap = {
util: UtilBindings;
worker: WorkerBinding;
}

export type InternalBinding<T extends keyof InternalBindingMap> = (binding: T) => InternalBindingMap[T];

0 comments on commit 3532f6d

Please sign in to comment.