Options
All
  • Public
  • Public/Protected
  • All
Menu

Runtime representation of a supported Javascript atom type, such as string, number, boolean, Date, etc.

Type parameters

  • T

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    • aType: AtomType<T>

      the expected type for the returned value

    • Default value merge: maxValue = maxValue

      a function to merge multiple values into a single atom

    Returns JsAtomType

Properties

Readonly aType

aType: AtomType<T>

the expected type for the returned value

Readonly merge

merge: maxValue

a function to merge multiple values into a single atom

Static statics

statics: Map<PropertyType<any>, Map<undefined | (StringConstructor & {}) | (BooleanConstructor & {}) | (NumberConstructor & {}) | (DateConstructor & {}) | (Uint8ArrayConstructor & {}) | (ReferenceConstructor & {}) | (VocabReferenceConstructor & {}) | (SubjectConstructor & {}), JsType<any, unknown>>> = new Map<PropertyType<any>, Map<AtomType<any> | undefined, JsType<any>>>

Accessors

type

Methods

cast

  • Casts a property value to the given JavaScript type. This is a typesafe cast which will not perform type coercion e.g. strings to numbers.

    throws

    TypeError if the given value does not have the correct type

    Parameters

    Returns ValueConstructed<T>

toString

  • toString(): string
  • Returns string

Static for

  • Obtains a static, shared type representation for the given parameters.

    Type parameters

    • T

    • S

    Parameters

    • type: PropertyType<T>

      the atom type or container type

    • Optional subType: AtomType<S>

      the atom type, if type is a container (else ignored)

    Returns JsType<T, S>

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static property
  • Static method
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.9.0 Source code licensed MIT. Privacy policy