Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TypeScript · Type Alias

OmitThisParameter

OmitThisParameter<Type> removes an explicit this parameter from a function type. Functions without an explicit this remain unchanged, while generic information and all but the final overload are not preserved.

Since
3.3

How it works

OmitThisParameter<Type> transforms a function type that declares an explicit this parameter into an equivalent callable type without that parameter. If the source function has no explicit this, it remains unchanged; when overloads or generics are present, only the final overload is retained and generic parameters are discarded.

Syntax

OmitThisParameter<Type>

Parameters

NameTypeDescription
Typefunction typeThe function type whose explicit this parameter should be removed.

Returns

A function type without the explicit this parameter, or Type unchanged when no such parameter exists.

Key points

  • The utility transforms a function type by removing its explicit receiver parameter.
  • A function without an explicit this annotation passes through without a type change.
  • For an annotated receiver, TypeScript creates a new callable function type rather than mutating the original.
  • Generic information is discarded, and overloaded inputs contribute only their final signature.
  • The utility was introduced in TypeScript 3.3.

Common mistakes

  • Applying this utility to a generic or overloaded function type loses its generic parameters and preserves only the last overload.

Example: Remove an explicit this parameter

type Method = (this: HTMLElement, event: Event) => void;

type Callback = OmitThisParameter<Method>;

const callback: Callback = (event) => {
  console.log(event.type);
};

callback(new Event("click"));

The resulting callback can be called without supplying a this argument.

When to use it

Callback APIs

Converting a method type into a standalone callback that callers can invoke without a receiver argument.

Method-to-function adapters

Deriving a public function type from an internal method declaration while hiding its explicit receiver.

Bound methods

Typing bound or detached methods where the receiver is supplied elsewhere.

Interview questions

QWhat does OmitThisParameter do?

It removes an explicitly declared this parameter from a function type. If no explicit this exists, the original type is returned unchanged.

Follow-up: What happens to an overloaded generic function? Only its last overload is propagated, and its generics are erased.

QHow does it affect function calls?

The resulting type is callable without a this argument, while ordinary parameters remain unchanged. This is useful when exposing a method as a standalone callback.

Follow-up: How would you preserve the receiver instead? Keep the original function type, or use a type that explicitly includes its this parameter.

QWhat is the syntax and input?

It is a standard utility type with one type argument: OmitThisParameter<Type>. The argument is the function type from which the explicit receiver parameter should be removed.

Follow-up: What if the input is not declared with this? The utility leaves that type unchanged.

  • ThisParameterType<Type>
  • Parameters<Type>
  • ReturnType<Type>
  • Omit<Type, Keys>

Source: Documentation - Utility Types - TypeScript. Checked 2026-10-15.