To get good behavior in typescript, your enums need to be 'const enum', otherwise it generates some really gross JS with runtime overhead.
}
// see src/mono/wasm/driver.c MARSHAL_TYPE_xxx and Runtime.cs MarshalType
-export enum MarshalType {
+export const enum MarshalType {
NULL = 0,
INT = 1,
FP64 = 2,
}
// see src/mono/wasm/driver.c MARSHAL_ERROR_xxx and Runtime.cs
-export enum MarshalError {
+export const enum MarshalError {
BUFFER_TOO_SMALL = 512,
NULL_CLASS_POINTER = 513,
NULL_TYPE_POINTER = 514,