Salt la conținutul principal
eLearner.app
TS TYPE GYMNASTICS ARENA

TS Type Arena: Tip Gimnastică

Depășiți constrângerile compilatorului TypeScript prin rezolvarea a trei puzzle-uri avansate de tastare (tipuri mapate, condiționale și remaparea cheilor).

TYPE CONSTRAINT

Creați o versiune personalizată a tipului de utilitar „Pick<T, K>”. Tipul dvs. „MyPick<T, K>” trebuie să accepte un tip de obiect T și o uniune de chei K, extragând numai proprietățile solicitate din T folosind tipuri mapate și constrângeri de cheie (extinde cheia T).

Constraint Monitor
CONSTRAINT UNMET
interface User {
name: string;
age: number;
active: boolean;
}
MyPick<User, "name" | "active">
✗ Type does not satisfy constraints or uses any/never
✗ Type does not satisfy constraints or uses any/nevertsc v5.4.5

Stuck?

Learn the fundamental concepts in the TypeScript course to solve this challenge.

Static TypeScript Compiler

Write valid type definitions to satisfy type assertions.

Se încarcă editorul...