Uint32Array.hx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. package js.lib;
  23. /**
  24. The `Uint32Array` typed array represents an array of 32-bit unsigned integers in the platform
  25. byte order. If control over byte order is needed, use `DataView` instead. The contents are
  26. initialized to `0`. Once established, you can reference elements in the array using the object's
  27. methods, or using standard array index syntax (that is, using bracket notation).
  28. Documentation [Uint32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  29. **/
  30. @:native("Uint32Array")
  31. extern class Uint32Array implements ArrayAccess<Int> {
  32. static inline var BYTES_PER_ELEMENT : Int = 4;
  33. @:pure
  34. static function of( items : haxe.extern.Rest<Array<Dynamic>> ) : Uint32Array;
  35. @:pure
  36. static function from( source : Array<Int>, ?mapFn : Int -> Int -> Int, ?thisArg : Dynamic ) : Uint32Array;
  37. @:native("BYTES_PER_ELEMENT")
  38. final BYTES_PER_ELEMENT_ : Int;
  39. final length : Int;
  40. final buffer : ArrayBuffer;
  41. final byteOffset : Int;
  42. final byteLength : Int;
  43. /** @throws DOMError */
  44. @:overload( function( length : Int ) : Void {} )
  45. @:overload( function( array : Uint32Array ) : Void {} )
  46. @:overload( function( array : Array<Int> ) : Void {} )
  47. function new( buffer : ArrayBuffer, ?byteOffset : Int, ?length : Int ) : Void;
  48. @:overload( function( array : Uint32Array, ?offset : Int ) : Void {} )
  49. function set( array : Array<Int>, ?offset : Int ) : Void;
  50. function copyWithin( target : Int, start : Int, ?end : Int ) : Uint32Array;
  51. function every( callback : Int -> Int -> Uint32Array -> Bool, ?thisArg : Dynamic ) : Bool;
  52. function fill( value : Int, ?start : Int, ?end : Int ) : Uint32Array;
  53. function filter( callbackfn : Int -> Int -> Uint32Array -> Dynamic, ?thisArg : Dynamic ) : Uint32Array;
  54. function find( predicate : Int -> Int -> Uint32Array -> Bool, ?thisArg : Dynamic ) : Dynamic;
  55. function findIndex( predicate : Int -> Int -> Uint32Array -> Bool, ?thisArg : Dynamic ) : Int;
  56. function forEach( callbackfn : Int -> Int -> Uint32Array -> Void, ?thisArg : Dynamic ) : Void;
  57. function indexOf( searchElement : Int, ?fromIndex : Int ) : Int;
  58. function join( ?separator : String ) : String;
  59. function lastIndexOf( searchElement : Int, ?fromIndex : Int ) : Int;
  60. function map( callbackfn : Int -> Int -> Uint32Array -> Int, ?thisArg : Dynamic ) : Uint32Array;
  61. @:overload( function( callbackfn : Int -> Int -> Int -> Uint32Array -> Int ) : Int {} )
  62. function reduce( callbackfn : Dynamic -> Int -> Int -> Uint32Array -> Dynamic, initialValue : Dynamic ) : Dynamic;
  63. @:overload( function( callbackfn : Int -> Int -> Int -> Uint32Array -> Int ) : Int {} )
  64. function reduceRight( callbackfn : Dynamic -> Int -> Int -> Uint32Array -> Dynamic, initialValue : Dynamic ) : Dynamic;
  65. function reverse() : Uint32Array;
  66. function slice( ?start : Int, ?end : Int ) : Uint32Array;
  67. function some( callbackfn : Int -> Int -> Uint32Array -> Bool, ?thisArg : Dynamic ) : Bool;
  68. function sort( ?compareFn : Int -> Int -> Int ) : Uint32Array;
  69. function subarray( begin : Int, ?end : Int ) : Uint32Array;
  70. }