Decompose monolithic readme into docs/ directory structure

This commit is contained in:
2026-04-23 13:57:56 +00:00
parent 560bb00433
commit f8b2cdd5a4
47 changed files with 1936 additions and 1829 deletions

45
docs/types/properties.md Normal file
View File

@@ -0,0 +1,45 @@
[Overview](../overview.md) | [Installation](../installation.md) | [Usage](../usage.md) | **Types** | [Values](../values/) | [Syntax](../syntax/) | [TypeRegistry](../type-registry.md) | [TypeCheck](../type-check.md)
# Properties
Object properties can be modified with Readonly and Optional. The following table shows how these modifiers map between TypeScript and Json Schema.
```typescript
TypeBox TypeScript Json Schema
const T = Type.Object({ type T = { const T = {
name: Type.ReadonlyOptional( readonly name?: string type: 'object',
Type.String() } properties: {
) name: {
}) type: 'string'
}
}
}
const T = Type.Object({ type T = { const T = {
name: Type.Readonly( readonly name: string type: 'object',
Type.String() } properties: {
) name: {
}) type: 'string'
}
},
required: ['name']
}
const T = Type.Object({ type T = { const T = {
name: Type.Optional( name?: string type: 'object',
Type.String() } properties: {
) name: {
}) type: 'string'
}
}
}
```
Back to [Home](../../readme.md)