mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Create learn-tests.ts
This commit is contained in:
20
types/jquery/test/learn-tests.ts
Normal file
20
types/jquery/test/learn-tests.ts
Normal 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.
|
||||
Reference in New Issue
Block a user