Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OverflowableInteger

This type is an adapter type around u64 and i64 as understood in AssemblyScript. The goal is for it to encapsulate how this gets represented "over the wire".

As of now we use GraphQL, which only gives us Int, or a 32 bit wide signed integer. This implementation will fallback to a string representation of the value if it would overflow the i32.

These types are intended only for that very purpose. As such they don't have any operator overloads or any other additional support than a constructor and a matching getter #value to retrieve the primitive type. We expect users to not rely on these adapter types for anything else than transferring data in and out of the AssemblyScript runtime.

Note: Values passed to this that are out of bounds for the given type T will result in undefined behaviour. For example, passing a negative number to OverflowableInteger.

Hierarchy

  • OverflowableInteger

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Protected Readonly _value

_value: Int

Protected Readonly valueOverflow

valueOverflow: string | null

Methods

toString

  • toString(): string
  • Returns string

value

  • value<T>(): T
  • Type parameters

    • T

    Returns T

Static build

Generated using TypeDoc