diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-26 18:52:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 18:52:57 -0400 |
commit | ac4a5f74b8e56a360e0a0543a6fc45099e13b95a (patch) | |
tree | 463796fb830eae41fc039512bb1ce79919195735 /cli/tsc/dts/lib.esnext.object.d.ts | |
parent | 6b95c53e48a2622f4f2b6fdfa6c2c26dc30bbba4 (diff) |
feat: TypeScript 5.4 (#23086)
Fork PR: https://github.com/denoland/TypeScript/pull/10
Closes #23080
Diffstat (limited to 'cli/tsc/dts/lib.esnext.object.d.ts')
-rw-r--r-- | cli/tsc/dts/lib.esnext.object.d.ts | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/cli/tsc/dts/lib.esnext.object.d.ts b/cli/tsc/dts/lib.esnext.object.d.ts index 3440d8d0d..b0885ae0b 100644 --- a/cli/tsc/dts/lib.esnext.object.d.ts +++ b/cli/tsc/dts/lib.esnext.object.d.ts @@ -13,20 +13,17 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ + /// <reference no-default-lib="true"/> -// NOTE(iuioiua): taken from https://github.com/microsoft/TypeScript/issues/47171#issuecomment-1697373352 -// while we wait for these types to officially ship interface ObjectConstructor { - groupBy<Item, Key extends PropertyKey>( - items: Iterable<Item>, - keySelector: (item: Item, index: number) => Key, - ): Partial<Record<Key, Item[]>>; -} - -interface MapConstructor { - groupBy<Item, Key>( - items: Iterable<Item>, - keySelector: (item: Item, index: number) => Key, - ): Map<Key, Item[]>; + /** + * Groups members of an iterable according to the return value of the passed callback. + * @param items An iterable. + * @param keySelector A callback which will be invoked for each item in items. + */ + groupBy<K extends PropertyKey, T>( + items: Iterable<T>, + keySelector: (item: T, index: number) => K, + ): Partial<Record<K, T[]>>; } |