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 4, 2023
1 parent 0c881a8 commit 8e65c90
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 @@ -165,13 +165,9 @@ const schemelessBlockList = 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 @@ -31,3 +31,5 @@ export type InternalBindingMap = {
util: UtilBindings;
worker: WorkerBinding;
}

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

0 comments on commit 8e65c90

Please sign in to comment.