Type alias NoInfer<T>

NoInfer<T>: [T][T extends any
    ? 0
    : never]

Blocks inferences to the contained type. Polyfill for TypeScript's NoInfer utility type introduced in TypeScript 5.4.

This works by leveraging deferred conditional types - the compiler can't evaluate the conditional until it knows what T is, which prevents TypeScript from digging into the type to find inference candidates.

See:

Type Parameters

  • T

Generated using TypeDoc