twgl.js 5.4.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3692,7 +3692,25 @@ declare module primitives {
3692
3692
  /**
3693
3693
  * @typedef {(Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array)} TypedArray
3694
3694
  */
3695
+
3695
3696
  export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array;
3697
+
3698
+ export type AugmentedTypedArrayHelper = {
3699
+ numComponents: number;
3700
+ readonly numElements: number;
3701
+ /**
3702
+ * Push elements into typed array
3703
+ */
3704
+ push(...elements: (number | TypedArray | number[])[]): void;
3705
+ /**
3706
+ * Reset push cursor
3707
+ */
3708
+ reset(index?: number): void;
3709
+ };
3710
+
3711
+ export type AugmentedTypedArray<T extends TypedArray> = T & AugmentedTypedArrayHelper
3712
+
3713
+
3696
3714
  /**
3697
3715
  * creates a typed array with a `push` function attached
3698
3716
  * so that you can easily *push* values.
@@ -3715,7 +3733,9 @@ declare module primitives {
3715
3733
  * @return {ArrayBufferView} A typed array.
3716
3734
  * @memberOf module:twgl/primitives
3717
3735
  */
3718
- export function createAugmentedTypedArray(numComponents: number, numElements: number, opt_type: Function): ArrayBufferView;
3736
+ export function createAugmentedTypedArray<T extends TypedArrayConstructor>(numComponents: number, numElements: number, type: T): AugmentedTypedArray<InstanceType<T>>;
3737
+ export function createAugmentedTypedArray<T extends Float32Array>(numComponents: number, numElements: number): AugmentedTypedArray<Float32Array>;
3738
+
3719
3739
  /**
3720
3740
  * Given indexed vertices creates a new set of vertices un-indexed by expanding the indexed vertices.
3721
3741
  * @param {Object.<string, TypedArray>} vertices The indexed vertices to deindex
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @license twgl.js 5.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
2
+ * @license twgl.js 5.4.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
3
3
  * Available via the MIT license.
4
4
  * see: http://github.com/greggman/twgl.js for details
5
5
  */
@@ -1,4 +1,4 @@
1
- /* @license twgl.js 5.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
1
+ /* @license twgl.js 5.4.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
2
2
  Available via the MIT license.
3
3
  see: http://github.com/greggman/twgl.js for details */
4
4
  /*
package/dist/5.x/twgl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @license twgl.js 5.4.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
2
+ * @license twgl.js 5.4.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
3
3
  * Available via the MIT license.
4
4
  * see: http://github.com/greggman/twgl.js for details
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twgl.js",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "description": "A Tiny WebGL helper library",
5
5
  "main": "dist/5.x/twgl-full.js",
6
6
  "types": "dist/5.x/twgl-full.d.ts",