Skip to content
OmitThisParameter

    ↑↓ move · ⏎ open · esc close

    Functions

    OmitThisParameter

    Removes an explicit `this` parameter from a function type.

    What it is

    The type-level shape of binding a method to its receiver. Ordinary parameters and the result remain, while the special `this` requirement disappears. That is the signature a caller can invoke without using `.call`, `.apply`, or method syntax.

    Examples

    • OmitThisParameter<typeof formatHex>
      (prefix: string) => string
    • Parameters<OmitThisParameter<typeof formatHex>>
      [prefix: string]
    • ThisParameterType<OmitThisParameter<typeof formatHex>>
      unknown

      Extracting `this` afterwards proves that the special parameter is gone.

    Each resolved type above was printed by TypeScript 6.0.3, not written by hand.

    What it does not do

    • It changes only the type. It does not bind a function at run time; use `.bind(receiver)` to create the corresponding value.
    • For generic or overloaded functions the standard definition cannot preserve every signature; generics are erased and the last overload wins.

    Takeaway

    `OmitThisParameter<T>` describes the callable type left after the receiver has already been supplied.