1
0

improve typing of element finding utils

This commit is contained in:
2025-05-24 13:22:09 +02:00
parent 75219bc716
commit afa4c8a684
3 changed files with 50 additions and 53 deletions

View File

@@ -49,3 +49,13 @@ const _emptyIterableIterator = new class EmptyIterableIterator implements Iterab
export function emptyIterableIterator<T>(): IterableIterator<T> {
return _emptyIterableIterator;
}
type FindElementSuccess<T> = {
found: true;
element: T;
};
type FindElementFail = {
found: false;
reason?: number;
};
export type FindElementResult<T> = FindElementSuccess<T> | FindElementFail;