diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 6178b2723f13e..857ac31b64fd8 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1326,6 +1326,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 c5e02c71c1cf2..55bcfedbd9f1a 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4393,6 +4393,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 2dfba3ca71ae6..9c6a76ade8fce 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 @@ -78914,6 +78918,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 4486b89052c7a..ea3a8a7cfb548 100644 --- a/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js +++ b/tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js @@ -808,6 +808,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 9e804a3500ecc..538f899acdf00 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",