Skip to content

Commit

Permalink
feat(vectors): add Vec2/3/4Like type aliases, update ReadonlyVec
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 28, 2019
1 parent 74e43ef commit 3d5cd61
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/vectors/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ArrayLikeIterable,
Fn,
Fn2,
Fn3,
Expand All @@ -7,16 +8,20 @@ import {
ICopy,
IEmpty,
IEqualsDelta,
ILength
ILength,
Tuple,
TypedArray
} from "@thi.ng/api";

export interface Vec extends Iterable<number>, ILength {
[id: number]: number;
}

export interface ReadonlyVec extends Iterable<number>, ILength {
readonly [id: number]: number;
}
export type ReadonlyVec = ArrayLikeIterable<number>;

export type Vec2Like = Tuple<number, 2> | TypedArray;
export type Vec3Like = Tuple<number, 3> | TypedArray;
export type Vec4Like = Tuple<number, 4> | TypedArray;

export interface StridedVec {
buf: Vec;
Expand Down

0 comments on commit 3d5cd61

Please sign in to comment.