func
utils
Func
type Func<A extends ROList = any[], R = any>Creates a function type with the given arguments and return type.
type F1 = Func; // () => any
type F2 = Func<[string]>; // (args_0: string) => any
type F3 = Func<[], string>; // () => string
type F4 = Func<[name: string], string>; // (name: string) => stringOrFunc
type OrFunc<T, A extends ROList = []>An alias for T | Func<A, T>.
See Func
VoidFn
type VoidFnAn alias for () => void.
Params
type Params<F extends Func>An alias for Parameters.
Param
type Param<F extends Func, I extends number>Gets the parameter at the given index. Negative indices are supported.
type Fn = (a: string, b: number) => void;
type R1 = Param<Fn, 0>; // string
type R2 = Param<Fn, -1>; // numberRT
type RT<F extends Func>An alias for ReturnType.