ladybird/Libraries/LibWeb/WebIDL/Buffers.idl
Shannon Booth 97abc707c7 LibWeb/Bindings: Generate buffer typedefs as variants
Represent BufferSource and ArrayBufferView as ordinary IDL typedefs over
their underlying union types, instead of special casing in the IDL
generator. This allows the union conversion/return machinery handle
these types consistently with other typedefs, which removes buffer
specific paths from the IDL generator.

This necessitates changing the WebIDL::BufferSource and
WebIDL::ArrayBufferView classes as views over these variants. This
replaces the old GC backed BufferableObject wrapper structure and
provide convenience helpers to determine things such as the byte length,
byte offset, backing buffer, and typed-array APIs.
2026-05-30 11:22:08 +02:00

8 lines
407 B
Text

// https://webidl.spec.whatwg.org/#ArrayBufferView
typedef (Int8Array or Int16Array or Int32Array or
Uint8Array or Uint16Array or Uint32Array or Uint8ClampedArray or
BigInt64Array or BigUint64Array or
Float16Array or Float32Array or Float64Array or DataView) ArrayBufferView;
// https://webidl.spec.whatwg.org/#BufferSource
typedef (ArrayBufferView or ArrayBuffer) BufferSource;