Options
All
  • Public
  • Public/Protected
  • All
Menu

Runtime representation of a supported Javascript container type, such as an Array or Set.

Type parameters

  • T

  • S

Hierarchy

  • JsType<T, S>
    • JsContainerType

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    • cType: ContainerType<T>

      the expected type for the returned value

    • Optional aType: AtomType<S>

      if type is Array or Set, the expected item type. If not provided, values in a multi-valued property will not be cast

    • Default value merge: maxValue = maxValue

      a function to merge multiple values into a single atom

    Returns JsContainerType

Properties

Optional Readonly aType

aType: AtomType<S>

if type is Array or Set, the expected item type. If not provided, values in a multi-valued property will not be cast

Readonly cType

cType: ContainerType<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

emptyValue

  • get emptyValue(): undefined | never[] | Set<unknown>
  • Returns undefined | never[] | Set<unknown>

type

  • get type(): [PropertyType<T>, undefined | (StringConstructor & {}) | (BooleanConstructor & {}) | (NumberConstructor & {}) | (DateConstructor & {}) | (Uint8ArrayConstructor & {}) | (ReferenceConstructor & {}) | (VocabReferenceConstructor & {}) | (SubjectConstructor & {})]
  • Returns [PropertyType<T>, undefined | (StringConstructor & {}) | (BooleanConstructor & {}) | (NumberConstructor & {}) | (DateConstructor & {}) | (Uint8ArrayConstructor & {}) | (ReferenceConstructor & {}) | (VocabReferenceConstructor & {}) | (SubjectConstructor & {})]

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, S>

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
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Protected method

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