Template Literal Types: How To Type Strings

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • awesome-dva

    A curated list of "damn vulnerable apps" and exploitable VMs / wargames. See contributing.md for information.

  • TypeScript Awesome Template Literal Types Curated list of awesome Template Literal Types examples. Handbook Template Literal Types Articles I need to learn about TypeScript Template Literal Types TypeScript: Template Literal Types Exploring Template Literal Types in TypeScript 4.1 TypeScript Splits the Atom! Mastering TypeScript Template Literal Types Videos It's Clash of Code but with TypeScript only by William Candillon It's Brainf**k , but types only by William Candillon It's Wordle, but types only by William Candillon All 140 TypeScript Challenges - Video Solutions and Explanations by Michigan TypeScript Examples dot notation string type-safe document.querySelector Router params parsing static-path library Expression parser JSON Parser JSON Serializer GraphQL Typed AST SQL Database CSS Parser ELIZA Bot Typescript Type System Adventure - by Rick Love Printf/Log Bitwise Arithmetic tRPC Split Privatized Join Extract all paths from object Repeat Schummar-translate kysely chicane prefix-properties typelevel-parser type-trident hypescript anysort wordle pretty-cache-header nanostores-router dot-path-value infer-html-events hotscript Useā€¦

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • Template literal types are essentially types for strings. By defining the pattern that a string must match, these types provide a way to validate and infer data. They were introduced about three years ago in TypeScript 4.1. Following the original GitHub PR, the following examples show the versatile functionality TypeScript has gained through template literal types.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • awesome-template-literal-types

    Curated list of awesome Template Literal Types examples

  • You can find even more great examples in this GitHub repo. It's a goldmine of clever use cases that show the power of template literals in TypeScript.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts