Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeOf doesn't extract nested interfaces #51

Closed
DylanRJohnston opened this issue Jun 6, 2017 · 1 comment
Closed

TypeOf doesn't extract nested interfaces #51

DylanRJohnston opened this issue Jun 6, 2017 · 1 comment

Comments

@DylanRJohnston
Copy link

import * as T from 'io-ts'

type Foo = T.TypeOf<typeof $Foo>
const $Foo = T.interface({
    foo1: T.number,
    foo2: T.string
});

type Bar = T.TypeOf<typeof $Bar>
const $Bar = T.interface({
    bar1: T.string,
    bar2: $Foo
})
type Bar = {
    bar1: string;
    bar2: T.InterfaceOf<{
        foo1: T.Type<number>;
        foo2: T.Type<string>;
    }>;
}
@DylanRJohnston
Copy link
Author

Just noticed the upstream issue. Sorry for not checking first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant