// Interface exposed to emscripten's WebIDL Binder.
// http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html
// Draco version of typed arrays. The memory of these arrays is allocated on the
// emscripten heap.
interface DracoInt8Array {
  void DracoInt8Array();
  long GetValue(long index);
  long size();
};

[Prefix="draco::"]
interface KeyframeAnimation {
  void KeyframeAnimation();
  long num_frames();
};

interface AnimationBuilder {
  void AnimationBuilder();
  boolean SetTimestamps(KeyframeAnimation animation, long num_frames,
                       [Const] float[] timestamps);

  long AddKeyframes(KeyframeAnimation animation, long num_frames,
                    long num_components, [Const] float[] animation_data);
};

interface AnimationEncoder {
  void AnimationEncoder();

  void SetTimestampsQuantization(long quantization_bits);
  void SetKeyframesQuantization(long quantization_bits);

  long EncodeAnimationToDracoBuffer(KeyframeAnimation animation,
                                    DracoInt8Array encoded_data);
};
