From 03194c9dfec3ed508b8cc1660c1da45d476b2425 Mon Sep 17 00:00:00 2001 From: davetayls Date: Tue, 27 Jan 2015 10:21:43 +0000 Subject: [PATCH] include the global cordova variable on the window object --- cordova/cordova-tests.ts | 4 +++- cordova/cordova.d.ts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts index dfaa25cc3d..289e8daf28 100644 --- a/cordova/cordova-tests.ts +++ b/cordova/cordova-tests.ts @@ -8,6 +8,8 @@ console.log('cordova.version: ' + cordova.version + ', cordova.platformId: ' + cordova.platformId); +console.log(typeof window.cordova); + cordova.exec(null, null, "NativeClassName", "MethodName"); cordova.define('mymodule', (req, exp, mod)=> { @@ -286,4 +288,4 @@ db.transaction( //---------------------------------------------------------------------- navigator.notification.vibrate(100); navigator.notification.vibrateWithPattern([100, 200, 200, 150, 50], 3); -setTimeout(navigator.notification.cancelVibration, 1000); \ No newline at end of file +setTimeout(navigator.notification.cancelVibration, 1000); diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index bdfa643da3..75b77ebe2c 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -72,6 +72,10 @@ interface Document { removeEventListener(type: string, listener: (ev: Event) => any, useCapture?: boolean): void; } +interface Window { + cordova:Cordova; +} + // cordova/argscheck module interface ArgsCheck { checkArgs(argsSpec: string, functionName: string, args: any[], callee?: any): void;