diff --git a/README.md b/README.md index d8d9a5b741..87dd7380de 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ export namespace protobuf { export function random(g?: Partial): T; ``` -Typia is a transformer library supporting below features: +`typia` is a transformer library supporting below features: - Super-fast Runtime Validators - Enhanced JSON schema and serde functions @@ -60,6 +60,31 @@ Typia is a transformer library supporting below features: +## Transformation +If you call `typia` function, it would be compiled like below. + +This is the key concept of `typia`, transforming TypeScript type to a runtime function. The `typia.is()` function is transformed to a dedicated type checker by analyzing the target type `T` in the compilation level. + +This feature enables developers to ensure type safety in their applications, leveraging TypeScript's static typing while also providing runtime validation. Instead of defining additional schemas, you can simply utilize the pure TypeScript type itself. + +```typescript +//---- +// examples/checkString.ts +//---- +import typia, { tags } from "typia"; +export const checkString = typia.createIs(); + +//---- +// examples/checkUUID.js +//---- +import typia from "typia"; +export const checkString = (() => { + return (input) => "string" === typeof input; +})(); +``` + + + ## Sponsors Thanks for your support. diff --git a/website/pages/_meta.js b/website/pages/_meta.js index 77a3297c40..970238ea58 100644 --- a/website/pages/_meta.js +++ b/website/pages/_meta.js @@ -4,9 +4,9 @@ export default { type: "page", hidden: true, display: "hidden", - theme: { - layout: "full", - }, + // theme: { + // layout: "full", + // }, }, docs: { title: "📖 Guide Documents", diff --git a/website/pages/docs/index.mdx b/website/pages/docs/index.mdx index d7c04eb83a..e8ff230166 100644 --- a/website/pages/docs/index.mdx +++ b/website/pages/docs/index.mdx @@ -83,11 +83,11 @@ export namespace protobuf { export function random(g?: Partial): T; ``` -Typia is a transformer library supporting below features: +`typia` is a transformer library supporting below features: - Super-fast Runtime Validators - Enhanced JSON functions - - LLM function calling application schema + - LLM function calling schema and structured output - Protocol Buffer encoder and decoder - Random data generator @@ -106,6 +106,33 @@ Typia is a transformer library supporting below features: + +## Transformation +If you call `typia` function, it would be compiled like below. + +This is the key concept of `typia`, transforming TypeScript type to a runtime function. The `typia.is()` function is transformed to a dedicated type checker by analyzing the target type `T` in the compilation level. + +This feature enables developers to ensure type safety in their applications, leveraging TypeScript's static typing while also providing runtime validation. Instead of defining additional schemas, you can simply utilize the pure TypeScript type itself. + +```typescript +//---- +// examples/checkString.ts +//---- +import typia, { tags } from "typia"; +export const checkString = typia.createIs(); + +//---- +// examples/checkUUID.js +//---- +import typia from "typia"; +export const checkString = (() => { + return (input) => "string" === typeof input; +})(); +``` + + + + ## Sponsors Thanks for your support. diff --git a/website/pages/docs/validators/tags.mdx b/website/pages/docs/validators/tags.mdx index 2c4fcd0cd9..4f823df379 100644 --- a/website/pages/docs/validators/tags.mdx +++ b/website/pages/docs/validators/tags.mdx @@ -154,7 +154,7 @@ For reference, when you take a mistake that choosing different target type, Type - `number & ExclusiveMinimum<{number}>` - `number & MultipleOf<{number}>` - bigint - - `bigint & Type<{keyword}>` + - `bigint & Type<{keyword}>` - `int64` - `uint64` - `bigint & Minimum<{bigint}>` diff --git a/website/pages/index.mdx b/website/pages/index.mdx index e1acc6225e..f3e8c4ae18 100644 --- a/website/pages/index.mdx +++ b/website/pages/index.mdx @@ -1,16 +1,88 @@ +import { Bleed } from 'nextra-theme-docs' + import HomeLayout from "../src/components/home/HomeLayout"; -import HomeHeroMovie from "../src/movies/home/HomeHeroMovie"; import HomeStrengthMovie from "../src/movies/home/HomeStrengthMovie"; - - - +## Transformer +![Typia Logo](/logo.png) -## Key Features +{/* +{[ + [ + "MIT License", + "https://img.shields.io/badge/license-MIT-blue.svg", + "https://github.com/samchon/typia/blob/master/LICENSE", + ], + [ + "NPM Version", + "https://img.shields.io/npm/v/typia.svg", + "https://www.npmjs.com/package/typia", + ], + [ + "NPM Downloads", + "https://img.shields.io/npm/dm/typia.svg", + "https://www.npmjs.com/package/typia", + ], + [ + "Build Status", + "https://github.com/samchon/typia/workflows/build/badge.svg", + "https://github.com/samchon/typia/actions?query=workflow%3Abuild", + ], + [ + "Guide Documents", + "https://img.shields.io/badge/guide-documents-forestgreen", + "https://typia.io/docs/", + ], + [ + "Gurubase", + "https://img.shields.io/badge/Gurubase-Ask%20Typia%20Guru-006BFF", + "https://gurubase.io/g/typia", + ], + [ + "Discord", + "https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ", + "https://discord.gg/E94XhzrUCZ", + ] +].map(([alt, image, url]) => ( + + {alt} + +))} + */} + +
+[Guide Documents](/docs) · [Playground (Online IDE)](/playground) · [Github Repository](https://github.com/samchon/typia) +
+ +`typia` is a transformer library converting TypeScript types to runtime function. + +If you call one of the `typia` function, it would be compiled like below. This is the key concept of `typia`, transforming TypeScript type to a runtime function. The `typia.is()` function is transformed to a dedicated type checker by analyzing the target type `T` in the compilation level. +This feature enables developers to ensure type safety in their applications, leveraging TypeScript's static typing while also providing runtime validation. Instead of defining additional schemas, you can simply utilize the pure TypeScript type itself. + +```typescript +//---- +// examples/checkString.ts +//---- +import typia, { tags } from "typia"; +export const checkString = typia.createIs(); + +//---- +// examples/checkUUID.js +//---- +import typia from "typia"; +export const checkString = (() => { + return (input) => "string" === typeof input; +})(); +``` + + + + +## Key Features diff --git a/website/src/components/home/HomeLayout.tsx b/website/src/components/home/HomeLayout.tsx index 66e4d805e7..382567c83b 100644 --- a/website/src/components/home/HomeLayout.tsx +++ b/website/src/components/home/HomeLayout.tsx @@ -1,11 +1,16 @@ +import { Bleed } from "nextra-theme-docs"; + const HomeLayout = (props: React.HTMLAttributes) => ( -
- {props.children} -
+ +
+ {props.children} +
+
); export default HomeLayout;