diff --git a/swiftclick/swiftclick-tests.ts b/swiftclick/swiftclick-tests.ts new file mode 100644 index 000000000..237978996 --- /dev/null +++ b/swiftclick/swiftclick-tests.ts @@ -0,0 +1,7 @@ +/// + +var swiftClick = SwiftClick.attach(document.body); + +swiftClick.replaceNodeNamesToTrack(["a", "div", "h1"]); +swiftClick.addNodeNamesToTrack(["li"]); +swiftClick.useCssParser(true); \ No newline at end of file diff --git a/swiftclick/swiftclick.d.ts b/swiftclick/swiftclick.d.ts new file mode 100644 index 000000000..d00e9f761 --- /dev/null +++ b/swiftclick/swiftclick.d.ts @@ -0,0 +1,20 @@ +// Type definitions for SwiftClick v1.2.0 +// Project: https://github.com/munkychop/swiftclick +// Definitions by: 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;