Created
December 31, 2014 03:59
-
-
Save fkmhrk/9981ff4686ba2921f747 to your computer and use it in GitHub Desktop.
TypeScript overload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module demo { | |
export interface App { | |
// ノンブロッキングAPI。callbackで結果を受け取るので結果はany | |
login(username:string, password:string, callback:LoginCallback); | |
// ブロッキングAPI。この場合はUserオブジェクトを返したい | |
login(username:string, password:string) : User; | |
} | |
export class AppImpl implements App { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment