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

TypeScript · Type Alias

Required

Required<Type> transforms an object type so all of its properties are required. It is the inverse counterpart to Partial<Type>.

Since
2.8

How it works

Required<Type> creates a new object type from Type in which optional properties are treated as required. It changes the type-level property modifiers, so values assigned to the resulting type must include every property that Type declares.

Syntax

Required<Type>

Parameters

NameTypeDescription
TypetypeThe object type whose properties should all become required.

Returns

A type containing all properties of Type with required property modifiers.

Key points

  • The utility produces a transformed object type where every property from the input type is required.
  • Required can be used without importing it from a package.
  • It provides the inverse property-optional transformation of Partial.
  • An object omitting a formerly optional member is rejected when assigned to the Required version.

Common mistakes

  • Required reverses Partial's effect: it requires properties that Partial would make optional.

Example: Require every property

interface Props {
  title?: string;
  count?: number;
}

const complete: Required<Props> = {
  title: "Dashboard",
  count: 0,
};

console.log(complete);

Every property must be supplied because Required<Props> removes optionality from title and count.

When to use it

Model completed configuration

A builder or parser has produced a fully populated configuration object and the next API should reject incomplete values.

Represent validated data

A shared optional input type is narrowed into a guaranteed-complete internal representation after validation.

Strengthen an internal contract

A component or service contract must require every declared field even though an external-facing type permits omissions.

Interview questions

QWhat does Required<Type> do?

Required<Type> constructs a type whose properties are all required. For an interface with optional members, assigning an object to Required<Interface> requires values for every member.

Follow-up: How does Required differ from NonNullable? NonNullable removes null and undefined from a type, whereas Required changes property optionality.

QDoes Required fill in missing runtime properties?

It operates on the properties declared by Type and removes their optional property modifier. It does not create runtime defaults or insert missing values into an object.

Follow-up: What happens at runtime? Nothing: Required is erased during compilation, so validation or defaulting must be implemented separately.

QWhen was Required introduced and where is it available?

Required was released in TypeScript 2.8 and is available as a global utility type. Its purpose is to make all properties of the supplied type required.

Follow-up: Why is it useful in a large codebase? It can express a completed configuration or normalized object after a separate construction step.

  • Partial
  • Readonly
  • Pick
  • Record
  • NonNullable

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