diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index db6127dc106e0..09fe5784d7179 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1323,6 +1323,8 @@ export namespace Completion { interfaceEntry("Float32ArrayConstructor"), varEntry("Float64Array"), interfaceEntry("Float64ArrayConstructor"), + interfaceEntry("IntegerTypedArrayTypes"), + typeEntry("IntegerTypedArray"), moduleEntry("Intl"), typeEntry("WeakKey"), interfaceEntry("WeakKeyTypes"), diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index f1f3282306136..f5d6d5e8d2fda 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -706,6 +706,11 @@ interface BigUint64ArrayConstructor { } declare var BigUint64Array: BigUint64ArrayConstructor; +interface IntegerTypedArrayTypes { + BigInt64Array: BigInt64Array; + BigUint64Array: BigUint64Array; +} + interface DataView { /** * Gets the BigInt64 value at the specified byte offset from the start of the view. There is diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 33f1a983208f9..cae2b74947c7e 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4389,6 +4389,21 @@ interface Float64ArrayConstructor { } declare var Float64Array: Float64ArrayConstructor; +/** + * Stores types to be used with crypto.getRandomValues + */ +interface IntegerTypedArrayTypes { + Int8Array: Int8Array; + Int16Array: Int16Array; + Int32Array: Int32Array; + Uint8Array: Uint8Array; + Uint16Array: Uint16Array; + Uint32Array: Uint32Array; + Uint8ClampedArray: Uint8ClampedArray; +} + +type IntegerTypedArray = IntegerTypedArrayTypes[keyof IntegerTypedArrayTypes]; + ///////////////////////////// /// ECMAScript Internationalization API ///////////////////////////// diff --git a/tests/baselines/reference/completionsCommitCharactersGlobal.baseline b/tests/baselines/reference/completionsCommitCharactersGlobal.baseline index 582d3363da492..5abe1cede5cf2 100644 --- a/tests/baselines/reference/completionsCommitCharactersGlobal.baseline +++ b/tests/baselines/reference/completionsCommitCharactersGlobal.baseline @@ -2666,6 +2666,8 @@ // | interface Int32Array // | var Int32Array: Int32ArrayConstructor // | interface Int32ArrayConstructor +// | type IntegerTypedArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array<...> | Uint32Array<...> | Uint8ClampedArray<...> +// | interface IntegerTypedArrayTypes // | namespace Intl // | interface JSON // | var JSON: JSON @@ -2846,6 +2848,8 @@ // | interface Int32Array // | var Int32Array: Int32ArrayConstructor // | interface Int32ArrayConstructor +// | type IntegerTypedArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array<...> | Uint32Array<...> | Uint8ClampedArray<...> +// | interface IntegerTypedArrayTypes // | namespace Intl // | interface JSON // | var JSON: JSON @@ -78922,6 +78926,249 @@ ], "documentation": [] }, + { + "name": "IntegerTypedArray", + "kind": "type", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IntegerTypedArray", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "IntegerTypedArrayTypes", + "kind": "interface", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IntegerTypedArrayTypes", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Stores types to be used with crypto.getRandomValues", + "kind": "text" + } + ] + }, { "name": "Intl", "kind": "module", @@ -88393,6 +88640,249 @@ ], "documentation": [] }, + { + "name": "IntegerTypedArray", + "kind": "type", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IntegerTypedArray", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "...", + "kind": "text" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "IntegerTypedArrayTypes", + "kind": "interface", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IntegerTypedArrayTypes", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Stores types to be used with crypto.getRandomValues", + "kind": "text" + } + ] + }, { "name": "Intl", "kind": "module", diff --git a/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js b/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js index 5a4e9f3db3c0d..24e26c7ca537f 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js +++ b/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js @@ -844,6 +844,18 @@ Info seq [hh:mm:ss:mss] response: "kindModifiers": "declare", "sortText": "15" }, + { + "name": "IntegerTypedArray", + "kind": "type", + "kindModifiers": "declare", + "sortText": "15" + }, + { + "name": "IntegerTypedArrayTypes", + "kind": "interface", + "kindModifiers": "declare", + "sortText": "15" + }, { "name": "Intl", "kind": "module", diff --git a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_revertUpdatedFile.js b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_revertUpdatedFile.js index f0d22e519baee..b3b784907e364 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_revertUpdatedFile.js +++ b/tests/baselines/reference/tsserver/fourslashServer/pasteEdits_revertUpdatedFile.js @@ -796,6 +796,18 @@ Info seq [hh:mm:ss:mss] response: "kindModifiers": "declare", "sortText": "15" }, + { + "name": "IntegerTypedArray", + "kind": "type", + "kindModifiers": "declare", + "sortText": "15" + }, + { + "name": "IntegerTypedArrayTypes", + "kind": "interface", + "kindModifiers": "declare", + "sortText": "15" + }, { "name": "Intl", "kind": "module",