awesome-cordova-plugins/src/index.ts

21 lines
611 B
TypeScript
Raw Normal View History

2015-11-30 06:30:15 +08:00
const DEVICE_READY_TIMEOUT = 2000;
export * from './plugins/actionsheet';
2015-11-26 01:44:58 +08:00
export * from './plugins/camera';
2015-11-29 06:17:04 +08:00
export * from './plugins/statusbar';
2015-11-29 06:24:38 +08:00
export * from './plugins/toast';
2015-11-30 06:30:15 +08:00
declare var window;
let didFireReady = false;
window.addEventListener('deviceready', function() {
didFireReady = true;
})
setTimeout(function() {
if(!didFireReady && window.cordova) {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
}
}, DEVICE_READY_TIMEOUT);