mirror of
https://github.com/zoriya/typebox.git
synced 2026-05-28 17:06:41 +00:00
Update readme.md
This commit is contained in:
@@ -11,9 +11,14 @@ const Foo = Type.Object({
|
||||
c: Type.Boolean()
|
||||
})
|
||||
|
||||
// statically resolve types
|
||||
const foo: Static<typeof Foo> = { a: "hello", b: 2, c: true }
|
||||
// statically resolve type Foo.
|
||||
function createFoo(foo: Static<typeof Foo>) {
|
||||
// foo.a - string
|
||||
// foo.b - number
|
||||
// foo.c - boolean
|
||||
}
|
||||
|
||||
// Foo itself is just JSON schema.
|
||||
console.log(Foo)
|
||||
// -> { type: 'object',
|
||||
// properties:
|
||||
|
||||
Reference in New Issue
Block a user