Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Item

Implements

Index

Accessors

key

  • get key(): Value
  • Returns the key component of this Item, if this Item is a <a href="_swim_structure.field.html">Field</a>; otherwise returns <a href="_swim_structure.absent.html">Absent</a> if thisItemis aValue`.

    Returns Value

length

  • get length(): number

Methods

Abstract alias

  • alias(): void

Abstract and

  • and(that: Item): Item

appended

Abstract bitwiseAnd

Abstract bitwiseNot

  • bitwiseNot(): Item

Abstract bitwiseOr

Abstract bitwiseXor

Abstract body

  • body(): Value

Abstract booleanValue

  • booleanValue(): boolean | undefined
  • booleanValue<T>(orElse: T): boolean | T
  • Converts this Item into a boolean value, if possible; otherwise returns undefined if this Item can't be converted into a boolean value.

    Returns boolean | undefined

  • Converts this Item into a boolean value, if possible; otherwise returns orElse if this Item can't be converted into a boolean value.

    Type parameters

    • T

    Parameters

    • orElse: T

    Returns boolean | T

Abstract branch

  • branch(): Item

cast

  • cast<T>(form: Form<T, unknown>): T | undefined
  • cast<T, E>(form: Form<T, unknown>, orElse: E): T | E

Abstract clone

  • clone(): Item

coerce

  • coerce<T>(form: Form<T, unknown>): T
  • coerce<T, E>(form: Form<T, unknown>, orElse: E): T | E

Abstract commit

  • commit(): this

Abstract compareTo

  • compareTo(that: Item): 0 | 1 | -1

concat

Abstract conditional

  • conditional(thenTerm: Item, elseTerm: Item): Item

Abstract debug

Abstract deleted

display

  • display(output: Output): void

Abstract divide

eq

Abstract equals

  • equals(that: unknown): boolean

evaluate

filter

Abstract flattened

  • flattened(): Value
  • Returns the sole member of this Item, if this Item is a Record with exactly one member, and its member is a Value; returns Extant if this Item is an empty Record; returns Absent if this Item is a Field; otherwise returns this if this Item is a Record with more than one member, or if this Item is a non-Record Value.

    Used to convert a unary Record into its member Value. Facilitates writing code that treats a unary Record equivalently to a bare Value.

    Returns Value

forEach

  • forEach<T, S>(callback: function, thisArg?: S): T | undefined
  • Type parameters

    • T

    • S

    Parameters

    • callback: function
        • (this: S, item: Item, index: number): T | void
        • Parameters

          • this: S
          • item: Item
          • index: number

          Returns T | void

    • Optional thisArg: S

    Returns T | undefined

ge

Abstract get

Abstract getAttr

Abstract getField

Abstract getItem

  • getItem(index: AnyNum): Item
  • Returns the member of this Item at the given index, if this Item is a Record, and the index is greater than or equal to zero, and less than the length of the Record; otherwise returns Absent if this Item is not a Record, or if this Item is a Record, but the index is out of bounds.

    Parameters

    Returns Item

Abstract getSlot

gt

Abstract has

  • Returns true if this Item is a Record that has a Field member with a key that is equal to the given key; otherwise returns false if this Item is not a Record, or if this Item is a Record, but has no Field member with a key equal to the given key.

    Parameters

    Returns boolean

Abstract hashCode

  • hashCode(): number

Abstract head

  • head(): Item

Abstract header

  • header(tag: string): Value
  • Returns the value of the first member of this Item, if this Item is a Record, and its first member is an Attr whose key string is equal to tag; otherwise returns Absent if this Item is not a Record, or if this Item is a Record whose first member is not an Attr, or if this Item is a Record whose first member is an Attr whose key does not equal the tag.

    Used to conditionally get the value of the head Attr of a structure, if and only if the key string of the head Attr is equal to the tag. Can be used to check if a structure might conform to a nominal type named tag, while simultaneously getting the value of the tag attribute.

    Parameters

    • tag: string

    Returns Value

Abstract headers

  • headers(tag: string): Record | undefined
  • Returns the unflattened header of this Item, if this Item is a Record, and its first member is an Attr whose key string is equal to tag; otherwise returns undefined.

    The headers of the tag attribute of a structure are like the attributes of an XML element tag; through unlike an XML element, tag attribute headers are not limited to string keys and values.

    Parameters

    • tag: string

    Returns Record | undefined

Abstract inverse

  • inverse(): Item

invoke

  • invoke(args: Value): Item

Abstract isAliased

  • isAliased(): boolean

Abstract isConstant

  • isConstant(): boolean

Abstract isDefined

  • isDefined(): boolean

Abstract isDistinct

  • isDistinct(): boolean

Abstract isMutable

  • isMutable(): boolean

iterator

Abstract keyEquals

  • keyEquals(key: unknown): boolean

Abstract lambda

  • lambda(template: Value): Value

le

lt

max

  • max(that: Item): Item

min

  • min(that: Item): Item

Abstract minus

Abstract modulo

ne

Abstract negative

  • negative(): Item

Abstract not

  • not(): Item

Abstract numberValue

  • numberValue(): number | undefined
  • numberValue<T>(orElse: T): number | T
  • Converts this Item into a number value, if possible; otherwise returns undefined if this Item can't be converted into a number value.

    Returns number | undefined

  • Converts this Item into a number value, if possible; otherwise returns orElse if this Item can't be converted into a number value.

    Type parameters

    • T

    Parameters

    • orElse: T

    Returns number | T

Abstract or

  • or(that: Item): Item

Abstract plus

Abstract positive

  • positive(): Item

prepended

Abstract stringValue

  • stringValue(): string | undefined
  • stringValue<T>(orElse: T): string | T
  • Converts this Item into a string value, if possible; otherwise returns undefined if this Item can't be converted into a string value.

    Returns string | undefined

  • Converts this Item into a string value, if possible; otherwise returns orElse if this Item can't be converted into a string value.

    Type parameters

    • T

    Parameters

    • orElse: T

    Returns string | T

substitute

Abstract tag

  • tag(): string | undefined
  • Returns the key string of the first member of this Item, if this Item is a Record, and its first member is an Attr; otherwise returns undefined if this Item is not a Record, or if this Item is a Record whose first member is not an Attr.

    Used to concisely get the name of the discriminating attribute of a structure. The tag can be used to discern the nominal type of a polymorphic structure, similar to an XML element tag.

    Returns string | undefined

Abstract tail

Abstract target

  • target(): Value
  • Returns the flattened members of this Item after all attributes have been removed, if this Item is a Record; otherwise returns this if this Item is a non-Record Value, or returns the value component if this Item is a Field.

    Used to concisely get the scalar value of an attributed structure. An attributed structure is a Record with one or more attributes that modify one or more other members.

    Returns Value

Abstract times

Abstract toAny

toString

  • toString(): string

Abstract toValue

  • toValue(): Value

Abstract typeOrder

  • typeOrder(): number
  • Returns the heterogeneous sort order of this Item. Used to impose a total order on the set of all items. When comparing two items of different types, the items order according to their typeOrder}.

    Returns number

Abstract unflattened

updated

updatedAttr

updatedSlot

Static absent

  • absent(): Item

Static empty

  • empty(): Item

Static extant

  • extant(): Item

Static fromAny

Static globalScope

  • globalScope(): Item