Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Base Constructors

Base Properties

length: number

The number of nodes in the selection.

rootNode: TreeNodeRoot

The common root node of the elements in this selection.

Base Methods

  • Returns a constructor for this selection.

    Returns AnyConstructor<SelectionEvent>

  • Export the selection as an array of nodes. The inverse operation is of.

    Returns TreeNode[]

  • Exports the selection as an array of selections of one element.

    Returns SelectionEvent[]

  • as<N>(Adapter: AnyConstructor<N>): N
  • View this selection as a different type. This method can be used to extend functionality for non-standard Gedcom files.

    Type Parameters

    Parameters

    • Adapter: AnyConstructor<N>

      The class adapter

    Returns N

  • Returns a concatenation of two selections. The right hand side selection should be a subtype of the left hand side's. The resulting selection will be the same type as the left hand side's.

    Type Parameters

    Parameters

    • other: N

      The right hand side selection

    Returns SelectionEvent

  • Returns a concatenation of two selections. The right hand side selection should be a subtype of the left hand side's. The resulting selection will be the same type as the left hand side's, with the elements of the right hand side's first.

    Type Parameters

    Parameters

    • other: N

      The right hand side selection

    Returns SelectionEvent

  • Checks whether two selections are equal. Note that the strategy used here is reference equality, hence for this method to return true, the nodes must be the same references (and in the same order).

    Parameters

    Returns boolean

  • Filter nodes from the selection based on a predicate.

    Parameters

    • f: ((node: TreeNode) => boolean)

      The filtering predicate

    Returns SelectionEvent

  • Filter lifted nodes from the selection based on a predicate. The argument is a selection of one node.

    Parameters

    Returns SelectionEvent

  • get(tag?: null | string | string[], pointer?: null | string | string[]): SelectionAny
  • get<N>(tag: null | string | string[], pointer: null | string | string[], adapter: AnyConstructor<N>): N
  • Query the direct children of this node. It is possible to efficiently filter the results by tag and pointer. Leaving either or both of these parameter empty will result in a wildcard behavior (not filtering). In most cases this method is not useful as the functionality is already implemented in the subclasses through various more precise methods. Returns an array of children.

    Parameters

    • Optional tag: null | string | string[]

      Optionally filter the results by their Gedcom tag

    • Optional pointer: null | string | string[]

      Optionally filter the result by their pointer value

    Returns SelectionAny

  • Query the direct children of this node. It is possible to efficiently filter the results by tag and pointer. Leaving either or both of these parameter empty will result in a wildcard behavior (not filtering). In most cases this method is not useful as the functionality is already implemented in the subclasses through various more precise methods. Returns an array of children. Additionally, allows the specification of an adapter class.

    Type Parameters

    Parameters

    • tag: null | string | string[]

      Optionally filter the results by their Gedcom tag

    • pointer: null | string | string[]

      Optionally filter the result by their pointer value

    • adapter: AnyConstructor<N>

      The adapter class, see as

    Returns N

  • pointer(): (null | string)[]
  • Returns an array of TreeNode.pointer.

    Returns (null | string)[]

  • tag(): (null | string)[]
  • Returns an array of TreeNode.tag.

    Returns (null | string)[]

  • value(): (null | string)[]
  • Returns an array of TreeNode.value.

    Returns (null | string)[]

  • valueNonNull(): string[]
  • Calls value and filters out null values.

    Returns string[]

  • Create a selection from an array of nodes. It is highly recommended (but not required) for the nodes to be at the same logical level in the hierarchy. The inverse operation is array.

    Parameters

    • previous: SelectionAny

      The previous selection, required to inherit the reference to the root

    • nodes: TreeNode | TreeNode[]

      The nodes to be included in the selection

    Returns SelectionAny

  • Create a selection from an array of nodes. It is highly recommended (but not required) for the nodes to be at the same logical level in the hierarchy. The inverse operation is array.

    Type Parameters

    Parameters

    • previous: SelectionAny

      The previous selection, required to inherit the reference to the root

    • nodes: TreeNode | TreeNode[]

      The nodes to be included in the selection

    • Adapter: AnyConstructor<N>

      The adapter class, see as

    Returns N

Other Methods

  • valueAsHappened(): (null | boolean)[]

Generated using TypeDoc