Creates new, empty module
Empty, initialized module.
Converts a signed LEB128 number to a JavaScript number, returns the number and the updated buffer index
Byte array for encoded values.
Where we read the value
The integer value at buffer[index] along with the end index + 1.
Converts an unsigned LEB128 number to a JavaScript number, along with the new end index
Byte array for encoded values.
Where we read the value
The integer value at buffer[index] along with the end index + 1.
Gets size of code section, excluding the standard section preamble
code section.
Size of code section in bytes
Gets size of custom sections, excluding the standard section preamble
array of custom sections.
Size of custom section in bytes
Gets size of data count section, excluding the standard section preamble
Size of data count section in bytes
Gets size of data section, excluding the standard section preamble
data section.
Size of data section in bytes
Gets size of element section, excluding the standard section preamble
element section.
Size of element section in bytes
Gets size of export section, excluding the standard section preamble
export section.
Size of export section in bytes
Gets size of function section, excluding the standard section preamble
function section.
Size of function section in bytes
Gets size of global section, excluding the standard section preamble
global section.
Size of global section in bytes
Gets size of import section, excluding the standard section preamble
Import section.
Size of import section in bytes
Gets the size of a number if it were to be encoded in signed LEB128
Number not encoded.
Width of the encoded number in bytes.
Gets the size of a number if it were to be encoded in unsigned LEB128
Number not encoded.
Width of the encoded number in bytes.
Gets size of memory section, excluding the standard section preamble
memory section.
Size of memory section in bytes
Gets size of start section, excluding the standard section preamble
start section.
Size of start section in bytes
Gets size of table section, excluding the standard section preamble
table section.
Size of table section in bytes
Gets size of type section, excluding the standard section preamble
Types section.
Size of types section in bytes
Converts a number n to signed LEB128
Must be an integer.
Buffer to write into
Start index for writing
End index for encoder.
Converts a number n to unsigned LEB128
Must be an integer.
Buffer to write into
Start index for writing
End index for encoder.
Generated using TypeDoc
Takes in a module and adds a function to it.
Note: Once a function is added to a module, you cannot reuse it. This is to prevent users from adding it to a module then editing the function further and wondering why the changes are not showing up.
If a name is provided, we generate an export with that name