mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 22:36:10 +08:00
Update phonegap to 2.3
This commit is contained in:
@@ -111,7 +111,7 @@ function test_capture() {
|
||||
var options = { limit: 3, duration: 10 };
|
||||
navigator.device.capture.captureAudio(captureSuccess, captureError, options);
|
||||
var captureSuccess = function (mediaFiles) {
|
||||
var i, path, len;
|
||||
var i, path, len;
|
||||
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
|
||||
path = mediaFiles[i].fullPath;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ function test_capture() {
|
||||
{ fileName: name });
|
||||
}
|
||||
function captureSuccess(mediaFiles) {
|
||||
var i, len;
|
||||
var i, len;
|
||||
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
|
||||
uploadFile(mediaFiles[i]);
|
||||
}
|
||||
@@ -333,11 +333,13 @@ function test_contacts() {
|
||||
}
|
||||
|
||||
function test_device() {
|
||||
var element = document.getElementById('deviceProperties');
|
||||
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
|
||||
'Device Cordova: ' + device.cordova + '<br />' +
|
||||
'Device Platform: ' + device.platform + '<br />' +
|
||||
'Device UUID: ' + device.uuid + '<br />' +
|
||||
'Device Version: ' + device.version + '<br />';
|
||||
'Device Model: ' + device.model + '<br />' +
|
||||
'Device Version: ' + device.version + '<br />';
|
||||
}
|
||||
|
||||
function test_file() {
|
||||
@@ -590,6 +592,13 @@ function test_globalization() {
|
||||
);
|
||||
}
|
||||
|
||||
function test_inAppBrowser() {
|
||||
var ref = window.open('http://apache.org', '_blank', 'location=yes');
|
||||
ref.addEventListener('loadstart', function () { alert(event.url); });
|
||||
ref.removeEventListener('loadstart', null);
|
||||
ref.close();
|
||||
}
|
||||
|
||||
function test_media() {
|
||||
var my_media = new Media(src, onSuccess, onError);
|
||||
var mediaTimer = setInterval(function () {
|
||||
|
||||
18
phonegap/phonegap.d.ts
vendored
18
phonegap/phonegap.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for PhoneGap 2.2
|
||||
// Type definitions for PhoneGap 2.3
|
||||
// Project: http://phonegap.com
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -170,6 +170,7 @@ interface Device {
|
||||
platform: string;
|
||||
uuid: string;
|
||||
version: string;
|
||||
model: string;
|
||||
}
|
||||
|
||||
/* Defined in lib.d.ts
|
||||
@@ -314,6 +315,15 @@ interface Globalization {
|
||||
getCurrencyPattern(currencyCode, successCB, errorCB): void;
|
||||
}
|
||||
|
||||
/*
|
||||
interface InAppBrowser {
|
||||
addEventListener(eventname: string, callback): void;
|
||||
removeEventListener(eventname: string, callback): void;
|
||||
open(url?: string, target?: string, features?: string, replace?: bool): Window;
|
||||
close(): void;
|
||||
}
|
||||
*/
|
||||
|
||||
interface Media {
|
||||
new (src: string, mediaSuccess: Function, mediaError?: MediaError, mediaStatus?: Function);
|
||||
getCurrentPosition(mediaSuccess: Function, mediaError?: MediaError): void;
|
||||
@@ -375,7 +385,7 @@ interface LocalStorage {
|
||||
}
|
||||
*/
|
||||
|
||||
interface Navigator {
|
||||
interface Navigator extends Navigator {
|
||||
accelerometer: Accelerometer;
|
||||
camera: Camera;
|
||||
capture: Capture;
|
||||
@@ -391,4 +401,6 @@ interface Navigator {
|
||||
|
||||
interface Window {
|
||||
openDatabase(database_name: string, database_version: string, database_displayname: string, database_size: number): Database;
|
||||
}
|
||||
}
|
||||
|
||||
declare var device: Device;
|
||||
Reference in New Issue
Block a user