Skip to content

Commit

Permalink
doc: add prerequisites
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 18, 2024
1 parent e9a5484 commit cd1a619
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/data-structure/literal-string.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Literal String

In TypeScript, a literal string is a string that has a specific value. For example, the string `"hello"` is a literal string with the value `hello`.
In TypeScript, a literal string is a string that has a specific value. For example, the string `"hello"` is a literal string with the value `hello`.

## Prerequisites
- [Literal types are SO USEFUL in TS - Advanced TypeScript](https://www.youtube.com/watch?v=jxSh-RZTCws) by [Matt Pocock](https://x.com/mattpocockuk)
- [Literal Type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types)
25 changes: 23 additions & 2 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
outline: deep
---



# Introduction

::: warning
This book is still in the draft phase. Please feel free to open an issue or submit a pull request on [GitHub](https://github.com/mildronize/type-safe-design-pattern)
:::

::: info
This book is more advanced than the TypeScript Handbook. It is intended for developers who are already familiar with TypeScript and are looking to improve their code quality and design.
:::
Expand All @@ -12,8 +18,13 @@ This book is a collection of TypeScript best practices and design patterns. It i

After examining the code of several well-known open-source projects such as Zod, tRPC, Hono, Elysia, and ts-odata-client.

## Recommended Reading
- [Type-Level Programming](https://type-level-typescript.com/)
## Author Talk

I am currently writing a new E-book. Please follow and support!This book is for advanced TypeScript users (not suitable for beginners, it might be overwhelming).The title of the book is "Type-safe Design Pattern in Modern TypeScript." Not every Design Pattern can be made Type-safe, but I have compiled frequently used Design Patterns in Modern TypeScript Libraries.Disclaimer:

I did not create these Design Patterns. I learned from various Modern TypeScript Open Source projects, including famous ones like Zod, tRPC, Hono, elysia, and many others, as well as writing the Nammtham Framework. This process has helped me distill commonly used patterns.P.S. The image is not the book cover; it was generated by AI.
P.S.2. The book is still in the draft phase, but you can see a rough outline.
P.S.3. I would love to hear feedback from the community because I haven't seen anyone write about this yet, and even Western authors haven't covered it.

## Table of Contents

Expand All @@ -31,3 +42,13 @@ After examining the code of several well-known open-source projects such as Zod,
- Use function argument instead of plain object
- Use function overload

## Prerequisites
Please make sure you have a good understanding of TypeScript before reading this book. If you are new to TypeScript, I recommend reading the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html) first.

Generics are a fundamental concept in TypeScript, so make sure you understand them. You can read the [Generics](https://www.typescriptlang.org/docs/handbook/2/generics.html) section of the TypeScript Handbook.

After that, make sure you have understand type-level programming. You can read the [Type-Level Programming](https://type-level-typescript.com/) book.
There are many free chapters available. However, I recommend buying the book to support the author.

## Contributing
If you have any suggestions or feedback, please feel free to open an issue or submit a pull request on [GitHub](https://github.com/mildronize/type-safe-design-pattern)

0 comments on commit cd1a619

Please sign in to comment.