gristlabs/ts-interface-checker

cannot import interface from different ts file

Closed this issue · 0 comments

I want to create typeguards for only a specific file, so I import structures into that file, i.e

from bar.d.ts i import

export interface bar {
example: string
}

then in types.d.ts I define

foo {
test: bar
 } 

which will become

 export const foo = t.iface([], {
  "test": "bar",
});

and not

 export const foo = t.iface([], {
  "test": {example: string},
});

loading a checker in web browser will say that bar does not exist. Unknown type bar
I could do all my types in a single file but that will get messy