Update declaration file

This commit is contained in:
David Payr
2024-12-29 01:26:26 +01:00
parent bffe0e60a6
commit b7d8c526da
15 changed files with 893 additions and 668 deletions
+12
View File
@@ -4,6 +4,7 @@ export function assert(x: unknown): asserts x {
}
}
/** @public */
export type Rotation = 0 | 90 | 180 | 270;
/** @public */
@@ -214,6 +215,17 @@ export const removeItem = <T>(arr: T[], item: T) => {
}
};
export const findLastIndex = <T>(arr: T[], predicate: (x: T) => boolean) => {
for (let i = arr.length - 1; i >= 0; i--) {
if (predicate(arr[i]!)) {
return i;
}
}
return -1;
};
/** @public */
export type AnyIterable<T> =
| Iterable<T>
| AsyncIterable<T>;