Digging things up…
Digging things up…
Quick reference for all TypeScript utility types — Partial, Required, Pick, Omit, Record and more.
Developer Tools
Encoders, formatters, validators and generators that run entirely in your browser. Whatever you paste stays on your machine — nothing is sent to a server.
Related developer tools
Encode text to Base64 or decode Base64 back to text. Supports URL-safe encoding and Unicode. Runs entirely in your browser — nothing is sent to any server.
Use tool →{ }Format, validate, and minify JSON with clear error messages. Choose 2-space, 4-space, or tab indentation. Client-side only — your data never leaves the browser.
Use tool →🔑Create cryptographically secure passwords with full control over length and character sets.
Use tool →🔗Encode special characters in URLs or decode percent-encoded strings — instantly in your browser.
Use tool →Explore more from Dino Media: All Free Tools · Our Services · Digital Glossary · Our Work
Web Development
From custom web apps to complex integrations, our development team builds fast, robust websites that scale with your business.
Partial<T>
Makes all properties in T optional.
interface User { id: number; name: string; }
type PartialUser = Partial<User>;
// { id?: number; name?: string; }Required<T>
Makes all optional properties in T required.
type RequiredUser = Required<PartialUser>;
// { id: number; name: string; }Readonly<T>
Makes all properties in T readonly.
const u: Readonly<User> = { id: 1, name: 'Alice' };
u.id = 2; // Error!Record<K, V>
Constructs a type with keys K and values V.
type Page = 'home' | 'about';
type Routes = Record<Page, string>;
// { home: string; about: string; }Pick<T, K>
Constructs a type by picking properties K from T.
type UserPreview = Pick<User, 'id' | 'name'>;
// { id: number; name: string; }Omit<T, K>
Constructs a type by removing properties K from T.
type NoId = Omit<User, 'id'>;
// { name: string; }Exclude<T, U>
Excludes types from T that are assignable to U.
type A = Exclude<'a' | 'b' | 'c', 'a'>; // 'b' | 'c'
Extract<T, U>
Extracts types from T that are assignable to U.
type B = Extract<'a' | 'b' | 'c', 'a' | 'f'>; // 'a'
NonNullable<T>
Removes null and undefined from T.
type C = NonNullable<string | null | undefined>; // string
ReturnType<T>
Obtains the return type of a function type T.
function getUser() { return { id: 1 }; }
type UserReturn = ReturnType<typeof getUser>;
// { id: number }Parameters<T>
Obtains the parameter types of a function as a tuple.
function fn(a: number, b: string): void {}
type P = Parameters<typeof fn>;
// [number, string]Awaited<T>
Unwraps the type of a Promise (recursive).
type A = Awaited<Promise<string>>; // string type B = Awaited<Promise<Promise<number>>>; // number
InstanceType<T>
Obtains the instance type of a constructor function type.
class MyClass { x = 0; }
type I = InstanceType<typeof MyClass>;
// MyClassConstructorParameters<T>
Obtains the parameter types of a constructor as a tuple.
class C { constructor(x: number, y: string) {} }
type P = ConstructorParameters<typeof C>;
// [number, string]Uppercase<S>
Converts a string literal type to uppercase.
type U = Uppercase<'hello'>; // 'HELLO'
Lowercase<S>
Converts a string literal type to lowercase.
type L = Lowercase<'HELLO'>; // 'hello'
Capitalize<S>
Capitalises the first character of a string literal type.
type C = Capitalize<'hello'>; // 'Hello'
Uncapitalize<S>
Uncapitalises the first character of a string literal type.
type U = Uncapitalize<'Hello'>; // 'hello'