Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IMutable<T>

Type parameters

  • T

Hierarchy

Index

Properties

value

value: T

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): string | number

__@toStringTag

  • __@toStringTag(): string

toJSON

  • toJSON(key: string): any | number | string | boolean | null
  • Converts the primitive into it's JSON representation

    Parameters

    • key: string

      Will be one of:

      • if this object is a property value, the property name
      • if it is in an array, the index in the array, as a string
      • an empty string if JSON.stringify() was directly called on this object

    Returns any | number | string | boolean | null

    the object to serialize with JSON.stringify

toString

  • toString(): string
  • Converts the primitive into it's string representation. Often has a unit value associated with it such as 125ms

    Returns string

valueOf

  • valueOf(): string | number
  • Primitives must implement the legacy valueOf interface. Usually just forwards to the newer Symbol.toPrimitive API

    Returns string | number