Skip to content
Home
Dev Convert Generate Finance Calc Design Security Media

More categories

Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

GuidesBlogAPI & MCPCheatsheetsChangelog All categories

Browse

439 tools · 15 categories

Start here

Popular tools New this week 11 All tools 439

Categories

Developer Tools 91 Converters 65 Calculators 32 Finance Tools 32 Generators 31 Media Tools 27 Design Tools 25 Security Tools 25 Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

Guides Cheatsheets Blog REST API MCP server Changelog

No matches here.

Keep FindUtils free Sponsors fund new tools
  1. Cheatsheets
Guides Blog API & MCP
Sponsor
FindUtils
Sponsor
  1. Home
  2. Cheatsheets
  3. Programming
  4. TypeScript Essentials

Programming · Cheatsheet

TypeScript Essentials Cheatsheet

Types, interfaces, generics, utility types, type guards, and advanced TypeScript patterns

63 commands 9 sections

On this sheet

Basic Types 10 Interfaces & Type Aliases 8 Generics 6 Utility Types 10 Type Guards & Narrowing 8 Enums & Mapped Types 6 Functions & Overloads 6 Advanced Patterns 8 Sources 1
Try it in the browser Convert JSON to TypeScript interfaces or type aliases with customizable options. Open JSON to TypeScript

No entry matches that filter.

Basic Types

  • let name: string = "hello" String type annotation
  • let age: number = 25 Number type (int & float)
  • let active: boolean = true Boolean type
  • let items: string[] = ["a", "b"] Array of strings
  • let tuple: [string, number] = ["a", 1] Tuple with fixed types
  • let anything: any = 42 Opt out of type checking
  • let unknown: unknown = getData() Type-safe alternative to any
  • let nothing: void = undefined Void (no return value)
  • let impossible: never Never type (unreachable code)
  • let nullable: string | null = null Nullable type with union

Interfaces & Type Aliases

  • interface User { name: string; age: number; } Define an object shape
  • interface User { email?: string; } Optional property with ?
  • interface User { readonly id: number; } Read-only property
  • interface Admin extends User { role: string; } Extend an interface
  • type ID = string | number Type alias with union
  • type Point = { x: number; y: number } Type alias for object
  • type Callback = (data: string) => void Function type alias
  • type Status = "active" | "inactive" String literal union type

Generics

  • function identity<T>(arg: T): T { return arg; } Generic function
  • interface Box<T> { value: T; } Generic interface
  • function getLength<T extends { length: number }>(x: T) Constrained generic
  • type Pair<K, V> = { key: K; value: V } Multiple type parameters
  • function create<T = string>(val: T) Default generic type
  • class Stack<T> { items: T[] = []; push(item: T) {} } Generic class

Utility Types

  • Partial<User> Make all properties optional
  • Required<User> Make all properties required
  • Readonly<User> Make all properties read-only
  • Pick<User, "name" | "email"> Pick specific properties
  • Omit<User, "password"> Omit specific properties
  • Record<string, number> Object with typed key-value pairs
  • ReturnType<typeof fn> Extract function return type
  • Parameters<typeof fn> Extract function parameter types
  • Awaited<Promise<string>> Unwrap Promise type
  • NonNullable<string | null> Remove null and undefined

Type Guards & Narrowing

  • if (typeof x === "string") { ... } typeof type guard
  • if (x instanceof Date) { ... } instanceof type guard
  • if ("name" in obj) { ... } Property existence check
  • function isUser(x: any): x is User { ... } Custom type predicate
  • value as string Type assertion (use sparingly)
  • value!.property Non-null assertion operator
  • value ?? "default" Nullish coalescing
  • obj?.nested?.prop Optional chaining

Enums & Mapped Types

  • enum Direction { Up, Down, Left, Right } Numeric enum (0, 1, 2, 3)
  • enum Color { Red = "#f00", Blue = "#00f" } String enum
  • const enum Status { Active = 1 } Const enum (inlined at compile)
  • type Flags = { [K in keyof User]: boolean } Mapped type from keys
  • type ReadonlyUser = { readonly [K in keyof User]: User[K] } Mapped readonly type
  • [key: string]: unknown Index signature for dynamic keys

Functions & Overloads

  • function greet(name: string): string { ... } Typed function with return type
  • const add = (a: number, b: number): number => a + b Arrow function with types
  • function log(msg: string, level?: string) Optional parameter
  • function log(msg: string, level = "info") Default parameter value
  • function sum(...nums: number[]): number Rest parameters
  • function parse(input: string): number; Function overload signature

Advanced Patterns

  • type EventMap = { click: MouseEvent; keydown: KeyboardEvent } Discriminated type map
  • type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> } Recursive partial type
  • type Keys = keyof User Get union of object keys
  • type Val = User["name"] Indexed access type
  • type IsString<T> = T extends string ? true : false Conditional type
  • type Flatten<T> = T extends Array<infer U> ? U : T Infer keyword in conditional
  • satisfies Record<string, number> Validate type without widening
  • as const Const assertion for literal types

Sources

  • https://www.typescriptlang.org/docs/handbook/intro.html TypeScript Handbook: types, narrowing, generics, and utility types.

Related cheatsheets

  • Barcode Formats40 commands
  • JavaScript ES6+59 commands
  • Python Essentials59 commands

Tools for this work

  • JSON to TypeScriptConvert JSON to TypeScript interfaces or type aliases with customizable options.
  • GraphQL to TypeScriptGenerate TypeScript types from GraphQL schemas.

From FindUtils

More to explore

Products and services from the team behind FindUtils.

Promote your tool
Featured product seeranks.com SeeRanks — transparent product discovery A public ranking board where paid placement is always labeled and every product keeps its earned position. View SeeRanks Public rank board #1 Sponsored #2 #3 #4 Paid placement is always labeled Free favicon tool emojifavicons.com Emoji Favicons Turn any emoji into a favicon with one HTML line. SVG, PNG or ICO, no sign-up. <link rel="icon" href=".../🦊.svg"> Create a favicon
FindUtils service findutils.com Articles for software tools A sourced article for your channels, or a sponsored FindUtils publication with editorial review. Compare packages Domain portfolio findutils.com Domain names for sale .com.dev.sh.app.io Unused names across dev tools, AI, PDF and commerce. Make an offer. Browse the list Playable ranking towerscore.io TowerScore — stack the skyline Play to climb, or buy a floor. Paid floors are labeled. Open TowerScore

Missing a tool you need?

Tell us what to build next. Most requests ship as a free browser tool, an API endpoint and an MCP tool.

Request a tool
FindUtils

Free, fast utilities. Most tools process your files in the browser; lookup tools say what they send, and pages load analytics and ads.

  • No sign-up for free tools
  • Most tools run in your browser
  • 369 tools on the REST API, 369 on MCP

Tools

DevelopersConvertPDFDesignSecurityAll tools →

Learn

GuidesBlogCheatsheetsChangelog

Build

REST APIMCP serverAPI referenceWorkflowsStatus

FindUtils

AboutLibraries we useSponsorRequest a toolDomains for saleContact
© 2026 FindUtils PrivacyTermsSitemap
Service status
FindUtils

Free, fast utilities that respect your data. Most tools run in your browser.

Build with it

REST APIMCP serverGuidesChangelog

FindUtils

AboutSponsorPrivacyContact
Theme
© 2026 FindUtils Terms
FindUtils
Guides Blog REST API MCP server Changelog

Categories

Developers 91 Convert 65 Calculate 32 Finance 32 Generate 31 Media 27
All 15 categories →

Keep it free

Sponsorship keeps every tool free and funds the new ones we ship each week.

Sponsor Back the project
Tools API Sponsor