-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvector.d.ts
More file actions
39 lines (39 loc) · 1.6 KB
/
vector.d.ts
File metadata and controls
39 lines (39 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Data } from './data';
import { DataType } from './type';
import { Chunked } from './vector/chunked';
/** @ignore */
export interface Clonable<R extends Vector> {
clone(...args: any[]): R;
}
/** @ignore */
export interface Sliceable<R extends Vector> {
slice(begin?: number, end?: number): R;
}
/** @ignore */
export interface Applicative<T extends DataType, R extends Chunked> {
concat(...others: Vector<T>[]): R;
readonly [Symbol.isConcatSpreadable]: boolean;
}
export interface AbstractVector<T extends DataType = any> extends Clonable<Vector<T>>, Sliceable<Vector<T>>, Applicative<T, Chunked<T>> {
readonly TType: T['TType'];
readonly TArray: T['TArray'];
readonly TValue: T['TValue'];
}
export declare abstract class AbstractVector<T extends DataType = any> implements Iterable<T['TValue'] | null> {
abstract readonly data: Data<T>;
abstract readonly type: T;
abstract readonly typeId: T['TType'];
abstract readonly length: number;
abstract readonly stride: number;
abstract readonly nullCount: number;
abstract readonly numChildren: number;
abstract readonly ArrayType: T['ArrayType'];
abstract isValid(index: number): boolean;
abstract get(index: number): T['TValue'] | null;
abstract set(index: number, value: T['TValue'] | null): void;
abstract indexOf(value: T['TValue'] | null, fromIndex?: number): number;
abstract [Symbol.iterator](): IterableIterator<T['TValue'] | null>;
abstract toArray(): T['TArray'];
abstract getChildAt<R extends DataType = any>(index: number): Vector<R> | null;
}
export { AbstractVector as Vector };