Type Alias Invariant<T>

Invariant<T>: ((input: T) => T)

Enforces type T to be in an invariant position. For example Invariant<Square> cannot be assigned to type Invariant<Polygon> or vice versa.

This should be used when an interface with type parameter T does not explicitly use T in an invariant position, but the interface implies inout T.

https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)

Type Parameters

  • T