Last active
August 29, 2015 14:18
-
-
Save kfranqueiro/311377d497edca52c8c0 to your computer and use it in GitHub Desktop.
forDocument example in TypeScript
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
function forDocument(ownerDocument: Document) { | |
return lang.partial(this, ownerDocument); | |
} | |
var byId:{ | |
(ownerDocument: Document, id: string); | |
forDocument: (ownerDocument: Document) => (id: string) => Node; | |
} = <any> function (ownerDocument, id) { | |
return ownerDocument.getElementById(id); | |
} | |
byId.forDocument = forDocument.bind(byId); | |
var dom = { | |
byId: byId.forDocument(document) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment