blob: 6a3faaa92e85bfdd9172a782d3b20154d930ec81 [file] [log] [blame]
/*
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// https://www.khronos.org/registry/typedarray/specs/latest/#7
[
Constructor(unsigned long length),
Constructor(Uint32Array array),
Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
ConstructorCallWith=EnvironmentSettings,
RaisesException=Constructor
]
interface Uint32Array : ArrayBufferView {
const unsigned long BYTES_PER_ELEMENT = 4;
readonly attribute unsigned long length;
getter unsigned long get(unsigned long index);
setter void set(unsigned long index, unsigned long value);
// TODO: When arrays or sequences are supported, support them here.
// void set(sequence<long> array, optional unsigned long offset);
// Copy items into this array from source, starting at this[offset].
[RaisesException] void set(Uint32Array source, optional unsigned long offset);
// Return a new Uint32Array that is a view on top of this one.
// Contains this[start]..this[end]. end defaults to length if unspecified.
[CallWith=EnvironmentSettings] Uint32Array subarray(long start, optional long end);
};