Skip to content

Instantly share code, notes, and snippets.

@ThomasKruegl
Created March 5, 2018 11:44
Show Gist options
  • Save ThomasKruegl/2f83b35f2f41ae0339ef070b3197508c to your computer and use it in GitHub Desktop.
Save ThomasKruegl/2f83b35f2f41ae0339ef070b3197508c to your computer and use it in GitHub Desktop.
// how to type such?
var x= {}
x.foo = 27;
x.bar = foo+10;
x.as_str = x.foo + " " + x.bar;
return x;
interface X<T> {
foo: T;
bar: T | string;
as_str: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment