Skip to content

Instantly share code, notes, and snippets.

@kfranqueiro
Last active August 29, 2015 14:18
Show Gist options
  • Save kfranqueiro/311377d497edca52c8c0 to your computer and use it in GitHub Desktop.
Save kfranqueiro/311377d497edca52c8c0 to your computer and use it in GitHub Desktop.
forDocument example in TypeScript
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