Readonly
customAn ordered list of ordered lists of custom sections in this module. The top-level list acts as a map from SpiderCustomSectionPosition to an ordered list of custom sections stored at that position. Use createCustomSection to add custom sections to this module and getCustomSections or getCustomSectionsAt to get sections from this list.
Readonly
dataAn ordered list of all the data in this module. Use createDataActive or createDataPassive to append to this list.
Readonly
elementsAn ordered list of all the elements in this module. Use createElementFuncIdxActive, createElementFuncIdxInactive, createElementExprActive or createElementFuncIdxActive to append to this list.
Readonly
exportsAn ordered list of all the exports in this module. Use exportFunction, exportGlobal, exportTable or exportMemory to append to this list.
Readonly
functionsAn ordered list of all the functions in this module. Use createFunction to append to this list.
Readonly
globalsAn ordered list of all the globals in this module. Use createGlobal to append to this list.
Readonly
importsAn ordered list of all the imports in this module. Use importFunction, importGlobal, importTable or importMemory to append to this list.
Readonly
memoriesAn ordered list of all the memories in this module. Use createMemory to append to this list.
A function to execute when this module is initialized, or null if no function is to be executed.
Readonly
tablesAn ordered list of all the tables in this module. Use createTable to append to this list.
Readonly
typesAn ordered list of types in this module. Use createType to append to this list.
Private
_createPrivate
_getCreates a new custom section and adds it to this module.
The name of the new custom section.
The buffer of bytes contained in the new section.
The location within the module to store the custom data. Defaults to the beginning.
The created custom data.
Creates a new active data element and adds it to this module.
The memory to copy the contents of the new data into.
An offset within the memory to copy the contents of the new data into. Either the value itself or an expression which returns the value.
The buffer of bytes contained in the new data.
The created data.
Creates a new passive data element and adds it to this module.
The buffer of bytes contained in the new data.
The created data.
Creates a new active element of the given reference type containing expressions and adds it to this module.
The table to copy the contents of the new element into.
An offset within the table to copy the contents of the new element into. Either the value itself or an expression which returns the value.
The type of reference contained in the new element.
The list of expressions contained in the new element.
The created element.
Creates a new passive or declaritive elementof the given reference type containing expressions and adds it to this module.
The type of reference contained in the new element.
The list of expressions contained in the new element.
True if the new element is declaritive, otherwise the new element is passive.
The created element.
Creates a new active funcref element containing function indices and adds it to this module.
The table to copy the contents of the new element into.
An offset within the table to copy the contents of the new element into. Either the value itself or an expression which returns the value.
The list of functions contained in the new element.
The created element.
Creates a new passive or declaritive funcref element containing function indices and adds it to this module.
The list of functions contained in the new element.
True if the new element is declaritive, otherwise the new element is passive.
The created element.
Creates a new function and adds it to this module.
Optional
type: SpiderTypeDesc | SpiderTypeDefinitionThe signature of this function. Either an existing SpiderTypeDefinition or a SpiderTypeDesc which describes a signature which will get created alongside the function.
An ordered list of the local variables to create this function we ith, empty by default.
An expression for the body of this function, creates a new empty expression by default.
The new function.
Creates a new global and adds it to this module.
The type of the value held by the new global.
True if the new global should be mutable.
The default value of the global or an expression which returns the default value of the global.
The created global
Creates a new memory and adds it to this module.
The minimum number of pages the new memory can have. 0 by default
Optional
maxSize: numberThe optional maximum number of pages the new memory can be grown to.
The created memory.
Creates a new table and adds it to this module.
The type of reference contained in the new table.
The minimum number of entries in the imported table.
Optional
maxSize: numberThe optional maximum number of entries the new table can be grown to.
The created table.
Creates a new function signature type with the given parameter and result types and adds it to this module.
An ordered list of the parameters of this type.
Rest
...results: SpiderValueType[]An ordered list of the results of this type.
The new type.
The name for this export, exposed to the outside world.
The function to export.
The created export entry.
The name for this export, exposed to the outside world.
The global to export.
The created export entry.
The name for this export, exposed to the outside world.
The memory to export.
The created export entry.
The name for this export, exposed to the outside world.
The table to export.
The created export entry.
A generator function which yields all the custom sections in this module.
Gets a list of the custom sections at located at position.
Import a function from an external module.
The name of the module to import the function from.
The name of the function within the module to import.
The signature of the imported function. Either an existing SpiderTypeDefinition or a SpiderTypeDesc which describes a signature which will get created alongside the import.
The created import entry.
Import a global from an external module.
The name of the module to import the global from.
The name of the global within the module to import.
The type of the value held by the imported global.
True if the imported global is mutable.
The created import entry.
Import a memory from an external module.
The name of the module to import the memory from.
The name of the memoery within the module to import.
The minimum number of pages the imported memory can have. 0 by default.
Optional
maxSize: numberThe optional maximum number of pages the imported memory can be grown to.
The created import entry.
Import a table from an external module.
The name of the module to import the table from.
The name of the table within the module to import.
The type of reference contained in the imported table.
The minimum number of entries in the imported table.
Optional
maxSize: numberThe optional maximum number of entries the imported table can be grown to.
The created import entry.
Generated using TypeDoc
An abstract representation of a WASM module and all of its contents.
Create using the createModule or readModule functions.
Write its contents to a WASM binary using writeModule.
Compile its contents to a WebAssembly.Module using compileModule.