Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MultiFn8O<A, B, C, D, E, F, G, H, I, T>

Type parameters

  • A

  • B

  • C

  • D

  • E

  • F

  • G

  • H

  • I

  • T

Hierarchy

Callable

  • MultiFn8O(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H, i?: I): T

Index

Methods

add

  • add(id: PropertyKey, impl: Implementation8O<A, B, C, D, E, F, G, H, I, T>): boolean
  • Registers implementation for dispatch value id. Returns true, if successful. Returns false if an implementation already exists (and does nothing in this case).

    Parameters

    • id: PropertyKey

      implementation ID (dispatch value)

    • impl: Implementation8O<A, B, C, D, E, F, G, H, I, T>

      implementation

    Returns boolean

addAll

  • addAll(impls: IObjectOf<Implementation8O<A, B, C, D, E, F, G, H, I, T>>): boolean
  • Takes an object of dispatch values and their implementations and calls .add() for each KV pair. Returns true, if all impls were added successfully. Note: Only numbers or strings are accepted as dispatch values here.

    Parameters

    • impls: IObjectOf<Implementation8O<A, B, C, D, E, F, G, H, I, T>>

      object of implementations

    Returns boolean

ancestors

  • ancestors(id: PropertyKey): Set<PropertyKey>

callable

  • callable(...args: any[]): boolean
  • Returns true, if the function is callable (has a valid implementation) for given arguments.

    Parameters

    • Rest ...args: any[]

      arguments to find impl for

    Returns boolean

dependencies

  • dependencies(): IterableIterator<Pair<PropertyKey, undefined | PropertyKey>>
  • Returns iterator of all known dispatch values and their dependencies in the hierarchy of dispatch values. Each dependency is encoded as [value, parent-value?]. If parent-value is undefined, the dispatch value has no parent.

    Returns IterableIterator<Pair<PropertyKey, undefined | PropertyKey>>

impls

  • impls(): Set<PropertyKey>

isa

  • isa(id: PropertyKey, parent: PropertyKey): boolean
  • Updates dispatch hierarchy by declaring dispatch value id to delegate to parent's implementation. I.e. in terms of dispatch logic, id is considered the same as `parent.

    Parameters

    • id: PropertyKey

      implementation ID

    • parent: PropertyKey

      -parent implementation ID

    Returns boolean

parents

  • parents(id: PropertyKey): Set<PropertyKey>
  • Returns a set of immediate parent dispatch values for given dispatch value id.

    Parameters

    • id: PropertyKey

      implementation ID

    Returns Set<PropertyKey>

rels

  • rels(): IObjectOf<Set<PropertyKey>>
  • Returns all known dispatch relationships. This is an object with all registered dispatch values as keys, each with a set of parent dispatch values.

    Returns IObjectOf<Set<PropertyKey>>

remove

  • remove(id: PropertyKey): boolean

Generated using TypeDoc