Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ghoullier/awesome-template-literal-types

Curated list of awesome Template Literal Types examples
https://github.com/ghoullier/awesome-template-literal-types

List: awesome-template-literal-types

awesome awesome-list lists resources

Last synced: 3 months ago
JSON representation

Curated list of awesome Template Literal Types examples

Awesome Lists containing this project

README

        


Awesome

# TypeScript Awesome Template Literal Types

Curated list of awesome [Template Literal Types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types) examples.

## Handbook

- [Template Literal Types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html)

## Articles

- [I need to learn about TypeScript Template Literal Types](https://dev.to/phenomnominal/i-need-to-learn-about-typescript-template-literal-types-51po)
- [TypeScript: Template Literal Types](https://michalzalecki.com/typescript-template-literal-types/)
- [Exploring Template Literal Types in TypeScript 4.1](https://davidtimms.github.io/programming-languages/typescript/2020/11/20/exploring-template-literal-types-in-typescript-4.1.html)
- [TypeScript Splits the Atom!](https://effectivetypescript.com/2020/11/05/template-literal-types/)
- [Mastering TypeScript Template Literal Types](https://betterprogramming.pub/mastering-typescript-template-literal-types-f4131a94ffb1)

## Videos

- [It's Clash of Code but with TypeScript only](https://www.youtube.com/watch?v=_3vIxQyfi8E) by [William Candillon](https://github.com/wcandillon)
- [It's Brainf**k , but types only](https://www.youtube.com/watch?v=DUjRBaJM01E) by [William Candillon](https://github.com/wcandillon)
- [It's Wordle, but types only](https://www.youtube.com/watch?v=JT30j4nhej4) by [William Candillon](https://github.com/wcandillon)
- [All 140 TypeScript Challenges - Video Solutions and Explanations](https://www.youtube.com/watch?v=QFfL2azrshE&list=PLOlZuxYbPik180vcJfsAM6xHYLVxrEgHC) by [Michigan TypeScript](https://twitter.com/MiTypeScript)

## Examples

- [dot notation string type-safe](#dot-notation-string-type-safe)
- [document.querySelector](#documentqueryselector)
- [Router params parsing](#router-params-parsing)
- [static-path library](#static-path-library)
- [Expression parser](#expression-parser)
- [JSON Parser](#json-parser)
- [JSON Serializer](#json-serializer)
- [GraphQL Typed AST](#graphql-typed-ast)
- [SQL Database](#sql-database)
- [CSS Parser](#css-parser)
- [ELIZA Bot](#eliza-bot)
- [Typescript Type System Adventure - by Rick Love](#typescript-type-system-adventure---by-rick-love)
- [Printf/Log](#printflog)
- [Bitwise Arithmetic](#bitwise-arithmetic)
- [tRPC](#trpc)
- [Split](#split)
- [Privatized](#privatized)
- [Join](#join)
- [Extract all paths from object](#extract-all-paths-from-object)
- [Repeat](#repeat)
- [Schummar-translate](#schummar-translate)
- [kysely](#kysely)
- [chicane](#chicane)
- [prefix-properties](#prefix-properties)
- [typelevel-parser](#typelevel-parser)
- [type-trident](#type-trident)
- [hypescript](#hypescript)
- [anysort](#anysort)
- [wordle](#wordle)
- [pretty-cache-header](#pretty-cache-header)
- [nanostores-router](#nanostores-router)
- [dot-path-value](#dot-path-value)
- [infer-html-events](#infer-html-events)
- [hotscript](#hotscript)
- [brouther](#brouther)
- [hkt-toolbelt](#hkt-toolbelt)
- [string-ts](#string-ts)
- [typeskell](#typeskell)
- [gql.tada](#gql.tada)

## Use Cases

### dot notation string type-safe





dot notation string type-safe Illustration

[Tweet](https://twitter.com/diegohaz/status/1309489079378219009)

### document.querySelector





querySelector Illustration

[Tweet](https://twitter.com/MikeRyanDev/status/1308472279010025477)

### Router params parsing





Extract Route Params Illustration

[Tweet](https://twitter.com/danvdk/status/1301707026507198464)

### static-path library

[Tweet](https://twitter.com/garybernhardt/status/1466104868498817032)

[static-path repo](https://github.com/garybernhardt/static-path)

[Video walkthrough](https://www.youtube.com/watch?v=KRMJIiGE0ds)

### Expression parser





Expression Parser Illustration

[Tweet](https://twitter.com/NicoloRibaudo/status/1304515347932999680)

### JSON Parser





[Tweet](https://twitter.com/buildsghost/status/1301976526603206657)

### JSON Serializer

[Tweet](https://twitter.com/RReverser/status/1332088256826142722)

[Gist](https://gist.github.com/RReverser/ad3bef657aa32a15ca9e55386feb8fb6)

### GraphQL Typed AST





[Tweet](https://twitter.com/dotansimha/status/1302294238139473923)

### SQL Database








SQL Database Illustration

[Tweet](https://twitter.com/c_pick/status/1307433762914009090)

### CSS Parser





CSS Parser Illustration

[Tweet](https://twitter.com/anuraghazru/status/1310634306092462080)

### ELIZA Bot





Eliza Bot Illustration

[Tweet](https://twitter.com/mrjacobbloom/status/1310530442177568768)

### Typescript Type System Adventure - by Rick Love





Typescript Type System Adventure

[Blog](https://ricklove.me/typescript-type-system-adventure)

[Tweet](https://twitter.com/RickLoveToldMe/status/1320875032197894144?s=20)

### Printf/Log





Similar to Idris' type-safe dependently-typed printf, but in TypeScript, working with console.log.

[GitHub](https://gist.github.com/joaomilho/d31a4557f1b850ec7e65730a4316c80b)

### Bitwise Arithmetic





Bitwise Arithmetic

[GitHub](https://gist.github.com/cleoold/c278c1689b41a25ce1417eb4c07877f4#file-bitstring-ts)

### tRPC





TypeScript toolkit for building end-to-end type-safe APIs

The client above is not importing any code from the server, only it's type declarations.

tRPC Demo

### Split





Split a string value with a given sepatator

Split

[Tweet](https://twitter.com/anuraghazru/status/1381685555465920512)

### Privatized





Automaticly privatize methods prefixed by '\_'

Privatized

[Tweet](https://twitter.com/fabiospampinato/status/1388187928925442050)

### Join





Type safe `ReadonlyArray.join`

String Array Join

[Tweet](https://twitter.com/ghoullier/status/1390331553394331648)

### Extract all paths from object





Extract all paths from object

[Tweet](https://twitter.com/wcandillon/status/1409503819575275531)

### Repeat





[Tweet](https://twitter.com/ghoullier/status/1408440499283935238)

### schummar-translate





Extract typed ICU params from translation strings

### kysely





A type-safe typescript SQL query builder

[WebSite](https://koskimas.github.io/kysely/)

### chicane





A simple and safe router for React and TypeScript, based on template literal types capabilities.

### Prefix Properties





Prefix all keys of a Record

[Tweet](https://twitter.com/ghoullier/status/1471531186749067264)

### Typelevel Parser








TypeLevel DSL Parser

### Type-Trident





A curated list of advanced type level madness

### HypeScript





A simplified implementation of TypeScript's type system written in TypeScript's own type system

HypeScript implemenation example

[Tweet](https://twitter.com/ronenamiel/status/1552375586584133633)

### Anysort








Anysort,Flexible and Full Typed multi-properties sorter for nested objects

Anysort implemenation example

### Wordle





A pure type only implementation of Wordle game

A pure type only implementation of Wordle game

### pretty-cache-header








Cache-control header utility that parses human readable time strings into seconds. Time based values use Template Literal Types to help avoid passing invalid time string formats.

### nanostores-router








A tiny URL router for [Nano Stores](https://github.com/nanostores/nanostores) state manager.

A tiny URL router for Nano Stores state manager.

### dot-path-value








Safely get deep nested properties using dot notation.

Safely get deep nested properties using dot notation.

[GitHub](https://github.com/g-makarov/dot-path-value)

### infer-html-events





Infer event names out of HTML elements

Infer event names out of HTML elements.

[Tweet](https://twitter.com/beraliv/status/1622971034591805441)

### hotscript








Higher-Order TypeScript: A lodash-like library for types, with support for type-level lambda functions.

https://user-images.githubusercontent.com/2315749/222081717-96217cd2-ac89-4e06-a942-17fbda717cd2.mp4

[Tweet](https://twitter.com/GabrielVergnaud/status/1627593386852028417)

### brouther








The brother router to help in React apps

Brouther router code example

### hkt-toolbelt








✨ Functional and composable type utilities

hkt-toolbelt code example

## string-ts








Strongly-typed string functions for all!

string-ts and zod example

## typeskell





Experiment to declare typesclasses with programmatic type signatures.

typeskell example

## gql.tada





🪄 Magical GraphQL query engine for TypeScript

gql.tada example