Add definitions for SwiftClick

This commit is contained in:
Laurence C
2015-12-15 11:42:25 +00:00
parent 93d72eb9f6
commit 77e5ef281c
2 changed files with 27 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
/// <reference path="swiftclick.d.ts" />
var swiftClick = SwiftClick.attach(document.body);
swiftClick.replaceNodeNamesToTrack(["a", "div", "h1"]);
swiftClick.addNodeNamesToTrack(["li"]);
swiftClick.useCssParser(true);
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for SwiftClick v1.2.0
// Project: https://github.com/munkychop/swiftclick
// Definitions by: Laurence C <https://github.com/Laurence-C>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SwiftClickObject {
addNodeNamesToTrack(nodeNamesArray: string[]): void;
replaceNodeNamesToTrack(nodeNamesArray: string[]): void;
useCssParser(useParser: boolean): void;
}
interface SwiftClickStatic {
attach(contextEl: Element): SwiftClickObject;
}
declare module "swiftclick" {
export = SwiftClick;
}
declare var SwiftClick: SwiftClickStatic;