diff --git a/index.bs b/index.bs index cdb28d51..897d547b 100644 --- a/index.bs +++ b/index.bs @@ -1856,6 +1856,19 @@ as the [Promise integration](https://github.com/WebAssembly/js-promise-integrati is still under development as of today. +

Output an array of bytes with Uint8Array

+ +If an API returns a byte array, make it a {{Uint8Array}}, not an {{ArrayBuffer}}. + +`ArrayBuffer`s cannot be read from directly; +the developer would have to create a view such as a Uint8Array +to read data. +Providing a `Uint8Array` avoids that additional effort. + +If the bytes in the buffer have a natural intepretation +as one of the other TypedArray types, provide that instead. +For example, if the bytes represent Float32 values, use a {{Float32Array}}. +

Event Design

Use promises for one time events