structurae
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -12,3 +12,31 @@ // Type definitions for structurae | ||
interface GridOptions { | ||
rows: number; | ||
columns: number; | ||
pad?: any; | ||
} | ||
type Coordinates = [number, number] | ||
export declare class Grid { | ||
columns: number; | ||
rows: number; | ||
offset: number; | ||
pad: any; | ||
constructor(options?: GridOptions, data?: Collection); | ||
get(row: number, column: number): any; | ||
set(row: number, column: number, value: any): this; | ||
getCoordinates(index: number): Coordinates; | ||
toArrays(withPadding: boolean): any[][]; | ||
static getOffset(columns: number): number; | ||
static fromArrays(arrays: any[][], pad: any): Grid; | ||
} | ||
interface Constructor<T> { | ||
new (...args): T; | ||
} | ||
export declare function GridMixin<T extends Collection>(Base?: Constructor<T>): Constructor<T & Grid> | ||
type AnyNumber = number | bigint; | ||
@@ -15,0 +43,0 @@ type FieldName = number | string; |
@@ -371,3 +371,3 @@ /** | ||
this.size = totalSize; | ||
this.mask = two << ((isBigInt ? BigInt(totalSize) : totalSize) - two); | ||
this.mask = two << ((isBigInt ? BigInt(totalSize) : totalSize) - one); | ||
this.isBigInt = isBigInt; | ||
@@ -451,3 +451,3 @@ this.isSafe = totalSize <= MAX_SIZE; | ||
/** @type {AnyNumber} */ | ||
PackedInt.mask = 1073741824; | ||
PackedInt.mask = 2147483648; | ||
@@ -454,0 +454,0 @@ /** @type {Masks} */ |
/** | ||
* @typedef {function(a: *, b: *): number} Comparator | ||
* @name Comparator | ||
* @function | ||
* @param {*} a | ||
* @param {*} b | ||
* @returns {number} | ||
*/ | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "structurae", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Data structures for performance-sensitive modern JavaScript applications.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
52800
1333
8