typings: fix TypedArray to a global type

PR-URL: https://github.com/nodejs/node/pull/54063
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1ilsang
2024-09-06 17:29:11 +09:00
committed by GitHub
parent 13d6950a6c
commit 94419bf64d

26
typings/globals.d.ts vendored
View File

@@ -19,19 +19,6 @@ import { WASIBinding } from './internalBinding/wasi';
import { WorkerBinding } from './internalBinding/worker';
import { ModulesBinding } from './internalBinding/modules';
declare type TypedArray =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| Float32Array
| Float64Array
| BigUint64Array
| BigInt64Array;
interface InternalBindingMap {
async_wrap: AsyncWrapBinding;
blob: BlobBinding;
@@ -60,6 +47,19 @@ type InternalBindingKeys = keyof InternalBindingMap;
declare function internalBinding<T extends InternalBindingKeys>(binding: T): InternalBindingMap[T]
declare global {
type TypedArray =
| Uint8Array
| Uint8ClampedArray
| Uint16Array
| Uint32Array
| Int8Array
| Int16Array
| Int32Array
| Float32Array
| Float64Array
| BigUint64Array
| BigInt64Array;
namespace NodeJS {
interface Global {
internalBinding<T extends InternalBindingKeys>(binding: T): InternalBindingMap[T]