mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Wrapped interfaces in module. Updated tests.
This commit is contained in:
@@ -4,13 +4,14 @@ declare var els: Element[];
|
||||
declare var mixinFn: Function;
|
||||
|
||||
function TestComponent() {
|
||||
var self: FlightBase = this;
|
||||
var self: Flight.Base = this;
|
||||
|
||||
self.defaultAttrs({
|
||||
fooSelector: '.bar'
|
||||
});
|
||||
|
||||
this.onClick = function (ev: JQueryEventObject, data) {
|
||||
this.onClick = function (ev: JQueryEventObject, data: Flight.EventData) {
|
||||
var el: HTMLElement = data.el;
|
||||
self.select('fooSelector').addClass('bar');
|
||||
};
|
||||
|
||||
|
||||
33
flight/flight.d.ts
vendored
33
flight/flight.d.ts
vendored
@@ -7,8 +7,41 @@
|
||||
|
||||
|
||||
interface FlightAdvice {
|
||||
/**
|
||||
* Run the customFunc function after the existingFunc function.
|
||||
*
|
||||
* @param existingFuncName The name of the existing function (existingFunc)
|
||||
* you want to augment.
|
||||
*
|
||||
* customFunc The function to be invoked after existingFunc.
|
||||
*/
|
||||
after(method: string, fn: Function);
|
||||
|
||||
/**
|
||||
* Run the existingFunc function in the middle of the customFunc function.
|
||||
* It's similar to underscore's _wrap function).
|
||||
*
|
||||
* @param existingFuncName The name of the existing function (existingFunc)
|
||||
* you want to augment.
|
||||
*
|
||||
* customFunc The function to wrap around existingFunc. The existingFunc
|
||||
* function will be passed to customFunc as an argument.
|
||||
*
|
||||
* The existing function is passed to the custom function as an argument so
|
||||
* that it can be referenced. If the custom function does not call the
|
||||
* existing function then it will replace that function instead of
|
||||
* surrounding it.
|
||||
*/
|
||||
around(method: string, fn: Function);
|
||||
|
||||
/**
|
||||
* Run the customFunc function before the existingFunc function.
|
||||
*
|
||||
* @param existingFuncName The name of the existing function (existingFunc)
|
||||
* you want to augment.
|
||||
*
|
||||
* @param customFunc The function to be invoked before existingFunc.
|
||||
*/
|
||||
before(method: string, fn: Function);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user