Create learn-tests.ts

This commit is contained in:
stonio
2017-07-07 18:14:42 +02:00
committed by GitHub
parent f73e0acaa6
commit a18fdfd2f4

View File

@@ -0,0 +1,20 @@
import jQueryFactory = require('jquery');
const jQuery = jQueryFactory(window, true);
# From https://learn.jquery.com/plugins/basic-plugin-creation/
## Basic Plugin Authoring
interface JQuery {
greenify: GreenifyPlugin;
}
interface GreenifyPlugin {
(this: JQuery): void;
}
jQuery.fn.greenify = function() {
this.css( "color", "green" );
};
jQuery( "a" ).greenify(); // Makes all the links green.