Type alias PrependParameter<Param, F>

PrependParameter<Param, F>: ((...args) => ReturnType<F>)

Prepend Parameter.

Type Parameters

  • Param
  • F extends ((...args) => any)

Type declaration

    • (...args): ReturnType<F>
    • Parameters

      • Rest ...args: Extract<Cons<Param, Parameters<F>>, readonly any[]>

      Returns ReturnType<F>

Example

type F = (x: number) => boolean
type F2 = PrependParameter<string, F> // type F2 = (s: string, x: number) => boolean

Source