feat(d.ts)

This commit is contained in:
2025-07-17 15:16:40 +03:00
parent 7ef36ff9fc
commit 01e2b30248
9 changed files with 582 additions and 34 deletions

9
types/iterators/Bidirectional.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
import { ForwardIterator } from "./Forward";
export class BidirectionalIterator<T> extends ForwardIterator<T> {
/**
* decrements iterator, it doesn't make copy
* @returns {this}
*/
dec(): this;
}

24
types/iterators/Forward.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
export class Item<T> {
value: T
}
export class ForwardIterator<T> {
clone(): ForwardIterator<T>;
copy(rhs: ForwardIterator<T>): this;
deref(): Item<T>;
eq(rhs: ForwardIterator<T>): boolean;
/**
* increments iterator, it doesn't make copy
* @returns {this}
*/
inc(): this;
/**
* move-semantics, here it just copies rhs into this
* @returns {this}
*/
move(rhs: ForwardIterator<T>): this;
get value(): T;
set value(value: T);
neq(rhs: ForwardIterator<T>): boolean;
}