Typescript Utility Types

0.0(0)
Studied by 6 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:57 PM on 7/18/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

Partial

Constructs a type with all properties of T set to optional.

2
New cards

Required

Constructs a type consisting of all properties of T set to required.

3
New cards

Readonly

Constructs a type with all properties of T set to readonly.

4
New cards
**Record<K, T>**

Constructs a type with a set of properties K of type T.

5
New cards
**Pick<T, K>**

Constructs a type by picking the set of properties K from T.

6
New cards
**Omit<T, K>**

Constructs a type by omitting the set of properties K from T.

7
New cards
**Exclude<T, U>**

Constructs a type by excluding from T all properties that are assignable to U.

8
New cards
**Extract<T, U>**

Constructs a type by extracting from T all properties that are assignable to U.

9
New cards
**NonNullable<T>**

Constructs a type by excluding null and undefined from T.

10
New cards
**Parameters<T>**

Constructs a tuple type from the types used in the parameters of a function type T.

11
New cards
**ConstructorParameters<T>**

Constructs a tuple or array type from the types used in the parameters of a constructor type T.

12
New cards
**ReturnType<T>**

Constructs a type consisting of the return type of function type T.

13
New cards
**InstanceType<T>**

Constructs a type consisting of the instance type of a constructor function type T.

14
New cards
**ThisParameterType<T>**

Extracts the type of the this parameter for a function type, or unknown if the function type has no this parameter.

15
New cards
**OmitThisParameter<T>**

Removes the this parameter from a function type.

16
New cards
**ThisType<T>**

Marks an object type as being contextually this-typed.

17
New cards
**Uppercase<S>**

Constructs a string type by converting all characters in a string type S to uppercase.

18
New cards
**Lowercase<S>**

Constructs a string type by converting all characters in a string type S to lowercase.

19
New cards
**Capitalize<S>**

Constructs a string type by capitalizing the first character in a string type S.

20
New cards
**Uncapitalize<S>**

Constructs a string type by un-capitalizing the first character in a string type S.