Skip to content

Commit

Permalink
Remove custom type annotation for Array.prototype.findLast
Browse files Browse the repository at this point in the history
It is now buit-in since TypeScript v5.0 (microsoft/TypeScript#48829 (comment)).
  • Loading branch information
DaviDevMod committed May 7, 2023
1 parent 31a287c commit 762b6e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/pretty-wombats-switch.md
Original file line number Diff line number Diff line change
@@ -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).
5 changes: 0 additions & 5 deletions packages/focus-trap/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ declare global {
interface Document {
getElementById<T extends HTMLElement | SVGElement = HTMLElement>(elementId: string): T | null;
}

// Support for `Array.prototype.findLast` ships with v5.0: https://github.com/microsoft/TypeScript/issues/48829
interface Array<T> {
findLast(predicate: (element: T, index: number, array: T[]) => unknown, thisArg?: any): T | undefined;
}
}

0 comments on commit 762b6e6

Please sign in to comment.