Type alias IsFunction<T>

IsFunction<T>: IfExtends<T, UnknownFunction, true, false>

Type utility that checks if a given type T is a Function (function type accepting unknown arguments and returning unknown).

Type Parameters

  • T

    The type to check.

Returns

true if T is a Function, otherwise false. A Function is defined as a function type that accepts arguments of type unknown and returns a value of type unknown.

Example

IsFunction<() => void>; // true (matches Function)
IsFunction<(x: number) => string>; // true (matches Function)
IsFunction<string>; // false (string is not a function type)