Update readme.md

This commit is contained in:
sinclairzx81
2018-10-29 19:24:20 +13:00
committed by GitHub
parent dd9d29b7fa
commit 7f0b3261bb
+7 -2
View File
@@ -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: