Skip to content

Commit

Permalink
Merge pull request #1423 from samchon/doc/README
Browse files Browse the repository at this point in the history
Refactor README and index.html
  • Loading branch information
samchon authored Dec 11, 2024
2 parents 1e1ead2 + 492ccbf commit a440e40
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 20 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export namespace protobuf {
export function random<T>(g?: Partial<IRandomGenerator>): 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
Expand All @@ -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<T>()` 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<string>();

//----
// examples/checkUUID.js
//----
import typia from "typia";
export const checkString = (() => {
return (input) => "string" === typeof input;
})();
```



## Sponsors
Thanks for your support.

Expand Down
6 changes: 3 additions & 3 deletions website/pages/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export default {
type: "page",
hidden: true,
display: "hidden",
theme: {
layout: "full",
},
// theme: {
// layout: "full",
// },
},
docs: {
title: "📖 Guide Documents",
Expand Down
31 changes: 29 additions & 2 deletions website/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export namespace protobuf {
export function random<T>(g?: Partial<IRandomGenerator>): 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

Expand All @@ -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<T>()` 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<string>();

//----
// examples/checkUUID.js
//----
import typia from "typia";
export const checkString = (() => {
return (input) => "string" === typeof input;
})();
```




## Sponsors
Thanks for your support.

Expand Down
2 changes: 1 addition & 1 deletion website/pages/docs/validators/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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}>`
Expand Down
82 changes: 77 additions & 5 deletions website/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -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";

<HomeLayout>
<HomeHeroMovie />
</HomeLayout>



## Transformer
![Typia Logo](/logo.png)

## Key Features
{/* <span style={{ display: "flex", flexDirection: "row" }}>
{[
[
"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]) => (
<a href={url} style={{ marginTop: "30px", marginRight: "6px" }}>
<img src={image} alt={alt} />
</a>
))}
</span> */}

<center>
[Guide Documents](/docs) · [Playground (Online IDE)](/playground) · [Github Repository](https://github.com/samchon/typia)
</center>

`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<T>()` 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<string>();

//----
// examples/checkUUID.js
//----
import typia from "typia";
export const checkString = (() => {
return (input) => "string" === typeof input;
})();
```




## Key Features
<HomeLayout>
<HomeStrengthMovie />
</HomeLayout>
Expand Down
21 changes: 13 additions & 8 deletions website/src/components/home/HomeLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { Bleed } from "nextra-theme-docs";

const HomeLayout = (props: React.HTMLAttributes<HTMLDivElement>) => (
<div
style={{
marginLeft: "-1.5rem",
marginRight: "-1.5rem",
}}
>
{props.children}
</div>
<Bleed full>
<div
style={{
// marginLeft: "-1.5rem",
marginLeft: "calc(50% - 50vw)",
marginRight: "-1.5rem",
}}
>
{props.children}
</div>
</Bleed>
);
export default HomeLayout;

0 comments on commit a440e40

Please sign in to comment.