native-fn 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +488 -146
- package/dist/index.d.ts +130 -117
- package/dist/native.cjs +581 -563
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +581 -563
- package/dist/native.umd.js +581 -563
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/appearance/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/appearance/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/appearance/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/appearance/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/badge/index.cjs +2 -2
- package/dist/plugin/badge/index.d.ts +1 -1
- package/dist/plugin/badge/index.mjs +2 -2
- package/dist/plugin/badge/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/badge/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/badge/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/badge/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/badge/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/badge/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/badge/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/battery/index.cjs +3 -3
- package/dist/plugin/battery/index.d.ts +1 -1
- package/dist/plugin/battery/index.mjs +3 -3
- package/dist/plugin/battery/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/battery/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/battery/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/battery/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/battery/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/battery/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/battery/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/clipboard/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/clipboard/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/clipboard/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/clipboard/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/dimension/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/dimension/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/dimension/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/dimension/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/dimension/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/fullscreen/index.cjs +499 -265
- package/dist/plugin/fullscreen/index.d.ts +14 -7
- package/dist/plugin/fullscreen/index.mjs +499 -265
- package/dist/plugin/fullscreen/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/fullscreen/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/fullscreen/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/fullscreen/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/geolocation/index.cjs +6 -0
- package/dist/plugin/geolocation/index.d.ts +1 -1
- package/dist/plugin/geolocation/index.mjs +6 -0
- package/dist/plugin/geolocation/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/geolocation/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/geolocation/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/geolocation/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/geolocation/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/geolocation/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/geolocation/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/notification/index.cjs +6 -0
- package/dist/plugin/notification/index.mjs +6 -0
- package/dist/plugin/notification/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/notification/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/notification/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/notification/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/notification/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/notification/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/notification/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/open/index.cjs +120 -120
- package/dist/plugin/open/index.d.ts +35 -35
- package/dist/plugin/open/index.mjs +120 -120
- package/dist/plugin/open/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/open/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/open/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/open/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/open/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/open/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/open/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/open/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/open/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/open/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/open/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/permission/index.cjs +6 -0
- package/dist/plugin/permission/index.d.ts +1 -0
- package/dist/plugin/permission/index.mjs +6 -0
- package/dist/plugin/permission/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/permission/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/permission/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/permission/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/permission/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/permission/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/permission/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/pip/index.cjs +255 -273
- package/dist/plugin/pip/index.d.ts +20 -13
- package/dist/plugin/pip/index.mjs +255 -273
- package/dist/plugin/pip/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/pip/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/pip/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/pip/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/pip/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/pip/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/pip/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/platform/index.d.ts +5 -5
- package/dist/plugin/platform/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/platform/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/platform/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/platform/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/theme/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/theme/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/theme/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/theme/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/plugin/vibration/index.cjs +5 -5
- package/dist/plugin/vibration/index.d.ts +1 -1
- package/dist/plugin/vibration/index.mjs +5 -5
- package/dist/plugin/vibration/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/plugin/vibration/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/plugin/vibration/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/open/types/open.d.ts +1 -1
- package/dist/plugin/vibration/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/plugin/vibration/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/plugin/vibration/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/plugin/vibration/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/dist/src/errors/invalid-state-error.d.ts +2 -0
- package/dist/src/plugin/badge/types/badge.d.ts +1 -1
- package/dist/src/plugin/battery/types/battery.d.ts +1 -1
- package/dist/src/plugin/fullscreen/cores/index.d.ts +3 -3
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +9 -3
- package/dist/src/plugin/geolocation/types/geolocation.d.ts +1 -1
- package/dist/src/plugin/open/types/open.d.ts +1 -1
- package/dist/src/plugin/permission/types/permission.d.ts +1 -0
- package/dist/src/plugin/pip/cores/index.d.ts +6 -6
- package/dist/src/plugin/pip/types/pip.d.ts +12 -6
- package/dist/src/plugin/vibration/types/vibration.d.ts +1 -1
- package/package.json +21 -13
|
@@ -346,301 +346,283 @@ function createCustomError(name, Base) {
|
|
|
346
346
|
|
|
347
347
|
var NotSupportedError = createCustomError('NotSupportedError');
|
|
348
348
|
|
|
349
|
-
var
|
|
349
|
+
var InvalidStateError = createCustomError('InvalidStateError');
|
|
350
|
+
|
|
350
351
|
var PIP_PRESENTATION_MODE = 'picture-in-picture';
|
|
351
352
|
var INLINE_PRESENTATION_MODE = 'inline';
|
|
352
|
-
|
|
353
|
+
var lastPipVideo = null;
|
|
354
|
+
var eventsBridged = false;
|
|
355
|
+
var PIP_BRIDGE_KEY = (function () {
|
|
356
|
+
if (typeof Symbol === 'function') {
|
|
357
|
+
var existing = globalThis.__nativeFnPipBridgeKey__;
|
|
358
|
+
if (typeof existing === 'symbol')
|
|
359
|
+
return existing;
|
|
360
|
+
return globalThis.__nativeFnPipBridgeKey__ = Symbol('native.fn.pip.bridged');
|
|
361
|
+
}
|
|
362
|
+
return '__nativeFnPipBridged__';
|
|
363
|
+
}());
|
|
364
|
+
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
365
|
+
var onErrorSubscriptionManager = createSubscriptionManager(attachOnError, detachOnError);
|
|
366
|
+
var Pip = {
|
|
367
|
+
get supported() {
|
|
368
|
+
return getEnabled();
|
|
369
|
+
},
|
|
370
|
+
get element() {
|
|
371
|
+
return getElement();
|
|
372
|
+
},
|
|
373
|
+
get isPip() {
|
|
374
|
+
return getIsPip();
|
|
375
|
+
},
|
|
376
|
+
request: request,
|
|
377
|
+
exit: exit,
|
|
378
|
+
onChange: onChangeSubscriptionManager.subscribe,
|
|
379
|
+
onError: onErrorSubscriptionManager.subscribe,
|
|
380
|
+
Constants: {},
|
|
381
|
+
Errors: {
|
|
382
|
+
NotSupportedError: NotSupportedError,
|
|
383
|
+
InvalidStateError: InvalidStateError,
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
function hasStandardApi() {
|
|
353
387
|
return typeof globalThis.document.pictureInPictureEnabled !== 'undefined';
|
|
354
388
|
}
|
|
355
|
-
function
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return
|
|
389
|
+
function getDefaultTarget() {
|
|
390
|
+
var video = globalThis.document.querySelector('video');
|
|
391
|
+
return video !== null ? video : undefined;
|
|
392
|
+
}
|
|
393
|
+
function createPipEventPayload(nativeEvent, element, isPip) {
|
|
394
|
+
return {
|
|
395
|
+
nativeEvent: nativeEvent,
|
|
396
|
+
element: element,
|
|
397
|
+
isPip: isPip
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function emitChange(nativeEvent, element, isPip) {
|
|
401
|
+
onChangeSubscriptionManager.emit(createPipEventPayload(nativeEvent, element, isPip));
|
|
402
|
+
}
|
|
403
|
+
function emitError(nativeEvent, element, isPip) {
|
|
404
|
+
onErrorSubscriptionManager.emit(createPipEventPayload(nativeEvent, element, isPip));
|
|
405
|
+
}
|
|
406
|
+
function onEnterPictureInPicture(event) {
|
|
407
|
+
var target = event.target;
|
|
408
|
+
if (target instanceof globalThis.HTMLVideoElement)
|
|
409
|
+
emitChange(event, target, true);
|
|
410
|
+
}
|
|
411
|
+
function onLeavePictureInPicture(event) {
|
|
412
|
+
var target = event.target;
|
|
413
|
+
if (target instanceof globalThis.HTMLVideoElement)
|
|
414
|
+
emitChange(event, target, false);
|
|
415
|
+
}
|
|
416
|
+
function onPictureInPictureError(event) {
|
|
417
|
+
var target = event.target;
|
|
418
|
+
if (target instanceof globalThis.HTMLVideoElement)
|
|
419
|
+
emitError(event, target, getIsPip());
|
|
420
|
+
}
|
|
421
|
+
function onWebkitPresentationModeChanged(event) {
|
|
422
|
+
if (this.webkitPresentationMode === PIP_PRESENTATION_MODE) {
|
|
423
|
+
lastPipVideo = this;
|
|
424
|
+
emitChange(event, this, true);
|
|
425
|
+
return;
|
|
392
426
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
427
|
+
if (this.webkitPresentationMode === INLINE_PRESENTATION_MODE && lastPipVideo === this) {
|
|
428
|
+
lastPipVideo = null;
|
|
429
|
+
emitChange(event, this, false);
|
|
396
430
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
431
|
+
}
|
|
432
|
+
function bridgeSingleVideoNode(video) {
|
|
433
|
+
if (video[PIP_BRIDGE_KEY])
|
|
434
|
+
return;
|
|
435
|
+
if (typeof video.webkitSetPresentationMode === 'undefined' && typeof video.onwebkitpresentationmodechanged === 'undefined')
|
|
436
|
+
return;
|
|
437
|
+
EventListener.add(video, { type: 'webkitpresentationmodechanged', callback: onWebkitPresentationModeChanged, options: false });
|
|
438
|
+
video[PIP_BRIDGE_KEY] = true;
|
|
439
|
+
}
|
|
440
|
+
function bridgeWebkitVideoEvents() {
|
|
441
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
442
|
+
for (var i = 0; i < videos.length; i++)
|
|
443
|
+
bridgeSingleVideoNode(videos[i]);
|
|
444
|
+
}
|
|
445
|
+
function bridgeEvents() {
|
|
446
|
+
if (eventsBridged)
|
|
447
|
+
return;
|
|
448
|
+
eventsBridged = true;
|
|
449
|
+
if (hasStandardApi())
|
|
450
|
+
return;
|
|
451
|
+
bridgeWebkitVideoEvents();
|
|
452
|
+
if (typeof globalThis.MutationObserver === 'undefined')
|
|
453
|
+
return;
|
|
454
|
+
var observer = new globalThis.MutationObserver(function (records) {
|
|
455
|
+
if (lastPipVideo !== null) {
|
|
456
|
+
var removed = false;
|
|
457
|
+
for (var i = 0; i < records.length; i++) {
|
|
458
|
+
var removedNodes = records[i].removedNodes;
|
|
459
|
+
for (var j = 0; j < removedNodes.length; j++) {
|
|
460
|
+
var node = removedNodes[j];
|
|
461
|
+
if (node === lastPipVideo || (node.nodeType === Node.ELEMENT_NODE && node.contains(lastPipVideo))) {
|
|
462
|
+
removed = true;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
if (removed)
|
|
467
|
+
break;
|
|
411
468
|
}
|
|
469
|
+
if (removed && !globalThis.document.contains(lastPipVideo))
|
|
470
|
+
lastPipVideo = null;
|
|
412
471
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
function attachOnChange() {
|
|
430
|
-
if (hasStandardPipEvents()) {
|
|
431
|
-
var changeEvents = ['enterpictureinpicture', 'leavepictureinpicture'];
|
|
432
|
-
for (var i = 0; i < changeEvents.length; i++) {
|
|
433
|
-
EventListener.add(globalThis.document, {
|
|
434
|
-
type: changeEvents[i],
|
|
435
|
-
callback: onChangeSubscriptionManager.emit,
|
|
436
|
-
options: false,
|
|
437
|
-
});
|
|
472
|
+
for (var i = 0; i < records.length; i++) {
|
|
473
|
+
var addedNodes = records[i].addedNodes;
|
|
474
|
+
for (var j = 0; j < addedNodes.length; j++) {
|
|
475
|
+
var node = addedNodes[j];
|
|
476
|
+
if (node.nodeType !== Node.ELEMENT_NODE)
|
|
477
|
+
continue;
|
|
478
|
+
var element = node;
|
|
479
|
+
if (element.tagName === 'VIDEO') {
|
|
480
|
+
bridgeSingleVideoNode(element);
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
var nested = element.querySelectorAll('video');
|
|
484
|
+
for (var k = 0; k < nested.length; k++)
|
|
485
|
+
bridgeSingleVideoNode(nested[k]);
|
|
438
486
|
}
|
|
439
|
-
return;
|
|
440
487
|
}
|
|
441
|
-
|
|
488
|
+
});
|
|
489
|
+
observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
|
|
490
|
+
}
|
|
491
|
+
function attachOnChange() {
|
|
492
|
+
if (hasStandardApi()) {
|
|
493
|
+
EventListener.add(globalThis.document, { type: 'enterpictureinpicture', callback: onEnterPictureInPicture, options: false });
|
|
494
|
+
EventListener.add(globalThis.document, { type: 'leavepictureinpicture', callback: onLeavePictureInPicture, options: false });
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
bridgeWebkitVideoEvents();
|
|
498
|
+
}
|
|
499
|
+
function detachOnChange() {
|
|
500
|
+
if (hasStandardApi()) {
|
|
501
|
+
EventListener.remove(globalThis.document, { type: 'enterpictureinpicture', callback: onEnterPictureInPicture, options: false });
|
|
502
|
+
EventListener.remove(globalThis.document, { type: 'leavepictureinpicture', callback: onLeavePictureInPicture, options: false });
|
|
503
|
+
return;
|
|
442
504
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
505
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
506
|
+
for (var i = 0; i < videos.length; i++) {
|
|
507
|
+
EventListener.remove(videos[i], { type: 'webkitpresentationmodechanged', callback: onWebkitPresentationModeChanged, options: false });
|
|
508
|
+
videos[i][PIP_BRIDGE_KEY] = false;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function attachOnError() {
|
|
512
|
+
EventListener.add(globalThis.document, { type: 'pictureinpictureerror', callback: onPictureInPictureError, options: false });
|
|
513
|
+
}
|
|
514
|
+
function detachOnError() {
|
|
515
|
+
EventListener.remove(globalThis.document, { type: 'pictureinpictureerror', callback: onPictureInPictureError, options: false });
|
|
516
|
+
}
|
|
517
|
+
function getEnabled() {
|
|
518
|
+
if (typeof globalThis.document.pictureInPictureEnabled === 'boolean')
|
|
519
|
+
return globalThis.document.pictureInPictureEnabled;
|
|
520
|
+
var video;
|
|
521
|
+
var selected = globalThis.document.querySelector('video');
|
|
522
|
+
if (selected !== null)
|
|
523
|
+
video = selected;
|
|
524
|
+
else
|
|
525
|
+
video = globalThis.document.createElement('video');
|
|
526
|
+
return typeof video.webkitSupportsPresentationMode === 'function' && video.webkitSupportsPresentationMode(PIP_PRESENTATION_MODE);
|
|
527
|
+
}
|
|
528
|
+
function getElement() {
|
|
529
|
+
var currentElement = globalThis.document.pictureInPictureElement;
|
|
530
|
+
if (currentElement !== null && typeof currentElement !== 'undefined')
|
|
531
|
+
return currentElement;
|
|
532
|
+
if (lastPipVideo !== null && lastPipVideo.webkitPresentationMode === PIP_PRESENTATION_MODE)
|
|
533
|
+
return lastPipVideo;
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
function getIsPip() {
|
|
537
|
+
return getElement() !== null;
|
|
538
|
+
}
|
|
539
|
+
function request(target) {
|
|
540
|
+
return new Promise(function (resolve, reject) {
|
|
541
|
+
if (typeof target === 'undefined')
|
|
542
|
+
target = getDefaultTarget();
|
|
543
|
+
if (typeof target === 'undefined')
|
|
544
|
+
return reject(new NotSupportedError('Failed to enter Picture-in-Picture mode.'));
|
|
545
|
+
var tagName = target.tagName.toLowerCase();
|
|
546
|
+
if (tagName !== 'video')
|
|
547
|
+
return reject(new NotSupportedError('The "' + tagName + '" element does not support Picture-in-Picture requests.'));
|
|
548
|
+
var method = target.requestPictureInPicture;
|
|
549
|
+
var isWebkitPipActive = lastPipVideo !== null && lastPipVideo.webkitPresentationMode === PIP_PRESENTATION_MODE;
|
|
550
|
+
if (typeof method === 'function' && !isWebkitPipActive) {
|
|
551
|
+
var result = method.call(target);
|
|
552
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
553
|
+
result
|
|
554
|
+
.then(resolve)
|
|
555
|
+
.catch(function () {
|
|
556
|
+
try {
|
|
557
|
+
fallbackToWebkit();
|
|
558
|
+
}
|
|
559
|
+
catch (e) {
|
|
560
|
+
reject(new NotSupportedError('The "' + tagName + '" element does not support Picture-in-Picture requests.'));
|
|
561
|
+
}
|
|
451
562
|
});
|
|
563
|
+
return;
|
|
452
564
|
}
|
|
453
|
-
return;
|
|
565
|
+
return resolve();
|
|
454
566
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
video[PIP_BRIDGED_KEY] = undefined;
|
|
567
|
+
function fallbackToWebkit() {
|
|
568
|
+
if (typeof target !== 'undefined' && typeof target.webkitSupportsPresentationMode === 'function' && target.webkitSupportsPresentationMode(PIP_PRESENTATION_MODE) && typeof target.webkitSetPresentationMode === 'function') {
|
|
569
|
+
if (target.disablePictureInPicture)
|
|
570
|
+
return reject(new NotSupportedError('Picture-in-Picture is disabled on this element.'));
|
|
571
|
+
if (!hasStandardApi())
|
|
572
|
+
bridgeSingleVideoNode(target);
|
|
573
|
+
target.webkitSetPresentationMode(PIP_PRESENTATION_MODE);
|
|
574
|
+
if (target.webkitPresentationMode !== PIP_PRESENTATION_MODE)
|
|
575
|
+
return reject(new InvalidStateError('Picture-in-Picture transition is already in progress.'));
|
|
576
|
+
lastPipVideo = target;
|
|
577
|
+
return resolve();
|
|
467
578
|
}
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
function attachOnError() {
|
|
471
|
-
EventListener.add(globalThis.document, {
|
|
472
|
-
type: 'pictureinpictureerror',
|
|
473
|
-
callback: onErrorSubscriptionManager.emit,
|
|
474
|
-
options: false,
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
function detachOnError() {
|
|
478
|
-
EventListener.remove(globalThis.document, {
|
|
479
|
-
type: 'pictureinpictureerror',
|
|
480
|
-
callback: onErrorSubscriptionManager.emit,
|
|
481
|
-
options: false,
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
function drainPendingOperation() {
|
|
485
|
-
var entry = pendingQueue.shift();
|
|
486
|
-
if (typeof entry === 'undefined') {
|
|
487
|
-
activeOperation = null;
|
|
488
|
-
return;
|
|
579
|
+
reject(new NotSupportedError('The "' + tagName + '" element does not support Picture-in-Picture requests.'));
|
|
489
580
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
.then(drainPendingOperation)
|
|
511
|
-
.catch(drainPendingOperation);
|
|
512
|
-
return next;
|
|
513
|
-
}
|
|
514
|
-
return new Promise(function (resolve, reject) {
|
|
515
|
-
pendingQueue.push({
|
|
516
|
-
operation: 'request',
|
|
517
|
-
target: target,
|
|
518
|
-
resolve: resolve,
|
|
519
|
-
reject: reject,
|
|
520
|
-
});
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
function exit() {
|
|
524
|
-
lastIntendedOperation = 'exit';
|
|
525
|
-
if (activeOperation === null) {
|
|
526
|
-
var next = exitImmediately();
|
|
527
|
-
activeOperation = next
|
|
528
|
-
.then(drainPendingOperation)
|
|
529
|
-
.catch(drainPendingOperation);
|
|
530
|
-
return next;
|
|
531
|
-
}
|
|
532
|
-
return new Promise(function (resolve, reject) {
|
|
533
|
-
pendingQueue.push({
|
|
534
|
-
operation: 'exit',
|
|
535
|
-
target: undefined,
|
|
536
|
-
resolve: resolve,
|
|
537
|
-
reject: reject,
|
|
538
|
-
});
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
function requestImmediately(target) {
|
|
542
|
-
return new Promise(function (resolve, reject) {
|
|
543
|
-
if (typeof target === 'undefined')
|
|
544
|
-
target = getDefaultTarget();
|
|
545
|
-
if (typeof target === 'undefined')
|
|
546
|
-
return reject(new NotSupportedError('Failed to enter Picture-in-Picture mode.'));
|
|
547
|
-
var tagName = target.tagName.toLowerCase();
|
|
548
|
-
if (tagName !== 'video')
|
|
549
|
-
return reject(new NotSupportedError('The "' + tagName + '" element does not support Picture-in-Picture requests.'));
|
|
550
|
-
function fallbackToWebkitVideo() {
|
|
551
|
-
if (typeof target !== 'undefined' && typeof target.webkitSupportsPresentationMode === 'function' && target.webkitSupportsPresentationMode(PIP_PRESENTATION_MODE) && typeof target.webkitSetPresentationMode === 'function') {
|
|
552
|
-
if (target.disablePictureInPicture)
|
|
553
|
-
return reject(new NotSupportedError('Picture-in-Picture is disabled on this video element.'));
|
|
554
|
-
lastPipVideo = target;
|
|
555
|
-
bridgeWebkitVideoEvents();
|
|
556
|
-
target.webkitSetPresentationMode(PIP_PRESENTATION_MODE);
|
|
557
|
-
return resolve();
|
|
558
|
-
}
|
|
559
|
-
reject(new NotSupportedError('The "' + tagName + '" element does not support Picture-in-Picture requests.'));
|
|
581
|
+
fallbackToWebkit();
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
function exit() {
|
|
585
|
+
return new Promise(function (resolve, reject) {
|
|
586
|
+
var method = globalThis.document.exitPictureInPicture;
|
|
587
|
+
if (typeof method === 'function') {
|
|
588
|
+
var result = method.call(globalThis.document);
|
|
589
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
590
|
+
result
|
|
591
|
+
.then(resolve)
|
|
592
|
+
.catch(function () {
|
|
593
|
+
try {
|
|
594
|
+
fallbackToWebkit();
|
|
595
|
+
}
|
|
596
|
+
catch (e) {
|
|
597
|
+
reject(new NotSupportedError('Failed to exit Picture-in-Picture mode.'));
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
return;
|
|
560
601
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
resolve();
|
|
568
|
-
})
|
|
569
|
-
.catch(function () {
|
|
570
|
-
fallbackToWebkitVideo();
|
|
571
|
-
});
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
602
|
+
return resolve();
|
|
603
|
+
}
|
|
604
|
+
function fallbackToWebkit() {
|
|
605
|
+
if (lastPipVideo !== null && typeof lastPipVideo.webkitSetPresentationMode === 'function' && lastPipVideo.webkitPresentationMode === PIP_PRESENTATION_MODE) {
|
|
606
|
+
lastPipVideo.webkitSetPresentationMode(INLINE_PRESENTATION_MODE);
|
|
607
|
+
lastPipVideo = null;
|
|
574
608
|
return resolve();
|
|
575
609
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
return resolve();
|
|
583
|
-
function fallbackToWebkitVideo() {
|
|
584
|
-
var candidates;
|
|
585
|
-
if (lastPipVideo !== null && lastPipVideo.webkitPresentationMode === PIP_PRESENTATION_MODE)
|
|
586
|
-
candidates = [lastPipVideo];
|
|
587
|
-
else
|
|
588
|
-
candidates = globalThis.document.querySelectorAll('video');
|
|
589
|
-
for (var i = 0; i < candidates.length; i++) {
|
|
590
|
-
var video = candidates[i];
|
|
591
|
-
if (typeof video.webkitSetPresentationMode === 'function' && video.webkitPresentationMode === PIP_PRESENTATION_MODE) {
|
|
592
|
-
video.webkitSetPresentationMode(INLINE_PRESENTATION_MODE);
|
|
593
|
-
lastPipVideo = null;
|
|
594
|
-
return resolve();
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
if (getElement() === null)
|
|
610
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
611
|
+
for (var i = 0; i < videos.length; i++) {
|
|
612
|
+
var video = videos[i];
|
|
613
|
+
if (typeof video.webkitSetPresentationMode === 'function' && video.webkitPresentationMode === PIP_PRESENTATION_MODE) {
|
|
614
|
+
video.webkitSetPresentationMode(INLINE_PRESENTATION_MODE);
|
|
615
|
+
lastPipVideo = null;
|
|
598
616
|
return resolve();
|
|
599
|
-
reject(new NotSupportedError('Failed to exit Picture-in-Picture mode.'));
|
|
600
|
-
}
|
|
601
|
-
var method = globalThis.document.exitPictureInPicture;
|
|
602
|
-
if (typeof method === 'function') {
|
|
603
|
-
var result = method.call(globalThis.document);
|
|
604
|
-
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
605
|
-
result
|
|
606
|
-
.then(resolve)
|
|
607
|
-
.catch(function () {
|
|
608
|
-
fallbackToWebkitVideo();
|
|
609
|
-
});
|
|
610
|
-
return;
|
|
611
617
|
}
|
|
612
|
-
return resolve();
|
|
613
618
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
return request(target);
|
|
621
|
-
}
|
|
622
|
-
bridgeEvents();
|
|
623
|
-
return {
|
|
624
|
-
get supported() {
|
|
625
|
-
return getEnabled();
|
|
626
|
-
},
|
|
627
|
-
get element() {
|
|
628
|
-
return getElement();
|
|
629
|
-
},
|
|
630
|
-
get isPip() {
|
|
631
|
-
return getIsPip();
|
|
632
|
-
},
|
|
633
|
-
request: request,
|
|
634
|
-
exit: exit,
|
|
635
|
-
toggle: toggle,
|
|
636
|
-
onChange: onChangeSubscriptionManager.subscribe,
|
|
637
|
-
onError: onErrorSubscriptionManager.subscribe,
|
|
638
|
-
Constants: {},
|
|
639
|
-
Errors: {
|
|
640
|
-
NotSupportedError: NotSupportedError,
|
|
641
|
-
},
|
|
642
|
-
};
|
|
619
|
+
if (globalThis.document.pictureInPictureElement === null || typeof globalThis.document.pictureInPictureElement === 'undefined')
|
|
620
|
+
return resolve();
|
|
621
|
+
reject(new NotSupportedError('Failed to exit Picture-in-Picture mode.'));
|
|
622
|
+
}
|
|
623
|
+
fallbackToWebkit();
|
|
624
|
+
});
|
|
643
625
|
}
|
|
644
|
-
|
|
626
|
+
bridgeEvents();
|
|
645
627
|
|
|
646
628
|
export { Pip as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
export declare interface BadgeInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
set(contents: number): Promise<void>;
|
|
4
5
|
clear(): Promise<void>;
|
|
5
|
-
get supported(): boolean;
|
|
6
6
|
Constants: {};
|
|
7
7
|
Errors: {
|
|
8
8
|
NotSupportedError: typeof NotSupportedError;
|
|
@@ -16,8 +16,8 @@ export interface BatteryManager extends EventTarget {
|
|
|
16
16
|
onlevelchange: ((this: BatteryManager, ev: Event) => any) | null;
|
|
17
17
|
}
|
|
18
18
|
export declare interface BatteryInstance {
|
|
19
|
-
get value(): Promise<BatteryManager>;
|
|
20
19
|
get supported(): boolean;
|
|
20
|
+
get value(): Promise<BatteryManager>;
|
|
21
21
|
onChange(listener: (battery: BatteryManager) => void, options?: AddEventListenerOptions): () => void;
|
|
22
22
|
Constants: {};
|
|
23
23
|
Errors: {
|
|
@@ -7,7 +7,6 @@ declare global {
|
|
|
7
7
|
webkitDisplayingFullscreen?: boolean;
|
|
8
8
|
onwebkitbeginfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
9
9
|
onwebkitendfullscreen?: ((this: HTMLVideoElement, ev: Event) => any) | null;
|
|
10
|
-
[key: symbol]: boolean | undefined;
|
|
11
10
|
}
|
|
12
11
|
interface Document {
|
|
13
12
|
readonly fullscreenEnabled: boolean;
|
|
@@ -32,6 +31,7 @@ declare global {
|
|
|
32
31
|
mozRequestFullScreen?: () => Promise<void>;
|
|
33
32
|
msRequestFullscreen?: () => Promise<void>;
|
|
34
33
|
}
|
|
34
|
+
var __nativeFnFsBridgeKey__: symbol | undefined;
|
|
35
35
|
}
|
|
36
|
-
declare const
|
|
37
|
-
export default
|
|
36
|
+
declare const Fullscreen: FullscreenInstance;
|
|
37
|
+
export default Fullscreen;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
|
+
import { InvalidStateError } from "../../../errors/invalid-state-error";
|
|
2
3
|
export declare interface FullscreenInstance {
|
|
3
4
|
supported: boolean;
|
|
4
5
|
element: Element | null;
|
|
5
6
|
isFullscreen: boolean;
|
|
6
7
|
request(target?: Element, options?: FullscreenOptions): Promise<void>;
|
|
7
8
|
exit(): Promise<void>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
onError(listener: (event: Event) => void, options?: AddEventListenerOptions): () => void;
|
|
9
|
+
onChange(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
10
|
+
onError(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
11
11
|
Constants: {};
|
|
12
12
|
Errors: {
|
|
13
13
|
NotSupportedError: typeof NotSupportedError;
|
|
14
|
+
InvalidStateError: typeof InvalidStateError;
|
|
14
15
|
};
|
|
15
16
|
}
|
|
17
|
+
export declare interface FullscreenEventPayload {
|
|
18
|
+
nativeEvent: Event;
|
|
19
|
+
element: Element;
|
|
20
|
+
isFullscreen: boolean;
|
|
21
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
2
|
import { PermissionNotGrantedError } from "../../../errors/permission-not-granted-error";
|
|
3
3
|
export declare interface GeolocationInstance {
|
|
4
|
-
get value(): Promise<GeolocationCoordinates>;
|
|
5
4
|
get supported(): boolean;
|
|
5
|
+
get value(): Promise<GeolocationCoordinates>;
|
|
6
6
|
onChange(listener: (coordinates: GeolocationCoordinates) => void, options?: AddEventListenerOptions): () => void;
|
|
7
7
|
Constants: {};
|
|
8
8
|
Errors: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppOpenState, CameraType, CaptureType, DirectoryExploreMode, ExplorerStartIn, SettingType } from "../constants";
|
|
2
|
-
import { OS } from "../../platform
|
|
2
|
+
import { OS } from "../../platform";
|
|
3
3
|
import { URLOpenError } from "../errors/url-open-error";
|
|
4
4
|
import { UserCancelledError } from "../errors/user-cancel-error";
|
|
5
5
|
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PermissionState, PermissionType } from "../constants";
|
|
2
2
|
export declare interface PermissionInstance {
|
|
3
|
+
get supported(): boolean;
|
|
3
4
|
request(type: PermissionType): Promise<PermissionState>;
|
|
4
5
|
check(type: PermissionType): Promise<PermissionState>;
|
|
5
6
|
Constants: {
|