enum AddressType {
    "i32",
    "i64"
};

typedef any AddressValue;

enum TableKind {
    "externref",
    "anyfunc"
};

dictionary TableDescriptor {
    required TableKind element;
    required AddressValue initial;
    AddressValue maximum;
    AddressType address;
};

// https://webassembly.github.io/spec/js-api/#tables
[LegacyNamespace=WebAssembly, Exposed=*]
interface Table {
    constructor(TableDescriptor descriptor, optional any value);

    AddressValue grow(AddressValue delta, optional any value);

    any get(AddressValue index);
    undefined set(AddressValue index, optional any value);

    readonly attribute AddressValue length;
};
