UNPKG

gl2d

Version:

2D graphics package for WebGL

300 lines (299 loc) 9.89 kB
import { Struct } from "gulp-structify/struct"; import { StructBuffer } from "gulp-structify/buffer"; /** * Holds the three indices for a triangle. */ export declare class IndexTuple { static create(other: IndexTupleLike): IndexTuple; /** * The index of the first triangle vertex. */ first: number; /** * The index of the second triangle vertex. */ second: number; /** * The index of the third triangle vertex. */ third: number; /** * Holds the three indices for a triangle. */ constructor(first?: number, second?: number, third?: number); /** * Sets each component of this IndexTuple to that of the other IndexTuple. */ set(other: IndexTupleLike): void; /** * Sets each component of this IndexTuple. */ set$(first: number, second: number, third: number): void; /** * Sets each component of this IndexTuple to the specified scalar. */ setScalar(k: number): void; /** * Adds the other IndexTuple to this IndexTuple componentwise. */ add(other: IndexTupleLike): void; /** * Adds the specified values to this IndexTuple componentwise. */ add$(first: number, second: number, third: number): void; /** * Subtracts the other IndexTuple from this IndexTuple componentwise. */ subtract(other: IndexTupleLike): void; /** * Subtracts the specified values from this IndexTuple componentwise. */ subtract$(first: number, second: number, third: number): void; /** * Multiplies each component of this IndexTuple by the specified scalar. */ mulScalar(k: number): void; /** * Divides each component of this IndexTuple by the specified scalar. */ divScalar(k: number): void; /** * Checks if each component of this IndexTuple is exactly equal to that of the other IndexTuple. */ equals(other: IndexTupleLike): boolean; /** * Checks if each component of this IndexTuple is exactly equal to the specified scalar. */ equalsScalar(k: number): boolean; /** * Checks if each component of this IndexTuple is approximately equal to that of the other IndexTuple. */ epsilonEquals(other: IndexTupleLike, e: number): boolean; /** * Checks if each component of this IndexTuple is approximately equal to the specified scalar. */ epsilonEqualsScalar(k: number, e: number): boolean; /** * Returns a string representation of this IndexTuple. */ toString(): string; } /** * Holds the three indices for a triangle. */ export interface IndexTupleLike { /** * The index of the first triangle vertex. */ first: number; /** * The index of the second triangle vertex. */ second: number; /** * The index of the third triangle vertex. */ third: number; } /** * A IndexTuple backed by a Uint16Array. */ export declare class IndexTupleStruct extends Struct<Uint16Array> { static create(other: IndexTupleLike): IndexTupleStruct; static create$(first: number, second: number, third: number): IndexTupleStruct; /** * Sets each component of this IndexTuple to that of the other IndexTuple. */ set: (other: IndexTupleLike) => void; /** * Sets each component of this IndexTuple. */ set$: (first: number, second: number, third: number) => void; /** * Sets each component of this IndexTuple to the specified scalar. */ setScalar: (k: number) => void; /** * Adds the other IndexTuple to this IndexTuple componentwise. */ add: (other: IndexTupleLike) => void; /** * Adds the specified values to this IndexTuple componentwise. */ add$: (first: number, second: number, third: number) => void; /** * Subtracts the other IndexTuple from this IndexTuple componentwise. */ subtract: (other: IndexTupleLike) => void; /** * Subtracts the specified values from this IndexTuple componentwise. */ subtract$: (first: number, second: number, third: number) => void; /** * Multiplies each component of this IndexTuple by the specified scalar. */ mulScalar: (k: number) => void; /** * Divides each component of this IndexTuple by the specified scalar. */ divScalar: (k: number) => void; /** * Checks if each component of this IndexTuple is exactly equal to that of the other IndexTuple. */ equals: (other: IndexTupleLike) => boolean; /** * Checks if each component of this IndexTuple is exactly equal to the specified scalar. */ equalsScalar: (k: number) => boolean; /** * Checks if each component of this IndexTuple is approximately equal to that of the other IndexTuple. */ epsilonEquals: (other: IndexTupleLike, e: number) => boolean; /** * Checks if each component of this IndexTuple is approximately equal to the specified scalar. */ epsilonEqualsScalar: (k: number, e: number) => boolean; /** * Returns a string representation of this IndexTuple. */ toString: () => string; /** * Creates a IndexTuple struct backed by the specified data. */ constructor(data?: Uint16Array); /** * The index of the first triangle vertex. */ /** * The index of the first triangle vertex. */ first: number; /** * The index of the second triangle vertex. */ /** * The index of the second triangle vertex. */ second: number; /** * The index of the third triangle vertex. */ /** * The index of the third triangle vertex. */ third: number; } /** * A IndexTuple buffer backed by a Uint16Array. */ export declare class IndexTupleBuffer extends StructBuffer<Uint16Array> { /** * Creates an empty IndexTuple buffer with the specified IndexTuple capacity. */ static create(capacity: number): IndexTupleBuffer; /** * Sets each component of this IndexTuple to that of the other IndexTuple. */ set: (other: IndexTupleLike) => void; /** * Sets each component of this IndexTuple. */ set$: (first: number, second: number, third: number) => void; /** * Sets each component of this IndexTuple to the specified scalar. */ setScalar: (k: number) => void; /** * Adds the other IndexTuple to this IndexTuple componentwise. */ add: (other: IndexTupleLike) => void; /** * Adds the specified values to this IndexTuple componentwise. */ add$: (first: number, second: number, third: number) => void; /** * Subtracts the other IndexTuple from this IndexTuple componentwise. */ subtract: (other: IndexTupleLike) => void; /** * Subtracts the specified values from this IndexTuple componentwise. */ subtract$: (first: number, second: number, third: number) => void; /** * Multiplies each component of this IndexTuple by the specified scalar. */ mulScalar: (k: number) => void; /** * Divides each component of this IndexTuple by the specified scalar. */ divScalar: (k: number) => void; /** * Checks if each component of this IndexTuple is exactly equal to that of the other IndexTuple. */ equals: (other: IndexTupleLike) => boolean; /** * Checks if each component of this IndexTuple is exactly equal to the specified scalar. */ equalsScalar: (k: number) => boolean; /** * Checks if each component of this IndexTuple is approximately equal to that of the other IndexTuple. */ epsilonEquals: (other: IndexTupleLike, e: number) => boolean; /** * Checks if each component of this IndexTuple is approximately equal to the specified scalar. */ epsilonEqualsScalar: (k: number, e: number) => boolean; /** * Returns a string representation of this IndexTuple. */ toString: () => string; /** * The index of the first triangle vertex. */ /** * The index of the first triangle vertex. */ first: number; /** * The index of the second triangle vertex. */ /** * The index of the second triangle vertex. */ second: number; /** * The index of the third triangle vertex. */ /** * The index of the third triangle vertex. */ third: number; /** * Gets the number of properties in a IndexTuple, namely 3. */ structLength(): number; /** * Gets the components of the IndexTuple at the specified position of this buffer. */ aget(position: number, dst?: IndexTupleLike): IndexTupleLike; /** * Gets the components of the current IndexTuple, then moves to the next position of this buffer. */ rget(dst?: IndexTupleLike): IndexTupleLike; /** * Sets each component of the IndexTuple at the specified position to that of the src IndexTuple. */ aset(position: number, src: IndexTupleLike): void; /** * Sets each component of the IndexTuple at the specified position. */ aset$(position: number, first: number, second: number, third: number): void; /** * Sets each component of the current IndexTuple to that of the src IndexTuple, then moves to the next position of this buffer. */ rset(src: IndexTupleLike): void; /** * Sets each component of the current IndexTuple, then moves to the next position of this buffer. */ rset$(first: number, second: number, third: number): void; }