feat(Vector)
This commit is contained in:
39
types/Vector.d.ts
vendored
Normal file
39
types/Vector.d.ts
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
import { RandomAccessIterator } from './iterators/RandomAccess';
|
||||
import { SequenceContainer } from './containers/Sequence';
|
||||
|
||||
export class Vector<T> extends SequenceContainer<T, VectorIterator<T>> {
|
||||
/**
|
||||
* empty vector
|
||||
*/
|
||||
constructor();
|
||||
/**
|
||||
* vector with n similar elements
|
||||
* @param value which will be inserted
|
||||
* @param n count of how many values will be inserted
|
||||
*/
|
||||
constructor(value: T, n?: number);
|
||||
/**
|
||||
* copies range of another vector
|
||||
* @param begin of another SequenceContainer<T>
|
||||
* @param end of another SequenceContainer<T>
|
||||
*/
|
||||
constructor(begin: ListIterator<T>, end: ListIterator<T>);
|
||||
|
||||
/**
|
||||
* @returns vector[idx]
|
||||
*/
|
||||
get(idx: number): T;
|
||||
/**
|
||||
* vector[idx] = value
|
||||
* @returns vector[idx]
|
||||
*/
|
||||
set(idx: number, value: T): T;
|
||||
/**
|
||||
* creates vector from array, string and other iterable object
|
||||
*/
|
||||
static from<T>(obj: Iterable<T>): Vector<T>;
|
||||
}
|
||||
|
||||
export class VectorIterator<T> extends RandomAccessIterator<T> {
|
||||
private constructor();
|
||||
}
|
||||
Reference in New Issue
Block a user