Decompose monolithic readme into docs/ directory structure
This commit is contained in:
49
docs/overview.md
Normal file
49
docs/overview.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Overview
|
||||
|
||||
<div align='center'>
|
||||
|
||||
<h1>TypeBox</h1>
|
||||
|
||||
<p>Json Schema Type Builder with Static Type Resolution for TypeScript</p>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
</div>
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import { Type, type Static } from "@alkdev/typebox";
|
||||
|
||||
const T = Type.Object({
|
||||
// const T = {
|
||||
x: Type.Number(), // type: 'object',
|
||||
y: Type.Number(), // required: ['x', 'y', 'z'],
|
||||
z: Type.Number(), // properties: {
|
||||
}); // x: { type: 'number' },
|
||||
// y: { type: 'number' },
|
||||
// z: { type: 'number' }
|
||||
// }
|
||||
// }
|
||||
|
||||
type T = Static<typeof T>; // type T = {
|
||||
// x: number,
|
||||
// y: number,
|
||||
// z: number
|
||||
// }
|
||||
```
|
||||
|
||||
## Overview
|
||||
|
||||
TypeBox is a runtime type builder that creates in-memory Json Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime asserted using standard Json Schema validation.
|
||||
|
||||
This library is designed to allow Json Schema to compose similar to how types compose within TypeScript's type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
|
||||
|
||||
License MIT
|
||||
|
||||
---
|
||||
|
||||
[Back to Home](../readme.md)
|
||||
Reference in New Issue
Block a user