Skip to content

Instantly share code, notes, and snippets.

@thebeebs
Created February 12, 2014 21:29
Show Gist options
  • Save thebeebs/8964901 to your computer and use it in GitHub Desktop.
Save thebeebs/8964901 to your computer and use it in GitHub Desktop.
Interfaces can model all sorts of JavaScript objects, You can add a function signature simply. foo accepts a string and a number and returns a string
interface Thing {
a: number;
b: string;
foo(x: string, n: number): string;
}
function process(x: Thing){
return x.foo("string",10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment