Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for a reversible function.

const linearFunction: ReversibleFunction<number> = {
  forward: x => 2 * x + 3,
  backward: y => 0.5 * (y - 3);
}

linearFunction.forward(1); // => 5 linearFunction.backward(5); // => 1 linearFunction.backward(linearFunction.forward(Math.PI)); // => 3.141... linearFunction.forward(linearFunction.backward(Math.PI)); // => 3.141... `

@typeparam TParam Type of the function argument. @typeparam TParam Type of the function return value.

Type parameters

  • TParam

  • TReturn

Hierarchy

  • ReversibleFunction

Index

Methods

Methods

backward

  • backward(param: TReturn): TParam
  • Parameters

    • param: TReturn

    Returns TParam

forward

  • forward(param: TParam): TReturn
  • Parameters

    • param: TParam

    Returns TReturn

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc