From 762b6e62a76f5b988c236d23a3089a884c2e5704 Mon Sep 17 00:00:00 2001 From: Davide Date: Sun, 7 May 2023 23:07:19 +0100 Subject: [PATCH] Remove custom type annotation for `Array.prototype.findLast` It is now buit-in since TypeScript v5.0 (https://github.com/microsoft/TypeScript/issues/48829#issuecomment-1442649966). --- .changeset/pretty-wombats-switch.md | 7 +++++++ packages/focus-trap/src/global.d.ts | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .changeset/pretty-wombats-switch.md diff --git a/.changeset/pretty-wombats-switch.md b/.changeset/pretty-wombats-switch.md new file mode 100644 index 00000000..143e16d2 --- /dev/null +++ b/.changeset/pretty-wombats-switch.md @@ -0,0 +1,7 @@ +--- +'@davidevmod/focus-trap': patch +--- + +Remove custom type annotation for `Array.prototype.findLast`. + +It is now buit-in since TypeScript v5.0 (https://github.com/microsoft/TypeScript/issues/48829#issuecomment-1442649966). diff --git a/packages/focus-trap/src/global.d.ts b/packages/focus-trap/src/global.d.ts index 754cb22e..bc690aaf 100644 --- a/packages/focus-trap/src/global.d.ts +++ b/packages/focus-trap/src/global.d.ts @@ -5,9 +5,4 @@ declare global { interface Document { getElementById(elementId: string): T | null; } - - // Support for `Array.prototype.findLast` ships with v5.0: https://github.com/microsoft/TypeScript/issues/48829 - interface Array { - findLast(predicate: (element: T, index: number, array: T[]) => unknown, thisArg?: any): T | undefined; - } }