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; - } }