decode function
Implementation
Future<DecodeData> decode(Uint8List data, int orientation) async {
final JSObject decoded = await _decode(data.toJS, orientation.toJS).toDart;
final rgbaData = decoded.getProperty('data'.toJS) as JSArray<JSNumber>;
final durations = decoded.getProperty('durations'.toJS) as JSArray<JSNumber>;
return DecodeData(
data: Uint8List.fromList(rgbaData.toDart.map((e) => e.toDartInt).toList()),
durations: Uint32List.fromList(durations.toDart.map((e) => e.toDartInt).toList()),
width: (decoded.getProperty('width'.toJS) as JSNumber).toDartInt,
height: (decoded.getProperty('height'.toJS) as JSNumber).toDartInt,
);
}