feat(Vector)
This commit is contained in:
2
types/iterators/Bidirectional.d.ts
vendored
2
types/iterators/Bidirectional.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
import { ForwardIterator } from "./Forward";
|
||||
|
||||
export class BidirectionalIterator<T> extends ForwardIterator<T> {
|
||||
export interface BidirectionalIterator<T> extends ForwardIterator<T> {
|
||||
/**
|
||||
* decrements iterator, it doesn't make copy
|
||||
* @returns {this}
|
||||
|
||||
8
types/iterators/Forward.d.ts
vendored
8
types/iterators/Forward.d.ts
vendored
@ -1,10 +1,12 @@
|
||||
export class Item<T> {
|
||||
export interface Item<T> {
|
||||
value: T
|
||||
}
|
||||
|
||||
export class ForwardIterator<T> {
|
||||
export interface ForwardIterator<T> {
|
||||
clone(): ForwardIterator<T>;
|
||||
copy(rhs: ForwardIterator<T>): this;
|
||||
get value(): T;
|
||||
set value(value: T);
|
||||
deref(): Item<T>;
|
||||
eq(rhs: ForwardIterator<T>): boolean;
|
||||
/**
|
||||
@ -18,7 +20,5 @@ export class ForwardIterator<T> {
|
||||
* @returns {this}
|
||||
*/
|
||||
move(rhs: ForwardIterator<T>): this;
|
||||
get value(): T;
|
||||
set value(value: T);
|
||||
neq(rhs: ForwardIterator<T>): boolean;
|
||||
}
|
||||
|
||||
9
types/iterators/RandomAccess.d.ts
vendored
Normal file
9
types/iterators/RandomAccess.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { BidirectionalIterator } from "./Bidirectional";
|
||||
|
||||
export interface RandomAccessIterator<T> extends BidirectionalIterator<T> {
|
||||
sub(offset: number): this;
|
||||
add(offset: number): this;
|
||||
cmp(rhs: RandomAccessIterator<T>): number;
|
||||
get(idx: number): T;
|
||||
set(idx: number, value: T): T;
|
||||
}
|
||||
Reference in New Issue
Block a user