Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/ChronoGraph/primitives/Calculation"

Index

Type aliases

CalculationContext

CalculationContext<YieldT>: (effect: YieldT) => any

This is a calculation context type. It is represented with a function, that receives some value (effect) and returns the result (effect processing results). Can be also thought as "effect handler".

When using generators-based calculation, there's no need to use this function directly - the syntax construct yield plays its role.

Type parameters

  • YieldT

Type declaration

    • (effect: YieldT): any
    • Parameters

      • effect: YieldT

      Returns any

CalculationIterator

CalculationIterator<ResultT, YieldT>: Generator<YieldT, ResultT, any>

Type of return value of the generator function.

Type parameters

  • ResultT

  • YieldT

Context

Context: typeof ContextSync | typeof ContextGen

Type, denoting the generic calculation context (both sync and generators).

Contexts

Contexts<ResultT, YieldT>: { [ContextGen]: CalculationIterator<ResultT, YieldT>; [ContextSync]: ResultT }

Type "picker". This is an object type, with 2 properties - ContextSync and ContextGen. Every property "translate" the generic arguments of the type, to different types.

This type allows generic typization of the identifiers's calculation function (a single type both for the synchronous and generator-based functions).

Type parameters

  • ResultT

  • YieldT

Type declaration

Variables

Const ContextGen

ContextGen: unique symbol = Symbol('ContextGen')

Symbol to denote the generator calculation context

Const ContextSync

ContextSync: unique symbol = Symbol('ContextSync')

Symbol to denote the synchronous calculation context

Generated using TypeDoc