Binaryen.TS - v0.3.0
    Preparing search index...

    Class TypeBuilder

    Index
    • Parameters

      • size: number = 0

      Returns TypeBuilder

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

      Returns HeapType[]

      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

    • Returns number

      the number of types in the builder

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

      Parameters

      • index: number

        index of the type to get

      Returns HeapType

      the heap type at the given index

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

      Parameters

      • heapType: HeapType

        the heap type in the type builder to use

      • nullable: boolean

        is the reference type nullable?

      Returns Type

      the reference type

    • Retrieve a tuple type.

      Parameters

      • types: readonly Type[]

        types in the tuple

      Returns Type

      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: Type

        type of element in the array

      • elementPackedType: PackedType

        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: Type

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

      • resultTypes: Type

        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: PackedType; type: Type }[]

        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: HeapType

        the supertype

      Returns void