From 77e5ef281cd7b71713b32382c63dcc4c75e3c127 Mon Sep 17 00:00:00 2001 From: Laurence C Date: Tue, 15 Dec 2015 11:42:25 +0000 Subject: [PATCH] Add definitions for SwiftClick --- swiftclick/swiftclick-tests.ts | 7 +++++++ swiftclick/swiftclick.d.ts | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 swiftclick/swiftclick-tests.ts create mode 100644 swiftclick/swiftclick.d.ts 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;