Binaryen.TS
    Preparing search index...

    Class TypeBuilder

    Index

    Constructors

    Methods

    • Resolve any and all recursive types in the TypeBuilder and return their finalized forms.

      Returns number[]

      list of finalized heap types in the builder

    • Create a recursive group.

      Parameters

      • index: number

        index in the builder to create the group

      • length: number

        number of types in the group

      Returns void

    • Retrieve a heap type from the builder, before disposal.

      Parameters

      • index: number

        index of the type to get

      Returns number

      the heap type at the given index

    • Generate a refence type from the given temporary heap type.

      Parameters

      • heapType: number

        the heap type in the type builder to use

      • nullable: boolean

        is the reference type nullable?

      Returns number

      the reference type

    • Retrieve a tuple type.

      Parameters

      • types: readonly number[]

        types in the tuple

      Returns number

      the tuple type

    • Grow the builder by the given number of types.

      Parameters

      • count: number

        the number of slots to add

      Returns void

    • Add an array type.

      Parameters

      • index: number

        index of the type to add

      • elementType: number

        type of element in the array

      • elementPackedType: number

        packed type of elements

      • elementMutable: boolean

        are array entries mutable?

      Returns void

    • Declare a type as “open”, i.e., not “final” (it may be extended/subtyped).

      Parameters

      • index: number

        the index of the type to set

      Returns void

    • Add a function signature type

      Parameters

      • index: number

        index of the type to add

      • paramTypes: number

        function’s parameter types, as a multi-value type

      • resultTypes: number

        function’s result types, as a multi-value type

      Returns void

    • Add a struct type.

      Parameters

      • index: number

        index of the type to add

      • fields: readonly { mutable: boolean; packedType: number; type: number }[]

        array of fields in the struct

      Returns void

    • Declare a type as a subtype of another.

      Parameters

      • index: number

        the index of the type to set

      • superType: number

        the supertype

      Returns void