(type...)
Declares how a function should look, what parameters and return data types it needs to use.
It is primarily used with function references, tables, and the call_indirect
instruction.
Syntax
(type $label
(func (param...) (result...))
)
Parameters
$label
The label that is used to link to the function type information.
Examples
(type $functionType
(func (param i32) (result i32))
)
(func $add1 (type $functionType)
local.get 0
i32.const 1
i32.add
)
(type $callbackFunctionType
(func (param i32 i32) (result i32))
)