diff options
author | Mestery <mestery@pm.me> | 2021-10-11 19:08:34 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2021-10-20 15:08:28 +0300 |
commit | a3970092693785f73161a80e81411fd043535eaa (patch) | |
tree | 5becf5cec6c27242ed15580277b0f96af9c05b6f /typings | |
parent | e1d598c8f2f046e0072cda974a471abcba103297 (diff) |
typings: separate `internalBinding` typings
PR-URL: https://github.com/nodejs/node/pull/40409
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Diffstat (limited to 'typings')
-rw-r--r-- | typings/globals.d.ts | 1 | ||||
-rw-r--r-- | typings/internalBinding/config.d.ts | 12 | ||||
-rw-r--r-- | typings/internalBinding/constants.d.ts (renamed from typings/internalBinding.d.ts) | 42 | ||||
-rw-r--r-- | typings/internalBinding/symbols.d.ts | 3 | ||||
-rw-r--r-- | typings/internalBinding/types.d.ts | 26 |
5 files changed, 42 insertions, 42 deletions
diff --git a/typings/globals.d.ts b/typings/globals.d.ts new file mode 100644 index 00000000000..5d849b28b66 --- /dev/null +++ b/typings/globals.d.ts @@ -0,0 +1 @@ +declare type TypedArray = Uint16Array | Uint32Array | Uint8Array | Uint8ClampedArray | Int16Array | Int32Array | Int8Array | BigInt64Array | Float32Array | Float64Array | BigUint64Array; diff --git a/typings/internalBinding/config.d.ts b/typings/internalBinding/config.d.ts new file mode 100644 index 00000000000..3fccf4007f1 --- /dev/null +++ b/typings/internalBinding/config.d.ts @@ -0,0 +1,12 @@ +declare function InternalBinding(binding: 'config'): { + isDebugBuild: boolean, + hasOpenSSL: boolean, + fipsMode: boolean, + hasIntl: boolean, + hasTracing: boolean, + hasNodeOptions: boolean, + hasInspector: boolean, + noBrowserGlobals: boolean, + bits: number, + hasDtrace: boolean +} diff --git a/typings/internalBinding.d.ts b/typings/internalBinding/constants.d.ts index ffb6423e3e5..802a0c019f6 100644 --- a/typings/internalBinding.d.ts +++ b/typings/internalBinding/constants.d.ts @@ -1,30 +1,3 @@ -declare type TypedArray = Uint16Array | Uint32Array | Uint8Array | Uint8ClampedArray | Int16Array | Int32Array | Int8Array | BigInt64Array | Float32Array | Float64Array | BigUint64Array; -declare function InternalBinding(binding: 'types'): { - isAsyncFunction(value: unknown): value is (...args: unknown[]) => Promise<unknown>, - isGeneratorFunction(value: unknown): value is GeneratorFunction, - isAnyArrayBuffer(value: unknown): value is (ArrayBuffer | SharedArrayBuffer), - isArrayBuffer(value: unknown): value is ArrayBuffer, - isArgumentsObject(value: unknown): value is ArrayLike<unknown>, - isBoxedPrimitive(value: unknown): value is (BigInt | Boolean | Number | String | Symbol), - isDataView(value: unknown): value is DataView, - isExternal(value: unknown): value is Object, - isMap(value: unknown): value is Map<unknown, unknown>, - isMapIterator: (value: unknown) => value is IterableIterator<unknown>, - isModuleNamespaceObject: (value: unknown) => value is {[Symbol.toStringTag]: 'Module', [key: string]: any}, - isNativeError: (value: unknown) => Error, - isPromise: (value: unknown) => value is Promise<unknown>, - isSet: (value: unknown) => value is Set<unknown>, - isSetIterator: (value: unknown) => value is IterableIterator<unknown>, - isWeakMap: (value: unknown) => value is WeakMap<object, unknown>, - isWeakSet: (value: unknown) => value is WeakSet<object>, - isRegExp: (value: unknown) => RegExp, - isDate: (value: unknown) => Date, - isTypedArray: (value: unknown) => value is TypedArray, - isStringObject: (value: unknown) => value is String, - isNumberObject: (value: unknown) => value is Number, - isBooleanObject: (value: unknown) => value is Boolean, - isBigIntObject: (value: unknown) => value is BigInt, -}; declare function InternalBinding(binding: 'constants'): { os: { UV_UDP_REUSEADDR: 4, @@ -427,18 +400,3 @@ declare function InternalBinding(binding: 'constants'): { TRACE_EVENT_PHASE_LINK_IDS: 61 } }; -declare function InternalBinding(binding: 'config'): { - isDebugBuild: boolean, - hasOpenSSL: boolean, - fipsMode: boolean, - hasIntl: boolean, - hasTracing: boolean, - hasNodeOptions: boolean, - hasInspector: boolean, - noBrowserGlobals: boolean, - bits: number, - hasDtrace: boolean -} -declare function InternalBinding(binding: 'symbols'): { - [name: string]: symbol; -} diff --git a/typings/internalBinding/symbols.d.ts b/typings/internalBinding/symbols.d.ts new file mode 100644 index 00000000000..af49504f84b --- /dev/null +++ b/typings/internalBinding/symbols.d.ts @@ -0,0 +1,3 @@ +declare function InternalBinding(binding: 'symbols'): { + [name: string]: symbol; +} diff --git a/typings/internalBinding/types.d.ts b/typings/internalBinding/types.d.ts new file mode 100644 index 00000000000..6d01da4b535 --- /dev/null +++ b/typings/internalBinding/types.d.ts @@ -0,0 +1,26 @@ +declare function InternalBinding(binding: 'types'): { + isAsyncFunction(value: unknown): value is (...args: unknown[]) => Promise<unknown>, + isGeneratorFunction(value: unknown): value is GeneratorFunction, + isAnyArrayBuffer(value: unknown): value is (ArrayBuffer | SharedArrayBuffer), + isArrayBuffer(value: unknown): value is ArrayBuffer, + isArgumentsObject(value: unknown): value is ArrayLike<unknown>, + isBoxedPrimitive(value: unknown): value is (BigInt | Boolean | Number | String | Symbol), + isDataView(value: unknown): value is DataView, + isExternal(value: unknown): value is Object, + isMap(value: unknown): value is Map<unknown, unknown>, + isMapIterator: (value: unknown) => value is IterableIterator<unknown>, + isModuleNamespaceObject: (value: unknown) => value is {[Symbol.toStringTag]: 'Module', [key: string]: any}, + isNativeError: (value: unknown) => Error, + isPromise: (value: unknown) => value is Promise<unknown>, + isSet: (value: unknown) => value is Set<unknown>, + isSetIterator: (value: unknown) => value is IterableIterator<unknown>, + isWeakMap: (value: unknown) => value is WeakMap<object, unknown>, + isWeakSet: (value: unknown) => value is WeakSet<object>, + isRegExp: (value: unknown) => RegExp, + isDate: (value: unknown) => Date, + isTypedArray: (value: unknown) => value is TypedArray, + isStringObject: (value: unknown) => value is String, + isNumberObject: (value: unknown) => value is Number, + isBooleanObject: (value: unknown) => value is Boolean, + isBigIntObject: (value: unknown) => value is BigInt, +}; |