diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index f628b791db..07bacdedbf 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -161,6 +161,7 @@ const schemelessBlockList = new SafeSet([ } // Set up internalBinding() in the closure. +/** @type {InternalBinding} */ let internalBinding; { const bindingObj = { __proto__: null }; diff --git a/typings/internalBinding/async_wrap.d.ts b/typings/internalBinding/async_wrap.d.ts index fb3279be1d..55d0e2dcf8 100644 --- a/typings/internalBinding/async_wrap.d.ts +++ b/typings/internalBinding/async_wrap.d.ts @@ -72,61 +72,63 @@ declare namespace InternalAsyncWrapBinding { } } -declare function internalBinding(binding: 'async_wrap'): { - setupHooks(): { - init: ( - asyncId: number, - type: keyof InternalAsyncWrapBinding.Providers, - triggerAsyncId: number, - resource: InternalAsyncWrapBinding.Resource, - ) => void; - before: InternalAsyncWrapBinding.EmitHook; - after: InternalAsyncWrapBinding.EmitHook; - destroy: InternalAsyncWrapBinding.EmitHook; - promise_resolve: InternalAsyncWrapBinding.EmitHook; - }; - setCallbackTrampoline( - callback: ( - asyncId: number, - resource: InternalAsyncWrapBinding.Resource, - cb: ( - cb: (...args: any[]) => boolean | undefined, +declare interface InternalBinding { + (binding: 'async_wrap'): { + setupHooks(): { + init: ( + asyncId: number, + type: keyof InternalAsyncWrapBinding.Providers, + triggerAsyncId: number, + resource: InternalAsyncWrapBinding.Resource, + ) => void; + before: InternalAsyncWrapBinding.EmitHook; + after: InternalAsyncWrapBinding.EmitHook; + destroy: InternalAsyncWrapBinding.EmitHook; + promise_resolve: InternalAsyncWrapBinding.EmitHook; + }; + setCallbackTrampoline( + callback: ( + asyncId: number, + resource: InternalAsyncWrapBinding.Resource, + cb: ( + cb: (...args: any[]) => boolean | undefined, + ...args: any[] + ) => boolean | undefined, ...args: any[] - ) => boolean | undefined, - ...args: any[] - ) => boolean | undefined - ): void; - pushAsyncContext(asyncId: number, triggerAsyncId: number): void; - popAsyncContext(asyncId: number): boolean; - executionAsyncResource(index: number): InternalAsyncWrapBinding.PublicResource | null; - clearAsyncIdStack(): void; - queueDestroyAsyncId(asyncId: number): void; - setPromiseHooks( - initHook: ((promise: Promise, parent?: Promise) => void) | undefined, - promiseBeforeHook: InternalAsyncWrapBinding.PromiseHook | undefined, - promiseAfterHook: InternalAsyncWrapBinding.PromiseHook | undefined, - promiseResolveHook: InternalAsyncWrapBinding.PromiseHook | undefined - ): void; - registerDestroyHook(resource: object, asyncId: number, destroyed?: { destroyed: boolean }): void; - async_hook_fields: Uint32Array; - async_id_fields: Float64Array; - async_ids_stack: Float64Array; - execution_async_resources: InternalAsyncWrapBinding.Resource[]; - constants: { - kInit: 0; - kBefore: 1; - kAfter: 2; - kDestroy: 3; - kPromiseResolve: 4; - kTotals: 5; - kCheck: 6; - kStackLength: 7; - kUsesExecutionAsyncResource: 8; - - kExecutionAsyncId: 0; - kTriggerAsyncId: 1; - kAsyncIdCounter: 2; - kDefaultTriggerAsyncId: 3; - }; - Providers: InternalAsyncWrapBinding.Providers; -}; + ) => boolean | undefined + ): void; + pushAsyncContext(asyncId: number, triggerAsyncId: number): void; + popAsyncContext(asyncId: number): boolean; + executionAsyncResource(index: number): InternalAsyncWrapBinding.PublicResource | null; + clearAsyncIdStack(): void; + queueDestroyAsyncId(asyncId: number): void; + setPromiseHooks( + initHook: ((promise: Promise, parent?: Promise) => void) | undefined, + promiseBeforeHook: InternalAsyncWrapBinding.PromiseHook | undefined, + promiseAfterHook: InternalAsyncWrapBinding.PromiseHook | undefined, + promiseResolveHook: InternalAsyncWrapBinding.PromiseHook | undefined + ): void; + registerDestroyHook(resource: object, asyncId: number, destroyed?: { destroyed: boolean }): void; + async_hook_fields: Uint32Array; + async_id_fields: Float64Array; + async_ids_stack: Float64Array; + execution_async_resources: InternalAsyncWrapBinding.Resource[]; + constants: { + kInit: 0; + kBefore: 1; + kAfter: 2; + kDestroy: 3; + kPromiseResolve: 4; + kTotals: 5; + kCheck: 6; + kStackLength: 7; + kUsesExecutionAsyncResource: 8; + + kExecutionAsyncId: 0; + kTriggerAsyncId: 1; + kAsyncIdCounter: 2; + kDefaultTriggerAsyncId: 3; + }; + Providers: InternalAsyncWrapBinding.Providers; + } +} diff --git a/typings/internalBinding/blob.d.ts b/typings/internalBinding/blob.d.ts index 5cf5a55f61..e6d211e32f 100644 --- a/typings/internalBinding/blob.d.ts +++ b/typings/internalBinding/blob.d.ts @@ -10,10 +10,12 @@ declare namespace InternalBlobBinding { } } -declare function internalBinding(binding: 'blob'): { - createBlob(sources: Array, length: number): InternalBlobBinding.BlobHandle; - FixedSizeBlobCopyJob: typeof InternalBlobBinding.FixedSizeBlobCopyJob; - getDataObject(id: string): [handle: InternalBlobBinding.BlobHandle | undefined, length: number, type: string] | undefined; - storeDataObject(id: string, handle: InternalBlobBinding.BlobHandle, size: number, type: string): void; - revokeDataObject(id: string): void; -}; +declare interface InternalBinding { + (binding: 'blob'): { + createBlob(sources: Array, length: number): InternalBlobBinding.BlobHandle; + FixedSizeBlobCopyJob: typeof InternalBlobBinding.FixedSizeBlobCopyJob; + getDataObject(id: string): [handle: InternalBlobBinding.BlobHandle | undefined, length: number, type: string] | undefined; + storeDataObject(id: string, handle: InternalBlobBinding.BlobHandle, size: number, type: string): void; + revokeDataObject(id: string): void; + } +} diff --git a/typings/internalBinding/config.d.ts b/typings/internalBinding/config.d.ts index 718c0df3c9..ed41d9a253 100644 --- a/typings/internalBinding/config.d.ts +++ b/typings/internalBinding/config.d.ts @@ -1,12 +1,14 @@ -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 interface 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/constants.d.ts b/typings/internalBinding/constants.d.ts index 453a978375..cd066342cf 100644 --- a/typings/internalBinding/constants.d.ts +++ b/typings/internalBinding/constants.d.ts @@ -1,385 +1,387 @@ -declare function internalBinding(binding: 'constants'): { - os: { - UV_UDP_REUSEADDR: 4; - dlopen: { - RTLD_LAZY: 1; - RTLD_NOW: 2; - RTLD_GLOBAL: 8; - RTLD_LOCAL: 4; +declare interface InternalBinding { + (binding: 'constants'): { + os: { + UV_UDP_REUSEADDR: 4; + dlopen: { + RTLD_LAZY: 1; + RTLD_NOW: 2; + RTLD_GLOBAL: 8; + RTLD_LOCAL: 4; + }; + errno: { + E2BIG: 7; + EACCES: 13; + EADDRINUSE: 48; + EADDRNOTAVAIL: 49; + EAFNOSUPPORT: 47; + EAGAIN: 35; + EALREADY: 37; + EBADF: 9; + EBADMSG: 94; + EBUSY: 16; + ECANCELED: 89; + ECHILD: 10; + ECONNABORTED: 53; + ECONNREFUSED: 61; + ECONNRESET: 54; + EDEADLK: 11; + EDESTADDRREQ: 39; + EDOM: 33; + EDQUOT: 69; + EEXIST: 17; + EFAULT: 14; + EFBIG: 27; + EHOSTUNREACH: 65; + EIDRM: 90; + EILSEQ: 92; + EINPROGRESS: 36; + EINTR: 4; + EINVAL: 22; + EIO: 5; + EISCONN: 56; + EISDIR: 21; + ELOOP: 62; + EMFILE: 24; + EMLINK: 31; + EMSGSIZE: 40; + EMULTIHOP: 95; + ENAMETOOLONG: 63; + ENETDOWN: 50; + ENETRESET: 52; + ENETUNREACH: 51; + ENFILE: 23; + ENOBUFS: 55; + ENODATA: 96; + ENODEV: 19; + ENOENT: 2; + ENOEXEC: 8; + ENOLCK: 77; + ENOLINK: 97; + ENOMEM: 12; + ENOMSG: 91; + ENOPROTOOPT: 42; + ENOSPC: 28; + ENOSR: 98; + ENOSTR: 99; + ENOSYS: 78; + ENOTCONN: 57; + ENOTDIR: 20; + ENOTEMPTY: 66; + ENOTSOCK: 38; + ENOTSUP: 45; + ENOTTY: 25; + ENXIO: 6; + EOPNOTSUPP: 102; + EOVERFLOW: 84; + EPERM: 1; + EPIPE: 32; + EPROTO: 100; + EPROTONOSUPPORT: 43; + EPROTOTYPE: 41; + ERANGE: 34; + EROFS: 30; + ESPIPE: 29; + ESRCH: 3; + ESTALE: 70; + ETIME: 101; + ETIMEDOUT: 60; + ETXTBSY: 26; + EWOULDBLOCK: 35; + EXDEV: 18; + }; + signals: { + SIGHUP: 1; + SIGINT: 2; + SIGQUIT: 3; + SIGILL: 4; + SIGTRAP: 5; + SIGABRT: 6; + SIGIOT: 6; + SIGBUS: 10; + SIGFPE: 8; + SIGKILL: 9; + SIGUSR1: 30; + SIGSEGV: 11; + SIGUSR2: 31; + SIGPIPE: 13; + SIGALRM: 14; + SIGTERM: 15; + SIGCHLD: 20; + SIGCONT: 19; + SIGSTOP: 17; + SIGTSTP: 18; + SIGTTIN: 21; + SIGTTOU: 22; + SIGURG: 16; + SIGXCPU: 24; + SIGXFSZ: 25; + SIGVTALRM: 26; + SIGPROF: 27; + SIGWINCH: 28; + SIGIO: 23; + SIGINFO: 29; + SIGSYS: 12; + }; + priority: { + PRIORITY_LOW: 19; + PRIORITY_BELOW_NORMAL: 10; + PRIORITY_NORMAL: 0; + PRIORITY_ABOVE_NORMAL: -7; + PRIORITY_HIGH: -14; + PRIORITY_HIGHEST: -20; + }; }; - errno: { - E2BIG: 7; - EACCES: 13; - EADDRINUSE: 48; - EADDRNOTAVAIL: 49; - EAFNOSUPPORT: 47; - EAGAIN: 35; - EALREADY: 37; - EBADF: 9; - EBADMSG: 94; - EBUSY: 16; - ECANCELED: 89; - ECHILD: 10; - ECONNABORTED: 53; - ECONNREFUSED: 61; - ECONNRESET: 54; - EDEADLK: 11; - EDESTADDRREQ: 39; - EDOM: 33; - EDQUOT: 69; - EEXIST: 17; - EFAULT: 14; - EFBIG: 27; - EHOSTUNREACH: 65; - EIDRM: 90; - EILSEQ: 92; - EINPROGRESS: 36; - EINTR: 4; - EINVAL: 22; - EIO: 5; - EISCONN: 56; - EISDIR: 21; - ELOOP: 62; - EMFILE: 24; - EMLINK: 31; - EMSGSIZE: 40; - EMULTIHOP: 95; - ENAMETOOLONG: 63; - ENETDOWN: 50; - ENETRESET: 52; - ENETUNREACH: 51; - ENFILE: 23; - ENOBUFS: 55; - ENODATA: 96; - ENODEV: 19; - ENOENT: 2; - ENOEXEC: 8; - ENOLCK: 77; - ENOLINK: 97; - ENOMEM: 12; - ENOMSG: 91; - ENOPROTOOPT: 42; - ENOSPC: 28; - ENOSR: 98; - ENOSTR: 99; - ENOSYS: 78; - ENOTCONN: 57; - ENOTDIR: 20; - ENOTEMPTY: 66; - ENOTSOCK: 38; - ENOTSUP: 45; - ENOTTY: 25; - ENXIO: 6; - EOPNOTSUPP: 102; - EOVERFLOW: 84; - EPERM: 1; - EPIPE: 32; - EPROTO: 100; - EPROTONOSUPPORT: 43; - EPROTOTYPE: 41; - ERANGE: 34; - EROFS: 30; - ESPIPE: 29; - ESRCH: 3; - ESTALE: 70; - ETIME: 101; - ETIMEDOUT: 60; - ETXTBSY: 26; - EWOULDBLOCK: 35; - EXDEV: 18; + fs: { + UV_FS_SYMLINK_DIR: 1; + UV_FS_SYMLINK_JUNCTION: 2; + O_RDONLY: 0; + O_WRONLY: 1; + O_RDWR: 2; + UV_DIRENT_UNKNOWN: 0; + UV_DIRENT_FILE: 1; + UV_DIRENT_DIR: 2; + UV_DIRENT_LINK: 3; + UV_DIRENT_FIFO: 4; + UV_DIRENT_SOCKET: 5; + UV_DIRENT_CHAR: 6; + UV_DIRENT_BLOCK: 7; + S_IFMT: 61440; + S_IFREG: 32768; + S_IFDIR: 16384; + S_IFCHR: 8192; + S_IFBLK: 24576; + S_IFIFO: 4096; + S_IFLNK: 40960; + S_IFSOCK: 49152; + O_CREAT: 512; + O_EXCL: 2048; + UV_FS_O_FILEMAP: 0; + O_NOCTTY: 131072; + O_TRUNC: 1024; + O_APPEND: 8; + O_DIRECTORY: 1048576; + O_NOFOLLOW: 256; + O_SYNC: 128; + O_DSYNC: 4194304; + O_SYMLINK: 2097152; + O_NONBLOCK: 4; + S_IRWXU: 448; + S_IRUSR: 256; + S_IWUSR: 128; + S_IXUSR: 64; + S_IRWXG: 56; + S_IRGRP: 32; + S_IWGRP: 16; + S_IXGRP: 8; + S_IRWXO: 7; + S_IROTH: 4; + S_IWOTH: 2; + S_IXOTH: 1; + F_OK: 0; + R_OK: 4; + W_OK: 2; + X_OK: 1; + UV_FS_COPYFILE_EXCL: 1; + COPYFILE_EXCL: 1; + UV_FS_COPYFILE_FICLONE: 2; + COPYFILE_FICLONE: 2; + UV_FS_COPYFILE_FICLONE_FORCE: 4; + COPYFILE_FICLONE_FORCE: 4; }; - signals: { - SIGHUP: 1; - SIGINT: 2; - SIGQUIT: 3; - SIGILL: 4; - SIGTRAP: 5; - SIGABRT: 6; - SIGIOT: 6; - SIGBUS: 10; - SIGFPE: 8; - SIGKILL: 9; - SIGUSR1: 30; - SIGSEGV: 11; - SIGUSR2: 31; - SIGPIPE: 13; - SIGALRM: 14; - SIGTERM: 15; - SIGCHLD: 20; - SIGCONT: 19; - SIGSTOP: 17; - SIGTSTP: 18; - SIGTTIN: 21; - SIGTTOU: 22; - SIGURG: 16; - SIGXCPU: 24; - SIGXFSZ: 25; - SIGVTALRM: 26; - SIGPROF: 27; - SIGWINCH: 28; - SIGIO: 23; - SIGINFO: 29; - SIGSYS: 12; + crypto: { + OPENSSL_VERSION_NUMBER: 269488319; + SSL_OP_ALL: 2147485780; + SSL_OP_ALLOW_NO_DHE_KEX: 1024; + SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: 262144; + SSL_OP_CIPHER_SERVER_PREFERENCE: 4194304; + SSL_OP_CISCO_ANYCONNECT: 32768; + SSL_OP_COOKIE_EXCHANGE: 8192; + SSL_OP_CRYPTOPRO_TLSEXT_BUG: 2147483648; + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: 2048; + SSL_OP_LEGACY_SERVER_CONNECT: 4; + SSL_OP_NO_COMPRESSION: 131072; + SSL_OP_NO_ENCRYPT_THEN_MAC: 524288; + SSL_OP_NO_QUERY_MTU: 4096; + SSL_OP_NO_RENEGOTIATION: 1073741824; + SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: 65536; + SSL_OP_NO_SSLv2: 0; + SSL_OP_NO_SSLv3: 33554432; + SSL_OP_NO_TICKET: 16384; + SSL_OP_NO_TLSv1: 67108864; + SSL_OP_NO_TLSv1_1: 268435456; + SSL_OP_NO_TLSv1_2: 134217728; + SSL_OP_NO_TLSv1_3: 536870912; + SSL_OP_PRIORITIZE_CHACHA: 2097152; + SSL_OP_TLS_ROLLBACK_BUG: 8388608; + ENGINE_METHOD_RSA: 1; + ENGINE_METHOD_DSA: 2; + ENGINE_METHOD_DH: 4; + ENGINE_METHOD_RAND: 8; + ENGINE_METHOD_EC: 2048; + ENGINE_METHOD_CIPHERS: 64; + ENGINE_METHOD_DIGESTS: 128; + ENGINE_METHOD_PKEY_METHS: 512; + ENGINE_METHOD_PKEY_ASN1_METHS: 1024; + ENGINE_METHOD_ALL: 65535; + ENGINE_METHOD_NONE: 0; + DH_CHECK_P_NOT_SAFE_PRIME: 2; + DH_CHECK_P_NOT_PRIME: 1; + DH_UNABLE_TO_CHECK_GENERATOR: 4; + DH_NOT_SUITABLE_GENERATOR: 8; + RSA_PKCS1_PADDING: 1; + RSA_SSLV23_PADDING: 2; + RSA_NO_PADDING: 3; + RSA_PKCS1_OAEP_PADDING: 4; + RSA_X931_PADDING: 5; + RSA_PKCS1_PSS_PADDING: 6; + RSA_PSS_SALTLEN_DIGEST: -1; + RSA_PSS_SALTLEN_MAX_SIGN: -2; + RSA_PSS_SALTLEN_AUTO: -2; + defaultCoreCipherList: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA'; + TLS1_VERSION: 769; + TLS1_1_VERSION: 770; + TLS1_2_VERSION: 771; + TLS1_3_VERSION: 772; + POINT_CONVERSION_COMPRESSED: 2; + POINT_CONVERSION_UNCOMPRESSED: 4; + POINT_CONVERSION_HYBRID: 6; }; - priority: { - PRIORITY_LOW: 19; - PRIORITY_BELOW_NORMAL: 10; - PRIORITY_NORMAL: 0; - PRIORITY_ABOVE_NORMAL: -7; - PRIORITY_HIGH: -14; - PRIORITY_HIGHEST: -20; + zlib: { + Z_NO_FLUSH: 0; + Z_PARTIAL_FLUSH: 1; + Z_SYNC_FLUSH: 2; + Z_FULL_FLUSH: 3; + Z_FINISH: 4; + Z_BLOCK: 5; + Z_OK: 0; + Z_STREAM_END: 1; + Z_NEED_DICT: 2; + Z_ERRNO: -1; + Z_STREAM_ERROR: -2; + Z_DATA_ERROR: -3; + Z_MEM_ERROR: -4; + Z_BUF_ERROR: -5; + Z_VERSION_ERROR: -6; + Z_NO_COMPRESSION: 0; + Z_BEST_SPEED: 1; + Z_BEST_COMPRESSION: 9; + Z_DEFAULT_COMPRESSION: -1; + Z_FILTERED: 1; + Z_HUFFMAN_ONLY: 2; + Z_RLE: 3; + Z_FIXED: 4; + Z_DEFAULT_STRATEGY: 0; + ZLIB_VERNUM: 4784; + DEFLATE: 1; + INFLATE: 2; + GZIP: 3; + GUNZIP: 4; + DEFLATERAW: 5; + INFLATERAW: 6; + UNZIP: 7; + BROTLI_DECODE: 8; + BROTLI_ENCODE: 9; + Z_MIN_WINDOWBITS: 8; + Z_MAX_WINDOWBITS: 15; + Z_DEFAULT_WINDOWBITS: 15; + Z_MIN_CHUNK: 64; + Z_MAX_CHUNK: number; + Z_DEFAULT_CHUNK: 16384; + Z_MIN_MEMLEVEL: 1; + Z_MAX_MEMLEVEL: 9; + Z_DEFAULT_MEMLEVEL: 8; + Z_MIN_LEVEL: -1; + Z_MAX_LEVEL: 9; + Z_DEFAULT_LEVEL: -1; + BROTLI_OPERATION_PROCESS: 0; + BROTLI_OPERATION_FLUSH: 1; + BROTLI_OPERATION_FINISH: 2; + BROTLI_OPERATION_EMIT_METADATA: 3; + BROTLI_PARAM_MODE: 0; + BROTLI_MODE_GENERIC: 0; + BROTLI_MODE_TEXT: 1; + BROTLI_MODE_FONT: 2; + BROTLI_DEFAULT_MODE: 0; + BROTLI_PARAM_QUALITY: 1; + BROTLI_MIN_QUALITY: 0; + BROTLI_MAX_QUALITY: 11; + BROTLI_DEFAULT_QUALITY: 11; + BROTLI_PARAM_LGWIN: 2; + BROTLI_MIN_WINDOW_BITS: 10; + BROTLI_MAX_WINDOW_BITS: 24; + BROTLI_LARGE_MAX_WINDOW_BITS: 30; + BROTLI_DEFAULT_WINDOW: 22; + BROTLI_PARAM_LGBLOCK: 3; + BROTLI_MIN_INPUT_BLOCK_BITS: 16; + BROTLI_MAX_INPUT_BLOCK_BITS: 24; + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4; + BROTLI_PARAM_SIZE_HINT: 5; + BROTLI_PARAM_LARGE_WINDOW: 6; + BROTLI_PARAM_NPOSTFIX: 7; + BROTLI_PARAM_NDIRECT: 8; + BROTLI_DECODER_RESULT_ERROR: 0; + BROTLI_DECODER_RESULT_SUCCESS: 1; + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2; + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3; + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0; + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1; + BROTLI_DECODER_NO_ERROR: 0; + BROTLI_DECODER_SUCCESS: 1; + BROTLI_DECODER_NEEDS_MORE_INPUT: 2; + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3; + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1; + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2; + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3; + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4; + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5; + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6; + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7; + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8; + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9; + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10; + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11; + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12; + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13; + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14; + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15; + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16; + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19; + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20; + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21; + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22; + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25; + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26; + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27; + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30; + BROTLI_DECODER_ERROR_UNREACHABLE: -31; }; - }; - fs: { - UV_FS_SYMLINK_DIR: 1; - UV_FS_SYMLINK_JUNCTION: 2; - O_RDONLY: 0; - O_WRONLY: 1; - O_RDWR: 2; - UV_DIRENT_UNKNOWN: 0; - UV_DIRENT_FILE: 1; - UV_DIRENT_DIR: 2; - UV_DIRENT_LINK: 3; - UV_DIRENT_FIFO: 4; - UV_DIRENT_SOCKET: 5; - UV_DIRENT_CHAR: 6; - UV_DIRENT_BLOCK: 7; - S_IFMT: 61440; - S_IFREG: 32768; - S_IFDIR: 16384; - S_IFCHR: 8192; - S_IFBLK: 24576; - S_IFIFO: 4096; - S_IFLNK: 40960; - S_IFSOCK: 49152; - O_CREAT: 512; - O_EXCL: 2048; - UV_FS_O_FILEMAP: 0; - O_NOCTTY: 131072; - O_TRUNC: 1024; - O_APPEND: 8; - O_DIRECTORY: 1048576; - O_NOFOLLOW: 256; - O_SYNC: 128; - O_DSYNC: 4194304; - O_SYMLINK: 2097152; - O_NONBLOCK: 4; - S_IRWXU: 448; - S_IRUSR: 256; - S_IWUSR: 128; - S_IXUSR: 64; - S_IRWXG: 56; - S_IRGRP: 32; - S_IWGRP: 16; - S_IXGRP: 8; - S_IRWXO: 7; - S_IROTH: 4; - S_IWOTH: 2; - S_IXOTH: 1; - F_OK: 0; - R_OK: 4; - W_OK: 2; - X_OK: 1; - UV_FS_COPYFILE_EXCL: 1; - COPYFILE_EXCL: 1; - UV_FS_COPYFILE_FICLONE: 2; - COPYFILE_FICLONE: 2; - UV_FS_COPYFILE_FICLONE_FORCE: 4; - COPYFILE_FICLONE_FORCE: 4; - }; - crypto: { - OPENSSL_VERSION_NUMBER: 269488319; - SSL_OP_ALL: 2147485780; - SSL_OP_ALLOW_NO_DHE_KEX: 1024; - SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: 262144; - SSL_OP_CIPHER_SERVER_PREFERENCE: 4194304; - SSL_OP_CISCO_ANYCONNECT: 32768; - SSL_OP_COOKIE_EXCHANGE: 8192; - SSL_OP_CRYPTOPRO_TLSEXT_BUG: 2147483648; - SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: 2048; - SSL_OP_LEGACY_SERVER_CONNECT: 4; - SSL_OP_NO_COMPRESSION: 131072; - SSL_OP_NO_ENCRYPT_THEN_MAC: 524288; - SSL_OP_NO_QUERY_MTU: 4096; - SSL_OP_NO_RENEGOTIATION: 1073741824; - SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: 65536; - SSL_OP_NO_SSLv2: 0; - SSL_OP_NO_SSLv3: 33554432; - SSL_OP_NO_TICKET: 16384; - SSL_OP_NO_TLSv1: 67108864; - SSL_OP_NO_TLSv1_1: 268435456; - SSL_OP_NO_TLSv1_2: 134217728; - SSL_OP_NO_TLSv1_3: 536870912; - SSL_OP_PRIORITIZE_CHACHA: 2097152; - SSL_OP_TLS_ROLLBACK_BUG: 8388608; - ENGINE_METHOD_RSA: 1; - ENGINE_METHOD_DSA: 2; - ENGINE_METHOD_DH: 4; - ENGINE_METHOD_RAND: 8; - ENGINE_METHOD_EC: 2048; - ENGINE_METHOD_CIPHERS: 64; - ENGINE_METHOD_DIGESTS: 128; - ENGINE_METHOD_PKEY_METHS: 512; - ENGINE_METHOD_PKEY_ASN1_METHS: 1024; - ENGINE_METHOD_ALL: 65535; - ENGINE_METHOD_NONE: 0; - DH_CHECK_P_NOT_SAFE_PRIME: 2; - DH_CHECK_P_NOT_PRIME: 1; - DH_UNABLE_TO_CHECK_GENERATOR: 4; - DH_NOT_SUITABLE_GENERATOR: 8; - RSA_PKCS1_PADDING: 1; - RSA_SSLV23_PADDING: 2; - RSA_NO_PADDING: 3; - RSA_PKCS1_OAEP_PADDING: 4; - RSA_X931_PADDING: 5; - RSA_PKCS1_PSS_PADDING: 6; - RSA_PSS_SALTLEN_DIGEST: -1; - RSA_PSS_SALTLEN_MAX_SIGN: -2; - RSA_PSS_SALTLEN_AUTO: -2; - defaultCoreCipherList: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA'; - TLS1_VERSION: 769; - TLS1_1_VERSION: 770; - TLS1_2_VERSION: 771; - TLS1_3_VERSION: 772; - POINT_CONVERSION_COMPRESSED: 2; - POINT_CONVERSION_UNCOMPRESSED: 4; - POINT_CONVERSION_HYBRID: 6; - }; - zlib: { - Z_NO_FLUSH: 0; - Z_PARTIAL_FLUSH: 1; - Z_SYNC_FLUSH: 2; - Z_FULL_FLUSH: 3; - Z_FINISH: 4; - Z_BLOCK: 5; - Z_OK: 0; - Z_STREAM_END: 1; - Z_NEED_DICT: 2; - Z_ERRNO: -1; - Z_STREAM_ERROR: -2; - Z_DATA_ERROR: -3; - Z_MEM_ERROR: -4; - Z_BUF_ERROR: -5; - Z_VERSION_ERROR: -6; - Z_NO_COMPRESSION: 0; - Z_BEST_SPEED: 1; - Z_BEST_COMPRESSION: 9; - Z_DEFAULT_COMPRESSION: -1; - Z_FILTERED: 1; - Z_HUFFMAN_ONLY: 2; - Z_RLE: 3; - Z_FIXED: 4; - Z_DEFAULT_STRATEGY: 0; - ZLIB_VERNUM: 4784; - DEFLATE: 1; - INFLATE: 2; - GZIP: 3; - GUNZIP: 4; - DEFLATERAW: 5; - INFLATERAW: 6; - UNZIP: 7; - BROTLI_DECODE: 8; - BROTLI_ENCODE: 9; - Z_MIN_WINDOWBITS: 8; - Z_MAX_WINDOWBITS: 15; - Z_DEFAULT_WINDOWBITS: 15; - Z_MIN_CHUNK: 64; - Z_MAX_CHUNK: number; - Z_DEFAULT_CHUNK: 16384; - Z_MIN_MEMLEVEL: 1; - Z_MAX_MEMLEVEL: 9; - Z_DEFAULT_MEMLEVEL: 8; - Z_MIN_LEVEL: -1; - Z_MAX_LEVEL: 9; - Z_DEFAULT_LEVEL: -1; - BROTLI_OPERATION_PROCESS: 0; - BROTLI_OPERATION_FLUSH: 1; - BROTLI_OPERATION_FINISH: 2; - BROTLI_OPERATION_EMIT_METADATA: 3; - BROTLI_PARAM_MODE: 0; - BROTLI_MODE_GENERIC: 0; - BROTLI_MODE_TEXT: 1; - BROTLI_MODE_FONT: 2; - BROTLI_DEFAULT_MODE: 0; - BROTLI_PARAM_QUALITY: 1; - BROTLI_MIN_QUALITY: 0; - BROTLI_MAX_QUALITY: 11; - BROTLI_DEFAULT_QUALITY: 11; - BROTLI_PARAM_LGWIN: 2; - BROTLI_MIN_WINDOW_BITS: 10; - BROTLI_MAX_WINDOW_BITS: 24; - BROTLI_LARGE_MAX_WINDOW_BITS: 30; - BROTLI_DEFAULT_WINDOW: 22; - BROTLI_PARAM_LGBLOCK: 3; - BROTLI_MIN_INPUT_BLOCK_BITS: 16; - BROTLI_MAX_INPUT_BLOCK_BITS: 24; - BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4; - BROTLI_PARAM_SIZE_HINT: 5; - BROTLI_PARAM_LARGE_WINDOW: 6; - BROTLI_PARAM_NPOSTFIX: 7; - BROTLI_PARAM_NDIRECT: 8; - BROTLI_DECODER_RESULT_ERROR: 0; - BROTLI_DECODER_RESULT_SUCCESS: 1; - BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2; - BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3; - BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0; - BROTLI_DECODER_PARAM_LARGE_WINDOW: 1; - BROTLI_DECODER_NO_ERROR: 0; - BROTLI_DECODER_SUCCESS: 1; - BROTLI_DECODER_NEEDS_MORE_INPUT: 2; - BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3; - BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1; - BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2; - BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3; - BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4; - BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5; - BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6; - BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7; - BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8; - BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9; - BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10; - BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11; - BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12; - BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13; - BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14; - BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15; - BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16; - BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19; - BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20; - BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21; - BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22; - BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25; - BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26; - BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27; - BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30; - BROTLI_DECODER_ERROR_UNREACHABLE: -31; - }; - trace: { - TRACE_EVENT_PHASE_BEGIN: 66; - TRACE_EVENT_PHASE_END: 69; - TRACE_EVENT_PHASE_COMPLETE: 88; - TRACE_EVENT_PHASE_INSTANT: 73; - TRACE_EVENT_PHASE_ASYNC_BEGIN: 83; - TRACE_EVENT_PHASE_ASYNC_STEP_INTO: 84; - TRACE_EVENT_PHASE_ASYNC_STEP_PAST: 112; - TRACE_EVENT_PHASE_ASYNC_END: 70; - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: 98; - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END: 101; - TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT: 110; - TRACE_EVENT_PHASE_FLOW_BEGIN: 115; - TRACE_EVENT_PHASE_FLOW_STEP: 116; - TRACE_EVENT_PHASE_FLOW_END: 102; - TRACE_EVENT_PHASE_METADATA: 77; - TRACE_EVENT_PHASE_COUNTER: 67; - TRACE_EVENT_PHASE_SAMPLE: 80; - TRACE_EVENT_PHASE_CREATE_OBJECT: 78; - TRACE_EVENT_PHASE_SNAPSHOT_OBJECT: 79; - TRACE_EVENT_PHASE_DELETE_OBJECT: 68; - TRACE_EVENT_PHASE_MEMORY_DUMP: 118; - TRACE_EVENT_PHASE_MARK: 82; - TRACE_EVENT_PHASE_CLOCK_SYNC: 99; - TRACE_EVENT_PHASE_ENTER_CONTEXT: 40; - TRACE_EVENT_PHASE_LEAVE_CONTEXT: 41; - TRACE_EVENT_PHASE_LINK_IDS: 61; - }; -}; + trace: { + TRACE_EVENT_PHASE_BEGIN: 66; + TRACE_EVENT_PHASE_END: 69; + TRACE_EVENT_PHASE_COMPLETE: 88; + TRACE_EVENT_PHASE_INSTANT: 73; + TRACE_EVENT_PHASE_ASYNC_BEGIN: 83; + TRACE_EVENT_PHASE_ASYNC_STEP_INTO: 84; + TRACE_EVENT_PHASE_ASYNC_STEP_PAST: 112; + TRACE_EVENT_PHASE_ASYNC_END: 70; + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: 98; + TRACE_EVENT_PHASE_NESTABLE_ASYNC_END: 101; + TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT: 110; + TRACE_EVENT_PHASE_FLOW_BEGIN: 115; + TRACE_EVENT_PHASE_FLOW_STEP: 116; + TRACE_EVENT_PHASE_FLOW_END: 102; + TRACE_EVENT_PHASE_METADATA: 77; + TRACE_EVENT_PHASE_COUNTER: 67; + TRACE_EVENT_PHASE_SAMPLE: 80; + TRACE_EVENT_PHASE_CREATE_OBJECT: 78; + TRACE_EVENT_PHASE_SNAPSHOT_OBJECT: 79; + TRACE_EVENT_PHASE_DELETE_OBJECT: 68; + TRACE_EVENT_PHASE_MEMORY_DUMP: 118; + TRACE_EVENT_PHASE_MARK: 82; + TRACE_EVENT_PHASE_CLOCK_SYNC: 99; + TRACE_EVENT_PHASE_ENTER_CONTEXT: 40; + TRACE_EVENT_PHASE_LEAVE_CONTEXT: 41; + TRACE_EVENT_PHASE_LINK_IDS: 61; + }; + } +} diff --git a/typings/internalBinding/fs.d.ts b/typings/internalBinding/fs.d.ts index 73c4f87e19..b8f851fda0 100644 --- a/typings/internalBinding/fs.d.ts +++ b/typings/internalBinding/fs.d.ts @@ -220,53 +220,55 @@ declare namespace InternalFSBinding { function writeString(fd: number, value: string, pos: unknown, encoding: unknown, usePromises: typeof kUsePromises): Promise; } -declare function internalBinding(binding: 'fs'): { - FSReqCallback: typeof InternalFSBinding.FSReqCallback; - - FileHandle: typeof InternalFSBinding.FileHandle; - - kUsePromises: typeof InternalFSBinding.kUsePromises; - - statValues: Float64Array; - bigintStatValues: BigUint64Array; - - kFsStatsFieldsNumber: number; - StatWatcher: typeof InternalFSBinding.StatWatcher; - - access: typeof InternalFSBinding.access; - chmod: typeof InternalFSBinding.chmod; - chown: typeof InternalFSBinding.chown; - close: typeof InternalFSBinding.close; - copyFile: typeof InternalFSBinding.copyFile; - fchmod: typeof InternalFSBinding.fchmod; - fchown: typeof InternalFSBinding.fchown; - fdatasync: typeof InternalFSBinding.fdatasync; - fstat: typeof InternalFSBinding.fstat; - fsync: typeof InternalFSBinding.fsync; - ftruncate: typeof InternalFSBinding.ftruncate; - futimes: typeof InternalFSBinding.futimes; - internalModuleReadJSON: typeof InternalFSBinding.internalModuleReadJSON; - internalModuleStat: typeof InternalFSBinding.internalModuleStat; - lchown: typeof InternalFSBinding.lchown; - link: typeof InternalFSBinding.link; - lstat: typeof InternalFSBinding.lstat; - lutimes: typeof InternalFSBinding.lutimes; - mkdtemp: typeof InternalFSBinding.mkdtemp; - mkdir: typeof InternalFSBinding.mkdir; - open: typeof InternalFSBinding.open; - openFileHandle: typeof InternalFSBinding.openFileHandle; - read: typeof InternalFSBinding.read; - readBuffers: typeof InternalFSBinding.readBuffers; - readdir: typeof InternalFSBinding.readdir; - readlink: typeof InternalFSBinding.readlink; - realpath: typeof InternalFSBinding.realpath; - rename: typeof InternalFSBinding.rename; - rmdir: typeof InternalFSBinding.rmdir; - stat: typeof InternalFSBinding.stat; - symlink: typeof InternalFSBinding.symlink; - unlink: typeof InternalFSBinding.unlink; - utimes: typeof InternalFSBinding.utimes; - writeBuffer: typeof InternalFSBinding.writeBuffer; - writeBuffers: typeof InternalFSBinding.writeBuffers; - writeString: typeof InternalFSBinding.writeString; -}; +declare interface InternalBinding { + (binding: 'fs'): { + FSReqCallback: typeof InternalFSBinding.FSReqCallback; + + FileHandle: typeof InternalFSBinding.FileHandle; + + kUsePromises: typeof InternalFSBinding.kUsePromises; + + statValues: Float64Array; + bigintStatValues: BigUint64Array; + + kFsStatsFieldsNumber: number; + StatWatcher: typeof InternalFSBinding.StatWatcher; + + access: typeof InternalFSBinding.access; + chmod: typeof InternalFSBinding.chmod; + chown: typeof InternalFSBinding.chown; + close: typeof InternalFSBinding.close; + copyFile: typeof InternalFSBinding.copyFile; + fchmod: typeof InternalFSBinding.fchmod; + fchown: typeof InternalFSBinding.fchown; + fdatasync: typeof InternalFSBinding.fdatasync; + fstat: typeof InternalFSBinding.fstat; + fsync: typeof InternalFSBinding.fsync; + ftruncate: typeof InternalFSBinding.ftruncate; + futimes: typeof InternalFSBinding.futimes; + internalModuleReadJSON: typeof InternalFSBinding.internalModuleReadJSON; + internalModuleStat: typeof InternalFSBinding.internalModuleStat; + lchown: typeof InternalFSBinding.lchown; + link: typeof InternalFSBinding.link; + lstat: typeof InternalFSBinding.lstat; + lutimes: typeof InternalFSBinding.lutimes; + mkdtemp: typeof InternalFSBinding.mkdtemp; + mkdir: typeof InternalFSBinding.mkdir; + open: typeof InternalFSBinding.open; + openFileHandle: typeof InternalFSBinding.openFileHandle; + read: typeof InternalFSBinding.read; + readBuffers: typeof InternalFSBinding.readBuffers; + readdir: typeof InternalFSBinding.readdir; + readlink: typeof InternalFSBinding.readlink; + realpath: typeof InternalFSBinding.realpath; + rename: typeof InternalFSBinding.rename; + rmdir: typeof InternalFSBinding.rmdir; + stat: typeof InternalFSBinding.stat; + symlink: typeof InternalFSBinding.symlink; + unlink: typeof InternalFSBinding.unlink; + utimes: typeof InternalFSBinding.utimes; + writeBuffer: typeof InternalFSBinding.writeBuffer; + writeBuffers: typeof InternalFSBinding.writeBuffers; + writeString: typeof InternalFSBinding.writeString; + } +} diff --git a/typings/internalBinding/http_parser.d.ts b/typings/internalBinding/http_parser.d.ts index e56fe1f127..a813487c67 100644 --- a/typings/internalBinding/http_parser.d.ts +++ b/typings/internalBinding/http_parser.d.ts @@ -39,7 +39,9 @@ declare namespace InternalHttpParserBinding { } } -declare function internalBinding(binding: 'http_parser'): { - methods: string[]; - HTTPParser: typeof InternalHttpParserBinding.HTTPParser; -}; +declare interface InternalBinding { + (binding: 'http_parser'): { + methods: string[]; + HTTPParser: typeof InternalHttpParserBinding.HTTPParser; + } +} diff --git a/typings/internalBinding/messaging.d.ts b/typings/internalBinding/messaging.d.ts index 303402706d..8c4bab120e 100644 --- a/typings/internalBinding/messaging.d.ts +++ b/typings/internalBinding/messaging.d.ts @@ -19,16 +19,18 @@ declare namespace InternalMessagingBinding { } -declare function internalBinding(binding: 'messaging'): { - DOMException: typeof DOMException; - MessageChannel: typeof InternalMessagingBinding.MessageChannel; - MessagePort: typeof InternalMessagingBinding.MessagePort; - JSTransferable: typeof InternalMessagingBinding.JSTransferable; - stopMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; - checkMessagePort(port: unknown): boolean; - drainMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; - receiveMessageOnPort(port: typeof InternalMessagingBinding.MessagePort): any; - moveMessagePortToContext(port: typeof InternalMessagingBinding.MessagePort, context: any): typeof InternalMessagingBinding.MessagePort; - setDeserializerCreateObjectFunction(func: (deserializeInfo: string) => any): void; - broadcastChannel(name: string): typeof InternalMessagingBinding.MessagePort; -}; +declare interface InternalBinding { + (binding: 'messaging'): { + DOMException: typeof DOMException; + MessageChannel: typeof InternalMessagingBinding.MessageChannel; + MessagePort: typeof InternalMessagingBinding.MessagePort; + JSTransferable: typeof InternalMessagingBinding.JSTransferable; + stopMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; + checkMessagePort(port: unknown): boolean; + drainMessagePort(port: typeof InternalMessagingBinding.MessagePort): void; + receiveMessageOnPort(port: typeof InternalMessagingBinding.MessagePort): any; + moveMessagePortToContext(port: typeof InternalMessagingBinding.MessagePort, context: any): typeof InternalMessagingBinding.MessagePort; + setDeserializerCreateObjectFunction(func: (deserializeInfo: string) => any): void; + broadcastChannel(name: string): typeof InternalMessagingBinding.MessagePort; + } +} diff --git a/typings/internalBinding/options.d.ts b/typings/internalBinding/options.d.ts index af845e2207..41a4445806 100644 --- a/typings/internalBinding/options.d.ts +++ b/typings/internalBinding/options.d.ts @@ -1,35 +1,37 @@ -declare function internalBinding(binding: 'options'): { - getOptions(): { - options: Map< - string, - { - helpText: string; - envVarSettings: 0 | 1; - } & ( - | { type: 0 | 1; value: undefined } - | { type: 2; value: boolean } - | { type: 3 | 4; value: number } - | { type: 5; value: string } - | { type: 6; value: { host: string; port: number } } - | { type: 7; value: string[] } - ) - >; - aliases: Map; - }; - envSettings: { - kAllowedInEnvironment: 0; - kDisallowedInEnvironment: 1; - }; - noGlobalSearchPaths: boolean; - shouldNotRegisterESMLoader: boolean; - types: { - kNoOp: 0; - kV8Option: 1; - kBoolean: 2; - kInteger: 3; - kUInteger: 4; - kString: 5; - kHostPort: 6; - kStringList: 7; - }; -}; +declare interface InternalBinding { + (binding: 'options'): { + getOptions(): { + options: Map< + string, + { + helpText: string; + envVarSettings: 0 | 1; + } & ( + | { type: 0 | 1; value: undefined } + | { type: 2; value: boolean } + | { type: 3 | 4; value: number } + | { type: 5; value: string } + | { type: 6; value: { host: string; port: number } } + | { type: 7; value: string[] } + ) + >; + aliases: Map; + }; + envSettings: { + kAllowedInEnvironment: 0; + kDisallowedInEnvironment: 1; + }; + noGlobalSearchPaths: boolean; + shouldNotRegisterESMLoader: boolean; + types: { + kNoOp: 0; + kV8Option: 1; + kBoolean: 2; + kInteger: 3; + kUInteger: 4; + kString: 5; + kHostPort: 6; + kStringList: 7; + }; + } +} diff --git a/typings/internalBinding/os.d.ts b/typings/internalBinding/os.d.ts index c6f16f76b0..12443c3f1f 100644 --- a/typings/internalBinding/os.d.ts +++ b/typings/internalBinding/os.d.ts @@ -2,24 +2,26 @@ declare namespace InternalOSBinding { type OSContext = {}; } -declare function internalBinding(binding: 'os'): { - getHostname(ctx: InternalOSBinding.OSContext): string | undefined; - getLoadAvg(array: Float64Array): void; - getUptime(): number; - getTotalMem(): number; - getFreeMem(): number; - getCPUs(): Array; - getInterfaceAddresses(ctx: InternalOSBinding.OSContext): Array | undefined; - getHomeDirectory(ctx: InternalOSBinding.OSContext): string | undefined; - getUserInfo(options: { encoding?: string } | undefined, ctx: InternalOSBinding.OSContext): { - uid: number; - gid: number; - username: string; - homedir: string; - shell: string | null; - } | undefined; - setPriority(pid: number, priority: number, ctx: InternalOSBinding.OSContext): number; - getPriority(pid: number, ctx: InternalOSBinding.OSContext): number | undefined; - getOSInformation(ctx: InternalOSBinding.OSContext): [sysname: string, version: string, release: string]; - isBigEndian: boolean; -}; +declare interface InternalBinding { + (binding: 'os'): { + getHostname(ctx: InternalOSBinding.OSContext): string | undefined; + getLoadAvg(array: Float64Array): void; + getUptime(): number; + getTotalMem(): number; + getFreeMem(): number; + getCPUs(): Array; + getInterfaceAddresses(ctx: InternalOSBinding.OSContext): Array | undefined; + getHomeDirectory(ctx: InternalOSBinding.OSContext): string | undefined; + getUserInfo(options: { encoding?: string } | undefined, ctx: InternalOSBinding.OSContext): { + uid: number; + gid: number; + username: string; + homedir: string; + shell: string | null; + } | undefined; + setPriority(pid: number, priority: number, ctx: InternalOSBinding.OSContext): number; + getPriority(pid: number, ctx: InternalOSBinding.OSContext): number | undefined; + getOSInformation(ctx: InternalOSBinding.OSContext): [sysname: string, version: string, release: string]; + isBigEndian: boolean; + } +} diff --git a/typings/internalBinding/serdes.d.ts b/typings/internalBinding/serdes.d.ts index f28bb6891f..05f1c16e39 100644 --- a/typings/internalBinding/serdes.d.ts +++ b/typings/internalBinding/serdes.d.ts @@ -30,7 +30,9 @@ declare namespace InternalSerdesBinding { } } -declare function internalBinding(binding: 'serdes'): { - Serializer: typeof InternalSerdesBinding.Serializer; - Deserializer: typeof InternalSerdesBinding.Deserializer; -}; +declare interface InternalBinding { + (binding: 'serdes'): { + Serializer: typeof InternalSerdesBinding.Serializer; + Deserializer: typeof InternalSerdesBinding.Deserializer; + } +} diff --git a/typings/internalBinding/symbols.d.ts b/typings/internalBinding/symbols.d.ts index 71a35cdb6f..f24726b737 100644 --- a/typings/internalBinding/symbols.d.ts +++ b/typings/internalBinding/symbols.d.ts @@ -10,16 +10,18 @@ export const owner_symbol: unique symbol; export const onpskexchange_symbol: unique symbol; export const trigger_async_id_symbol: unique symbol; -declare function internalBinding(binding: 'symbols'): { - async_id_symbol: typeof async_id_symbol; - handle_onclose_symbol: typeof handle_onclose_symbol; - no_message_symbol: typeof no_message_symbol; - messaging_deserialize_symbol: typeof messaging_deserialize_symbol; - messaging_transfer_symbol: typeof messaging_transfer_symbol; - messaging_clone_symbol: typeof messaging_clone_symbol; - messaging_transfer_list_symbol: typeof messaging_transfer_list_symbol; - oninit_symbol: typeof oninit_symbol; - owner_symbol: typeof owner_symbol; - onpskexchange_symbol: typeof onpskexchange_symbol; - trigger_async_id_symbol: typeof trigger_async_id_symbol; -}; +declare interface InternalBinding { + (binding: 'symbols'): { + async_id_symbol: typeof async_id_symbol; + handle_onclose_symbol: typeof handle_onclose_symbol; + no_message_symbol: typeof no_message_symbol; + messaging_deserialize_symbol: typeof messaging_deserialize_symbol; + messaging_transfer_symbol: typeof messaging_transfer_symbol; + messaging_clone_symbol: typeof messaging_clone_symbol; + messaging_transfer_list_symbol: typeof messaging_transfer_list_symbol; + oninit_symbol: typeof oninit_symbol; + owner_symbol: typeof owner_symbol; + onpskexchange_symbol: typeof onpskexchange_symbol; + trigger_async_id_symbol: typeof trigger_async_id_symbol; + } +} diff --git a/typings/internalBinding/timers.d.ts b/typings/internalBinding/timers.d.ts index deba8ed629..26494895f3 100644 --- a/typings/internalBinding/timers.d.ts +++ b/typings/internalBinding/timers.d.ts @@ -1,8 +1,10 @@ -declare function internalBinding(binding: 'timers'): { - getLibuvNow(): number; - setupTimers(immediateCallback: () => void, timersCallback: (now: number) => void): void; - scheduleTimer(msecs: number): void; - toggleTimerRef(value: boolean): void; - toggleImmediateRef(value: boolean): void; - immediateInfo: Uint32Array; -}; +declare interface InternalBinding { + (binding: 'timers'): { + getLibuvNow(): number; + setupTimers(immediateCallback: () => void, timersCallback: (now: number) => void): void; + scheduleTimer(msecs: number): void; + toggleTimerRef(value: boolean): void; + toggleImmediateRef(value: boolean): void; + immediateInfo: Uint32Array; + } +} diff --git a/typings/internalBinding/types.d.ts b/typings/internalBinding/types.d.ts index dca2018fb2..be68b8bde0 100644 --- a/typings/internalBinding/types.d.ts +++ b/typings/internalBinding/types.d.ts @@ -1,26 +1,28 @@ -declare function internalBinding(binding: 'types'): { - isAsyncFunction(value: unknown): value is (...args: unknown[]) => Promise; - 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; - 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; - isMapIterator: (value: unknown) => value is IterableIterator; - isModuleNamespaceObject: (value: unknown) => value is { [Symbol.toStringTag]: 'Module' }; - isNativeError: (value: unknown) => Error; - isPromise: (value: unknown) => value is Promise; - isSet: (value: unknown) => value is Set; - isSetIterator: (value: unknown) => value is IterableIterator; - isWeakMap: (value: unknown) => value is WeakMap; - isWeakSet: (value: unknown) => value is WeakSet; - 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 interface InternalBinding { + (binding: 'types'): { + isAsyncFunction(value: unknown): value is (...args: unknown[]) => Promise; + 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; + 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; + isMapIterator: (value: unknown) => value is IterableIterator; + isModuleNamespaceObject: (value: unknown) => value is { [Symbol.toStringTag]: 'Module' }; + isNativeError: (value: unknown) => Error; + isPromise: (value: unknown) => value is Promise; + isSet: (value: unknown) => value is Set; + isSetIterator: (value: unknown) => value is IterableIterator; + isWeakMap: (value: unknown) => value is WeakMap; + isWeakSet: (value: unknown) => value is WeakSet; + 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; + } +} diff --git a/typings/internalBinding/util.d.ts b/typings/internalBinding/util.d.ts index 97fa2ed2b2..6cd68c44bb 100644 --- a/typings/internalBinding/util.d.ts +++ b/typings/internalBinding/util.d.ts @@ -7,41 +7,43 @@ declare namespace InternalUtilBinding { } } -declare function internalBinding(binding: 'util'): { - // PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES, defined in src/env_properties.h - arrow_message_private_symbol: 1; - contextify_context_private_symbol: 2; - decorated_private_symbol: 3; - napi_type_tag: 4; - napi_wrapper: 5; - untransferable_object_private_symbol: 6; - exiting_aliased_Uint32Array: 7; - - kPending: 0; - kFulfilled: 1; - kRejected: 2; - - getHiddenValue(object: object, index: number): any; - setHiddenValue(object: object, index: number, value: any): boolean; - getPromiseDetails(promise: any): undefined | [state: 0] | [state: 1 | 2, result: any]; - getProxyDetails(proxy: any, fullProxy?: boolean): undefined | any | [target: any, handler: any]; - previewEntries(object: object, slowPath?: boolean): undefined | any[] | [entries: any[], isKeyValue: boolean]; - getOwnNonIndexProperties(object: object, filter: number): Array; - getConstructorName(object: object): string; - getExternalValue(value: any): bigint; - sleep(msec: number): void; - isConstructor(fn: Function): boolean; - arrayBufferViewHasBuffer(view: ArrayBufferView): boolean; - propertyFilter: { - ALL_PROPERTIES: 0; - ONLY_WRITABLE: 1; - ONLY_ENUMERABLE: 2; - ONLY_CONFIGURABLE: 4; - SKIP_STRINGS: 8; - SKIP_SYMBOLS: 16; - }; - shouldAbortOnUncaughtToggle: [shouldAbort: 0 | 1]; - WeakReference: typeof InternalUtilBinding.WeakReference; - guessHandleType(fd: number): 'TCP' | 'TTY' | 'UDP' | 'FILE' | 'PIPE' | 'UNKNOWN'; - toUSVString(str: string, start: number): string; -}; +declare interface InternalBinding { + (binding: 'util'): { + // PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES, defined in src/env_properties.h + arrow_message_private_symbol: 1; + contextify_context_private_symbol: 2; + decorated_private_symbol: 3; + napi_type_tag: 4; + napi_wrapper: 5; + untransferable_object_private_symbol: 6; + exiting_aliased_Uint32Array: 7; + + kPending: 0; + kFulfilled: 1; + kRejected: 2; + + getHiddenValue(object: object, index: number): any; + setHiddenValue(object: object, index: number, value: any): boolean; + getPromiseDetails(promise: any): undefined | [state: 0] | [state: 1 | 2, result: any]; + getProxyDetails(proxy: any, fullProxy?: boolean): undefined | any | [target: any, handler: any]; + previewEntries(object: object, slowPath?: boolean): undefined | any[] | [entries: any[], isKeyValue: boolean]; + getOwnNonIndexProperties(object: object, filter: number): Array; + getConstructorName(object: object): string; + getExternalValue(value: any): bigint; + sleep(msec: number): void; + isConstructor(fn: Function): boolean; + arrayBufferViewHasBuffer(view: ArrayBufferView): boolean; + propertyFilter: { + ALL_PROPERTIES: 0; + ONLY_WRITABLE: 1; + ONLY_ENUMERABLE: 2; + ONLY_CONFIGURABLE: 4; + SKIP_STRINGS: 8; + SKIP_SYMBOLS: 16; + }; + shouldAbortOnUncaughtToggle: [shouldAbort: 0 | 1]; + WeakReference: typeof InternalUtilBinding.WeakReference; + guessHandleType(fd: number): 'TCP' | 'TTY' | 'UDP' | 'FILE' | 'PIPE' | 'UNKNOWN'; + toUSVString(str: string, start: number): string; + } +} diff --git a/typings/internalBinding/worker.d.ts b/typings/internalBinding/worker.d.ts index 1ec8f5c3af..4c463d972b 100644 --- a/typings/internalBinding/worker.d.ts +++ b/typings/internalBinding/worker.d.ts @@ -20,16 +20,18 @@ declare namespace InternalWorkerBinding { } } -declare function internalBinding(binding: 'worker'): { - Worker: typeof InternalWorkerBinding.Worker; - getEnvMessagePort(): InternalMessagingBinding.MessagePort; - threadId: number; - isMainThread: boolean; - ownsProcessState: boolean; - resourceLimits?: Float64Array; - kMaxYoungGenerationSizeMb: number; - kMaxOldGenerationSizeMb: number; - kCodeRangeSizeMb: number; - kStackSizeMb: number; - kTotalResourceLimitCount: number; -}; +declare interface InternalBinding { + (binding: 'worker'): { + Worker: typeof InternalWorkerBinding.Worker; + getEnvMessagePort(): InternalMessagingBinding.MessagePort; + threadId: number; + isMainThread: boolean; + ownsProcessState: boolean; + resourceLimits?: Float64Array; + kMaxYoungGenerationSizeMb: number; + kMaxOldGenerationSizeMb: number; + kCodeRangeSizeMb: number; + kStackSizeMb: number; + kTotalResourceLimitCount: number; + } +}