Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typings: separate internalBinding typings #40409

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"include": ["lib","doc"],
"exclude": ["src","tools","out"],
"files": [
"./typings/internalBinding/config.d.ts",
"./typings/internalBinding/constants.d.ts",
"./typings/internalBinding/fs.d.ts",
"./typings/internalBinding/http_parser.d.ts",
"./typings/internalBinding/messaging.d.ts",
"./typings/internalBinding/options.d.ts",
"./typings/internalBinding/os.d.ts",
"./typings/internalBinding/serdes.d.ts",
"./typings/internalBinding/symbols.d.ts",
"./typings/internalBinding/timers.d.ts",
"./typings/internalBinding/types.d.ts",
"./typings/internalBinding/util.d.ts",
"./typings/internalBinding/worker.d.ts",
"./typings/internalBinding.d.ts",
"./typings/globals.d.ts",
"./typings/primordials.d.ts"
],
"compilerOptions": {
Expand Down
1 change: 1 addition & 0 deletions typings/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare type TypedArray = Uint16Array | Uint32Array | Uint8Array | Uint8ClampedArray | Int16Array | Int32Array | Int8Array | BigInt64Array | Float32Array | Float64Array | BigUint64Array;
12 changes: 12 additions & 0 deletions typings/internalBinding/config.d.ts
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions typings/internalBinding/symbols.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare function InternalBinding(binding: 'symbols'): {
[name: string]: symbol;
}
26 changes: 26 additions & 0 deletions typings/internalBinding/types.d.ts
Original file line number Diff line number Diff line change
@@ -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,
};