Type representing a given kind of Function. Defaults to a "top type" that is assignable to any function, but cannot be called without type assertions.
Function
A tuple containing the arguments accepted by the function; defaults to never to render it uncallable without type assertions
never
The return type of the function; defaults to unknown to make the return value unusable without type assertions
unknown
type MyCallback = AnyFn<[amount: number, message: string], void>;expectTypeOf<MyCallback>().toEqualTypeOf<(amount: number, message: string) => void>(); Copy
type MyCallback = AnyFn<[amount: number, message: string], void>;expectTypeOf<MyCallback>().toEqualTypeOf<(amount: number, message: string) => void>();
Type representing a given kind of
Function.Defaults to a "top type" that is assignable to any function, but cannot be called without type assertions.