PokéRogue
    Preparing search index...

    Type Alias AnyFn<Args, Return>

    AnyFn: (...args: Args) => Return

    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.

    Type Parameters

    • Args extends readonly unknown[] = never

      A tuple containing the arguments accepted by the function; defaults to never to render it uncallable without type assertions

    • Return = unknown

      The return type of the function; defaults to unknown to make the return value unusable without type assertions

    Type Declaration

    type MyCallback = AnyFn<[amount: number, message: string], void>;
    expectTypeOf<MyCallback>().toEqualTypeOf<(amount: number, message: string) => void>();