native-fn 1.3.0 → 1.3.1
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 +159 -41
- package/dist/index.d.ts +117 -88
- package/dist/native.cjs +464 -244
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +464 -244
- package/dist/native.umd.js +464 -244
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/appearance/index.cjs +49 -46
- package/dist/plugin/appearance/index.d.ts +3 -3
- package/dist/plugin/appearance/index.mjs +49 -46
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/appearance/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/appearance/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/appearance/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/appearance/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/appearance/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/appearance/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/appearance/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/appearance/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/badge/index.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/badge/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/badge/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/badge/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/badge/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/badge/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/badge/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/badge/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/badge/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/badge/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/badge/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/badge/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/badge/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/badge/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/badge/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/badge/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/battery/index.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/battery/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/battery/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/battery/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/battery/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/battery/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/battery/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/battery/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/battery/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/battery/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/battery/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/battery/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/battery/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/battery/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/battery/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/battery/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/clipboard/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/clipboard/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/clipboard/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/clipboard/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/clipboard/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/clipboard/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/clipboard/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/clipboard/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/clipboard/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/clipboard/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/dimension/index.cjs +310 -80
- package/dist/plugin/dimension/index.d.ts +48 -19
- package/dist/plugin/dimension/index.mjs +310 -80
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/dimension/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/dimension/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/dimension/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/dimension/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/dimension/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/dimension/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/dimension/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/dimension/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/fullscreen/index.cjs +87 -80
- package/dist/plugin/fullscreen/index.d.ts +7 -7
- package/dist/plugin/fullscreen/index.mjs +87 -80
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/fullscreen/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/fullscreen/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/fullscreen/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/fullscreen/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/fullscreen/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/fullscreen/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/fullscreen/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/fullscreen/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/geolocation/index.cjs +245 -176
- package/dist/plugin/geolocation/index.d.ts +4 -4
- package/dist/plugin/geolocation/index.mjs +245 -176
- package/dist/plugin/geolocation/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/geolocation/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/geolocation/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/geolocation/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/geolocation/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/geolocation/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/geolocation/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/geolocation/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/geolocation/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/geolocation/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/geolocation/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/geolocation/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/geolocation/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/geolocation/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/geolocation/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/geolocation/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/notification/index.cjs +288 -13
- package/dist/plugin/notification/index.d.ts +4 -4
- package/dist/plugin/notification/index.mjs +288 -13
- package/dist/plugin/notification/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/notification/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/notification/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/notification/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/notification/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/notification/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/notification/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/notification/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/notification/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/notification/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/notification/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/notification/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/notification/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/notification/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/notification/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/notification/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/open/index.cjs +58 -49
- package/dist/plugin/open/index.d.ts +12 -12
- package/dist/plugin/open/index.mjs +58 -49
- package/dist/plugin/open/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/open/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/open/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/open/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/open/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/open/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/open/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/open/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/open/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/open/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/open/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/open/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/open/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/open/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/open/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/open/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/open/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/open/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/permission/index.cjs +372 -13
- package/dist/plugin/permission/index.d.ts +11 -5
- package/dist/plugin/permission/index.mjs +372 -13
- package/dist/plugin/permission/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/permission/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/permission/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/permission/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/permission/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/permission/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/permission/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/permission/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/permission/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/permission/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/permission/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/permission/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/permission/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/permission/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/permission/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/permission/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/pip/index.cjs +49 -46
- package/dist/plugin/pip/index.d.ts +7 -7
- package/dist/plugin/pip/index.mjs +49 -46
- package/dist/plugin/pip/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/pip/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/pip/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/pip/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/pip/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/pip/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/pip/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/pip/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/pip/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/pip/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/pip/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/pip/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/pip/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/pip/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/pip/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/pip/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/platform/index.cjs +87 -80
- package/dist/plugin/platform/index.d.ts +13 -13
- package/dist/plugin/platform/index.mjs +87 -80
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/platform/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/platform/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/platform/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/platform/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/platform/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/platform/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/platform/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +58 -49
- package/dist/plugin/theme/index.d.ts +2 -2
- package/dist/plugin/theme/index.mjs +58 -49
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/theme/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/theme/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/theme/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/theme/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/theme/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/theme/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/theme/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/plugin/vibration/index.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/plugin/vibration/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/plugin/vibration/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/plugin/vibration/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/plugin/vibration/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/plugin/vibration/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/plugin/vibration/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/plugin/vibration/src/plugin/open/types/open.d.ts +12 -12
- package/dist/plugin/vibration/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/plugin/vibration/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/plugin/vibration/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/plugin/vibration/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/plugin/vibration/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/plugin/vibration/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/plugin/vibration/src/types/subscription-manager.d.ts +3 -3
- package/dist/plugin/vibration/src/utils/create-subscription-manager.d.ts +1 -1
- package/dist/src/plugin/appearance/types/appearance.d.ts +3 -3
- package/dist/src/plugin/badge/types/badge.d.ts +3 -3
- package/dist/src/plugin/battery/types/battery.d.ts +3 -3
- package/dist/src/plugin/clipboard/types/clipboard.d.ts +2 -2
- package/dist/src/plugin/dimension/constants/index.d.ts +8 -3
- package/dist/src/plugin/dimension/types/dimensions.d.ts +37 -15
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
- package/dist/src/plugin/geolocation/types/geolocation.d.ts +4 -4
- package/dist/src/plugin/notification/types/notification.d.ts +4 -4
- package/dist/src/plugin/open/types/open.d.ts +12 -12
- package/dist/src/plugin/permission/constants/index.d.ts +3 -1
- package/dist/src/plugin/permission/types/permission.d.ts +7 -4
- package/dist/src/plugin/pip/types/pip.d.ts +7 -7
- package/dist/src/plugin/platform/types/platform.d.ts +13 -13
- package/dist/src/plugin/theme/types/theme.d.ts +2 -2
- package/dist/src/plugin/vibration/types/vibration.d.ts +3 -3
- package/dist/src/types/subscription-manager.d.ts +3 -3
- package/dist/src/utils/create-subscription-manager.d.ts +1 -1
- package/package.json +1 -1
|
@@ -11,14 +11,14 @@ export declare interface FullscreenInstance {
|
|
|
11
11
|
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
12
|
onError(listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
13
|
onChange(target: Element, listener: (payload: FullscreenEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
14
|
-
Constants: {};
|
|
15
|
-
Errors: {
|
|
16
|
-
NotSupportedError: typeof NotSupportedError;
|
|
17
|
-
InvalidStateError: typeof InvalidStateError;
|
|
14
|
+
readonly Constants: {};
|
|
15
|
+
readonly Errors: {
|
|
16
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
readonly InvalidStateError: typeof InvalidStateError;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export declare interface FullscreenEventPayload {
|
|
21
|
-
nativeEvent: Event;
|
|
22
|
-
element: Element;
|
|
23
|
-
isActive: boolean;
|
|
21
|
+
readonly nativeEvent: Event;
|
|
22
|
+
readonly element: Element;
|
|
23
|
+
readonly isActive: boolean;
|
|
24
24
|
}
|
|
@@ -4,9 +4,9 @@ export declare interface GeolocationInstance {
|
|
|
4
4
|
get supported(): boolean;
|
|
5
5
|
get value(): Promise<GeolocationCoordinates>;
|
|
6
6
|
onChange(listener: (coordinates: GeolocationCoordinates) => void, options?: AddEventListenerOptions): () => void;
|
|
7
|
-
Constants: {};
|
|
8
|
-
Errors: {
|
|
9
|
-
NotSupportedError: typeof NotSupportedError;
|
|
10
|
-
PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
7
|
+
readonly Constants: {};
|
|
8
|
+
readonly Errors: {
|
|
9
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
10
|
+
readonly PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
@@ -19,9 +19,9 @@ export interface NotificationOptions {
|
|
|
19
19
|
export declare interface NotificationInstance {
|
|
20
20
|
send(options: NotificationOptions): Promise<Notification>;
|
|
21
21
|
get supported(): boolean;
|
|
22
|
-
Constants: {};
|
|
23
|
-
Errors: {
|
|
24
|
-
NotSupportedError: typeof NotSupportedError;
|
|
25
|
-
PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
22
|
+
readonly Constants: {};
|
|
23
|
+
readonly Errors: {
|
|
24
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
25
|
+
readonly PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -82,8 +82,8 @@ export interface DirectoryOptions {
|
|
|
82
82
|
startIn?: ExplorerStartIn;
|
|
83
83
|
}
|
|
84
84
|
export interface FileWithPath {
|
|
85
|
-
file: File;
|
|
86
|
-
relativePath: string;
|
|
85
|
+
readonly file: File;
|
|
86
|
+
readonly relativePath: string;
|
|
87
87
|
}
|
|
88
88
|
export interface CameraOptions {
|
|
89
89
|
type?: CameraType;
|
|
@@ -175,7 +175,7 @@ export declare interface OpenInstance {
|
|
|
175
175
|
contact(options?: ContactOptions): Promise<Contact[]>;
|
|
176
176
|
share(options: ShareData): Promise<void>;
|
|
177
177
|
calendar(options: CalendarOptions): void;
|
|
178
|
-
supported: {
|
|
178
|
+
readonly supported: {
|
|
179
179
|
get intent(): boolean;
|
|
180
180
|
get universal(): boolean;
|
|
181
181
|
get setting(): boolean;
|
|
@@ -185,15 +185,15 @@ export declare interface OpenInstance {
|
|
|
185
185
|
get share(): boolean;
|
|
186
186
|
get calendar(): boolean;
|
|
187
187
|
};
|
|
188
|
-
Constants: {
|
|
189
|
-
AppOpenState: typeof AppOpenState;
|
|
190
|
-
SettingType: typeof SettingType;
|
|
191
|
-
CameraType: typeof CameraType;
|
|
192
|
-
CaptureType: typeof CaptureType;
|
|
188
|
+
readonly Constants: {
|
|
189
|
+
readonly AppOpenState: typeof AppOpenState;
|
|
190
|
+
readonly SettingType: typeof SettingType;
|
|
191
|
+
readonly CameraType: typeof CameraType;
|
|
192
|
+
readonly CaptureType: typeof CaptureType;
|
|
193
193
|
};
|
|
194
|
-
Errors: {
|
|
195
|
-
URLOpenError: typeof URLOpenError;
|
|
196
|
-
NotSupportedError: typeof NotSupportedError;
|
|
197
|
-
UserCancelledError: typeof UserCancelledError;
|
|
194
|
+
readonly Errors: {
|
|
195
|
+
readonly URLOpenError: typeof URLOpenError;
|
|
196
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
197
|
+
readonly UserCancelledError: typeof UserCancelledError;
|
|
198
198
|
};
|
|
199
199
|
}
|
|
@@ -12,7 +12,9 @@ export declare enum PermissionType {
|
|
|
12
12
|
Camera = "camera",
|
|
13
13
|
ClipboardRead = "clipboard-read",
|
|
14
14
|
Microphone = "microphone",
|
|
15
|
-
MIDI = "midi"
|
|
15
|
+
MIDI = "midi",
|
|
16
|
+
DeviceOrientation = "device-orientation",
|
|
17
|
+
DeviceMotion = "device-motion"
|
|
16
18
|
}
|
|
17
19
|
export declare enum PermissionState {
|
|
18
20
|
Grant = "grant",
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { PermissionState, PermissionType } from "../constants";
|
|
2
|
+
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
2
3
|
export declare interface PermissionInstance {
|
|
3
4
|
get supported(): boolean;
|
|
4
5
|
request(type: PermissionType): Promise<PermissionState>;
|
|
5
6
|
check(type: PermissionType): Promise<PermissionState>;
|
|
6
|
-
Constants: {
|
|
7
|
-
PermissionType: typeof PermissionType;
|
|
8
|
-
PermissionState: typeof PermissionState;
|
|
7
|
+
readonly Constants: {
|
|
8
|
+
readonly PermissionType: typeof PermissionType;
|
|
9
|
+
readonly PermissionState: typeof PermissionState;
|
|
10
|
+
};
|
|
11
|
+
readonly Errors: {
|
|
12
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
9
13
|
};
|
|
10
|
-
Errors: {};
|
|
11
14
|
}
|
|
@@ -11,14 +11,14 @@ export declare interface PipInstance {
|
|
|
11
11
|
onChange(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
12
12
|
onError(listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
13
13
|
onError(target: HTMLVideoElement, listener: (payload: PipEventPayload) => void, options?: AddEventListenerOptions): () => void;
|
|
14
|
-
Constants: {};
|
|
15
|
-
Errors: {
|
|
16
|
-
NotSupportedError: typeof NotSupportedError;
|
|
17
|
-
InvalidStateError: typeof InvalidStateError;
|
|
14
|
+
readonly Constants: {};
|
|
15
|
+
readonly Errors: {
|
|
16
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
17
|
+
readonly InvalidStateError: typeof InvalidStateError;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export declare interface PipEventPayload {
|
|
21
|
-
nativeEvent: Event;
|
|
22
|
-
element: HTMLVideoElement;
|
|
23
|
-
isActive: boolean;
|
|
21
|
+
readonly nativeEvent: Event;
|
|
22
|
+
readonly element: HTMLVideoElement;
|
|
23
|
+
readonly isActive: boolean;
|
|
24
24
|
}
|
|
@@ -14,24 +14,24 @@ export declare interface PlatformInstance {
|
|
|
14
14
|
get isNode(): boolean;
|
|
15
15
|
get isStandalone(): boolean;
|
|
16
16
|
get isWebview(): boolean;
|
|
17
|
-
Constants: {
|
|
18
|
-
OS: typeof OS;
|
|
19
|
-
Engines: typeof Engines;
|
|
20
|
-
Browsers: typeof Browsers;
|
|
21
|
-
Devices: typeof Devices;
|
|
17
|
+
readonly Constants: {
|
|
18
|
+
readonly OS: typeof OS;
|
|
19
|
+
readonly Engines: typeof Engines;
|
|
20
|
+
readonly Browsers: typeof Browsers;
|
|
21
|
+
readonly Devices: typeof Devices;
|
|
22
22
|
};
|
|
23
|
-
Errors: {};
|
|
23
|
+
readonly Errors: {};
|
|
24
24
|
}
|
|
25
25
|
export declare interface NameVersionPair<T> {
|
|
26
|
-
name: T;
|
|
27
|
-
version: string;
|
|
26
|
+
readonly name: T;
|
|
27
|
+
readonly version: string;
|
|
28
28
|
}
|
|
29
29
|
export declare interface Locale {
|
|
30
|
-
language: string | null;
|
|
31
|
-
languages: string[];
|
|
32
|
-
timezone: string | null;
|
|
33
|
-
offset: number;
|
|
34
|
-
isRTL: boolean;
|
|
30
|
+
readonly language: string | null;
|
|
31
|
+
readonly languages: readonly string[];
|
|
32
|
+
readonly timezone: string | null;
|
|
33
|
+
readonly offset: number;
|
|
34
|
+
readonly isRTL: boolean;
|
|
35
35
|
}
|
|
36
36
|
export interface GPUAdapterInfo {
|
|
37
37
|
readonly vendor?: string;
|
|
@@ -3,8 +3,8 @@ export declare interface VibrationInstance {
|
|
|
3
3
|
get supported(): boolean;
|
|
4
4
|
run(pattern: number | number[]): boolean;
|
|
5
5
|
stop(): boolean;
|
|
6
|
-
Constants: {};
|
|
7
|
-
Errors: {
|
|
8
|
-
NotSupportedError: typeof NotSupportedError;
|
|
6
|
+
readonly Constants: {};
|
|
7
|
+
readonly Errors: {
|
|
8
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare interface SubscriptionManager<T
|
|
2
|
-
emit: (value:
|
|
3
|
-
subscribe: (listener: (value:
|
|
1
|
+
export declare interface SubscriptionManager<T> {
|
|
2
|
+
emit: (value: T) => void;
|
|
3
|
+
subscribe: (listener: (value: T) => void, options?: AddEventListenerOptions) => () => void;
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SubscriptionManager } from "../types/subscription-manager";
|
|
2
|
-
export default function createSubscriptionManager<T
|
|
2
|
+
export default function createSubscriptionManager<T>(attach: () => void, detach: () => void): SubscriptionManager<T>;
|
|
@@ -10,6 +10,8 @@ exports.PermissionType = void 0;
|
|
|
10
10
|
PermissionType["ClipboardRead"] = "clipboard-read";
|
|
11
11
|
PermissionType["Microphone"] = "microphone";
|
|
12
12
|
PermissionType["MIDI"] = "midi";
|
|
13
|
+
PermissionType["DeviceOrientation"] = "device-orientation";
|
|
14
|
+
PermissionType["DeviceMotion"] = "device-motion";
|
|
13
15
|
})(exports.PermissionType || (exports.PermissionType = {}));
|
|
14
16
|
exports.PermissionState = void 0;
|
|
15
17
|
(function (PermissionState) {
|
|
@@ -41,6 +43,296 @@ var GET_USER_MEDIA = (function () {
|
|
|
41
43
|
}
|
|
42
44
|
})();
|
|
43
45
|
|
|
46
|
+
var IE_WRAPPER_STORE = [];
|
|
47
|
+
var MEDIA_QUERY_LIST_WRAPPER_STORE = [];
|
|
48
|
+
function isEventListenerCallback(callback) {
|
|
49
|
+
return (typeof callback === 'function' ||
|
|
50
|
+
(typeof callback === 'object' && callback !== null && typeof callback.handleEvent === 'function'));
|
|
51
|
+
}
|
|
52
|
+
function isMediaQueryListTarget(target) {
|
|
53
|
+
return typeof target.media === 'string' && typeof target.matches === 'boolean';
|
|
54
|
+
}
|
|
55
|
+
function findIEWrapper(target, type, callback) {
|
|
56
|
+
for (var i = 0; i < IE_WRAPPER_STORE.length; i++) {
|
|
57
|
+
var wrapper = IE_WRAPPER_STORE[i];
|
|
58
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback)
|
|
59
|
+
return wrapper.wrapper;
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
function setIEWrapper(target, type, callback, wrapper) {
|
|
64
|
+
IE_WRAPPER_STORE.push({ target: target, type: type, callback: callback, wrapper: wrapper });
|
|
65
|
+
}
|
|
66
|
+
function removeIEWrapper(target, type, callback) {
|
|
67
|
+
for (var i = 0; i < IE_WRAPPER_STORE.length; i++) {
|
|
68
|
+
var wrapper = IE_WRAPPER_STORE[i];
|
|
69
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback) {
|
|
70
|
+
IE_WRAPPER_STORE.splice(i, 1);
|
|
71
|
+
return wrapper.wrapper;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
function findMediaQueryListWrapper(target, type, callback) {
|
|
77
|
+
for (var i = 0; i < MEDIA_QUERY_LIST_WRAPPER_STORE.length; i++) {
|
|
78
|
+
var wrapper = MEDIA_QUERY_LIST_WRAPPER_STORE[i];
|
|
79
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback)
|
|
80
|
+
return wrapper.wrapper;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
function setMediaQueryListWrapper(target, type, callback, wrapper) {
|
|
85
|
+
MEDIA_QUERY_LIST_WRAPPER_STORE.push({ target: target, type: type, callback: callback, wrapper: wrapper });
|
|
86
|
+
}
|
|
87
|
+
function removeMediaQueryListWrapper(target, type, callback) {
|
|
88
|
+
for (var i = 0; i < MEDIA_QUERY_LIST_WRAPPER_STORE.length; i++) {
|
|
89
|
+
var wrapper = MEDIA_QUERY_LIST_WRAPPER_STORE[i];
|
|
90
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback) {
|
|
91
|
+
MEDIA_QUERY_LIST_WRAPPER_STORE.splice(i, 1);
|
|
92
|
+
return wrapper.wrapper;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
function createMediaQueryListWrapper(callback) {
|
|
98
|
+
return function (event) {
|
|
99
|
+
if (typeof callback === 'function') {
|
|
100
|
+
callback.call(this, event);
|
|
101
|
+
}
|
|
102
|
+
else if (callback && typeof callback.handleEvent === 'function') {
|
|
103
|
+
callback.handleEvent(event);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function capitalize(_) {
|
|
108
|
+
var groups = [];
|
|
109
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
110
|
+
groups[_i - 1] = arguments[_i];
|
|
111
|
+
}
|
|
112
|
+
var result = '';
|
|
113
|
+
for (var i = 0; i < groups.length - 2; i++) {
|
|
114
|
+
var arg = groups[i];
|
|
115
|
+
if (typeof arg !== 'undefined')
|
|
116
|
+
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
function withVendor(target, type) {
|
|
121
|
+
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
122
|
+
return type;
|
|
123
|
+
if (typeof target.webkitEnterFullscreen === 'function' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
124
|
+
return type;
|
|
125
|
+
var types;
|
|
126
|
+
if (typeof LEGACY_TYPE_MAP[type] !== 'undefined')
|
|
127
|
+
types = LEGACY_TYPE_MAP[type];
|
|
128
|
+
else if (EVENT_TYPE_REGEXP.test(type))
|
|
129
|
+
types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
|
|
130
|
+
else
|
|
131
|
+
types = [type];
|
|
132
|
+
for (var i = 0; i < VENDORS.length; i++) {
|
|
133
|
+
for (var j = 0; j < types.length; j++) {
|
|
134
|
+
var name_1 = VENDORS[i] + types[j];
|
|
135
|
+
if (typeof target['on' + name_1] !== 'undefined')
|
|
136
|
+
return name_1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return type;
|
|
140
|
+
}
|
|
141
|
+
function preventDefaultPolyfill() {
|
|
142
|
+
this.returnValue = false;
|
|
143
|
+
}
|
|
144
|
+
function stopPropagationPolyfill() {
|
|
145
|
+
this.cancelBubble = true;
|
|
146
|
+
}
|
|
147
|
+
var EVENT_TYPE_REGEXP = /(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i;
|
|
148
|
+
var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
|
|
149
|
+
var LEGACY_TYPE_MAP = {
|
|
150
|
+
'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
|
|
151
|
+
'focus': ['focus', 'focusin'],
|
|
152
|
+
'blur': ['blur', 'focusout'],
|
|
153
|
+
'beforeinput': ['beforeinput', 'textInput'],
|
|
154
|
+
};
|
|
155
|
+
var EventListener = {
|
|
156
|
+
useStd: typeof globalThis.document.addEventListener === 'function',
|
|
157
|
+
add: function (target, eventListenerOptions) {
|
|
158
|
+
if (typeof eventListenerOptions.type === 'undefined')
|
|
159
|
+
return;
|
|
160
|
+
if (typeof target === 'undefined')
|
|
161
|
+
return;
|
|
162
|
+
var callback = eventListenerOptions.callback;
|
|
163
|
+
var type = withVendor(target, eventListenerOptions.type);
|
|
164
|
+
var options = eventListenerOptions.options;
|
|
165
|
+
if (isMediaQueryListTarget(target)) {
|
|
166
|
+
if (typeof target.addListener === 'function') {
|
|
167
|
+
try {
|
|
168
|
+
var wrapper = findMediaQueryListWrapper(target, type, callback);
|
|
169
|
+
if (typeof wrapper === 'undefined') {
|
|
170
|
+
setMediaQueryListWrapper(target, type, callback, wrapper = createMediaQueryListWrapper(callback));
|
|
171
|
+
}
|
|
172
|
+
return target.addListener(wrapper);
|
|
173
|
+
}
|
|
174
|
+
catch (_) {
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (typeof target.addEventListener === 'function') {
|
|
179
|
+
try {
|
|
180
|
+
if (isEventListenerCallback(callback)) {
|
|
181
|
+
return target.addEventListener(type, callback, options);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (_) {
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (typeof target.attachEvent === 'function') {
|
|
188
|
+
var existing = findIEWrapper(target, type, callback);
|
|
189
|
+
if (typeof existing === 'function')
|
|
190
|
+
return;
|
|
191
|
+
var wrapper = function (event) {
|
|
192
|
+
if (typeof event === 'undefined')
|
|
193
|
+
event = globalThis.event;
|
|
194
|
+
if (typeof event === 'undefined')
|
|
195
|
+
return;
|
|
196
|
+
try {
|
|
197
|
+
Object.defineProperty(event, 'currentTarget', { value: target, configurable: true });
|
|
198
|
+
}
|
|
199
|
+
catch (_) {
|
|
200
|
+
}
|
|
201
|
+
if (typeof event.preventDefault !== 'function')
|
|
202
|
+
event.preventDefault = preventDefaultPolyfill.bind(event);
|
|
203
|
+
if (typeof event.stopPropagation !== 'function')
|
|
204
|
+
event.stopPropagation = stopPropagationPolyfill.bind(event);
|
|
205
|
+
if (typeof callback === 'function')
|
|
206
|
+
callback.call(target, event);
|
|
207
|
+
else if (callback && typeof callback.handleEvent === 'function')
|
|
208
|
+
callback.handleEvent(event);
|
|
209
|
+
};
|
|
210
|
+
setIEWrapper(target, type, callback, wrapper);
|
|
211
|
+
return target.attachEvent('on' + type, wrapper);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
remove: function (target, eventListenerOptions) {
|
|
215
|
+
if (typeof eventListenerOptions.type === 'undefined')
|
|
216
|
+
return;
|
|
217
|
+
if (typeof target === 'undefined')
|
|
218
|
+
return;
|
|
219
|
+
var callback = eventListenerOptions.callback;
|
|
220
|
+
var type = withVendor(target, eventListenerOptions.type);
|
|
221
|
+
var options = eventListenerOptions.options;
|
|
222
|
+
if (isMediaQueryListTarget(target)) {
|
|
223
|
+
if (typeof target.removeListener === 'function') {
|
|
224
|
+
try {
|
|
225
|
+
var wrapper = removeMediaQueryListWrapper(target, type, callback);
|
|
226
|
+
if (typeof wrapper === 'function')
|
|
227
|
+
return target.removeListener(wrapper);
|
|
228
|
+
}
|
|
229
|
+
catch (_) {
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
if (typeof target.removeEventListener === 'function') {
|
|
235
|
+
try {
|
|
236
|
+
if (isEventListenerCallback(callback)) {
|
|
237
|
+
return target.removeEventListener(type, callback, options);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (_) {
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (typeof target.detachEvent === 'function') {
|
|
244
|
+
var wrapper = removeIEWrapper(target, type, callback);
|
|
245
|
+
if (typeof wrapper === 'function')
|
|
246
|
+
target.detachEvent('on' + type, wrapper);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
function createCustomError(name, Base) {
|
|
253
|
+
if (Base === void 0) { Base = Error; }
|
|
254
|
+
function CustomError(message) {
|
|
255
|
+
if (!(this instanceof CustomError))
|
|
256
|
+
return new CustomError(message);
|
|
257
|
+
var error = (function () {
|
|
258
|
+
if (typeof message === 'undefined')
|
|
259
|
+
return new Base('');
|
|
260
|
+
return new Base(message);
|
|
261
|
+
})();
|
|
262
|
+
if (typeof Object.setPrototypeOf === 'function')
|
|
263
|
+
Object.setPrototypeOf(error, CustomError.prototype);
|
|
264
|
+
else
|
|
265
|
+
error.__proto__ = CustomError.prototype;
|
|
266
|
+
error.name = name;
|
|
267
|
+
if (typeof message !== 'undefined')
|
|
268
|
+
error.message = message;
|
|
269
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
270
|
+
try {
|
|
271
|
+
Object.defineProperty(error, Symbol.toStringTag, {
|
|
272
|
+
value: name,
|
|
273
|
+
writable: false,
|
|
274
|
+
enumerable: false,
|
|
275
|
+
configurable: true
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
catch (_) {
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
282
|
+
Error.captureStackTrace(error, CustomError);
|
|
283
|
+
}
|
|
284
|
+
else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
|
|
285
|
+
Base.captureStackTrace(error, CustomError);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
try {
|
|
289
|
+
var tempError = new Base();
|
|
290
|
+
if (tempError.stack)
|
|
291
|
+
error.stack = tempError.stack;
|
|
292
|
+
}
|
|
293
|
+
catch (_) {
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return error;
|
|
297
|
+
}
|
|
298
|
+
CustomError.prototype = Object.create(Base.prototype, {
|
|
299
|
+
constructor: {
|
|
300
|
+
value: CustomError,
|
|
301
|
+
writable: true,
|
|
302
|
+
enumerable: false,
|
|
303
|
+
configurable: true
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
try {
|
|
307
|
+
Object.defineProperty(CustomError.prototype, 'name', {
|
|
308
|
+
value: name,
|
|
309
|
+
writable: true,
|
|
310
|
+
enumerable: false,
|
|
311
|
+
configurable: true
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
catch (_) {
|
|
315
|
+
try {
|
|
316
|
+
CustomError.prototype.name = name;
|
|
317
|
+
}
|
|
318
|
+
catch (_) {
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
try {
|
|
322
|
+
Object.defineProperty(CustomError, 'name', {
|
|
323
|
+
value: name,
|
|
324
|
+
writable: false,
|
|
325
|
+
enumerable: false,
|
|
326
|
+
configurable: true
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
catch (_) {
|
|
330
|
+
}
|
|
331
|
+
return CustomError;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
var NotSupportedError = createCustomError('NotSupportedError');
|
|
335
|
+
|
|
44
336
|
var Permission = {
|
|
45
337
|
get supported() {
|
|
46
338
|
return supported();
|
|
@@ -51,14 +343,45 @@ var Permission = {
|
|
|
51
343
|
PermissionType: exports.PermissionType,
|
|
52
344
|
PermissionState: exports.PermissionState,
|
|
53
345
|
},
|
|
54
|
-
Errors: {
|
|
346
|
+
Errors: {
|
|
347
|
+
NotSupportedError: NotSupportedError,
|
|
348
|
+
},
|
|
55
349
|
};
|
|
350
|
+
function toPermissionState(permission) {
|
|
351
|
+
switch (permission) {
|
|
352
|
+
case 'granted':
|
|
353
|
+
return exports.PermissionState.Grant;
|
|
354
|
+
case 'denied':
|
|
355
|
+
return exports.PermissionState.Denied;
|
|
356
|
+
case 'prompt':
|
|
357
|
+
case 'default':
|
|
358
|
+
return exports.PermissionState.Prompt;
|
|
359
|
+
default:
|
|
360
|
+
return exports.PermissionState.Unsupported;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function toSafariSensorEventMap(type) {
|
|
364
|
+
switch (type) {
|
|
365
|
+
case exports.PermissionType.DeviceOrientation:
|
|
366
|
+
return {
|
|
367
|
+
event: globalThis.DeviceOrientationEvent,
|
|
368
|
+
type: 'deviceorientation',
|
|
369
|
+
};
|
|
370
|
+
case exports.PermissionType.DeviceMotion:
|
|
371
|
+
return {
|
|
372
|
+
event: globalThis.DeviceMotionEvent,
|
|
373
|
+
type: 'devicemotion',
|
|
374
|
+
};
|
|
375
|
+
default:
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
56
379
|
function supported() {
|
|
57
380
|
return typeof globalThis.navigator.permissions !== 'undefined';
|
|
58
381
|
}
|
|
59
382
|
function request(type) {
|
|
60
383
|
var instance = this;
|
|
61
|
-
return new Promise(function (resolve) {
|
|
384
|
+
return new Promise(function (resolve, reject) {
|
|
62
385
|
function resolveAfterCheck() {
|
|
63
386
|
instance.check(type).then(resolve);
|
|
64
387
|
}
|
|
@@ -70,17 +393,8 @@ function request(type) {
|
|
|
70
393
|
case exports.PermissionType.Notification:
|
|
71
394
|
if (typeof globalThis.Notification === 'undefined')
|
|
72
395
|
return resolve(exports.PermissionState.Unsupported);
|
|
73
|
-
globalThis.Notification.requestPermission().then(function (
|
|
74
|
-
|
|
75
|
-
case 'default':
|
|
76
|
-
return resolve(exports.PermissionState.Prompt);
|
|
77
|
-
case 'granted':
|
|
78
|
-
return resolve(exports.PermissionState.Grant);
|
|
79
|
-
case 'denied':
|
|
80
|
-
return resolve(exports.PermissionState.Denied);
|
|
81
|
-
default:
|
|
82
|
-
resolveAfterCheck();
|
|
83
|
-
}
|
|
396
|
+
globalThis.Notification.requestPermission().then(function (permission) {
|
|
397
|
+
resolve(toPermissionState(permission));
|
|
84
398
|
});
|
|
85
399
|
break;
|
|
86
400
|
case exports.PermissionType.Geolocation:
|
|
@@ -118,6 +432,23 @@ function request(type) {
|
|
|
118
432
|
.then(resolveAfterCheck)
|
|
119
433
|
.catch(resolveAfterCheck);
|
|
120
434
|
break;
|
|
435
|
+
case exports.PermissionType.DeviceOrientation:
|
|
436
|
+
case exports.PermissionType.DeviceMotion:
|
|
437
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
438
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
439
|
+
return resolve(exports.PermissionState.Unsupported);
|
|
440
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
441
|
+
return resolve(exports.PermissionState.Grant);
|
|
442
|
+
try {
|
|
443
|
+
sensorEventMap.event.requestPermission()
|
|
444
|
+
.then(function (permission) {
|
|
445
|
+
resolve(toPermissionState(permission));
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
catch (_) {
|
|
449
|
+
return reject(new NotSupportedError('\'DeviceOrientationEvent.requestPermission()\' must be called within a user gesture context.'));
|
|
450
|
+
}
|
|
451
|
+
break;
|
|
121
452
|
default:
|
|
122
453
|
return resolve(exports.PermissionState.Unsupported);
|
|
123
454
|
}
|
|
@@ -125,6 +456,34 @@ function request(type) {
|
|
|
125
456
|
});
|
|
126
457
|
}
|
|
127
458
|
function check(type) {
|
|
459
|
+
if (type === exports.PermissionType.DeviceOrientation || type === exports.PermissionType.DeviceMotion) {
|
|
460
|
+
return new Promise(function (resolve) {
|
|
461
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
462
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
463
|
+
return resolve(exports.PermissionState.Unsupported);
|
|
464
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
465
|
+
return resolve(exports.PermissionState.Grant);
|
|
466
|
+
var granted = false;
|
|
467
|
+
EventListener.add(globalThis, {
|
|
468
|
+
type: sensorEventMap.type,
|
|
469
|
+
callback: function () {
|
|
470
|
+
granted = true;
|
|
471
|
+
},
|
|
472
|
+
options: { once: true }
|
|
473
|
+
});
|
|
474
|
+
setTimeout(function () {
|
|
475
|
+
if (granted)
|
|
476
|
+
return resolve(exports.PermissionState.Grant);
|
|
477
|
+
sensorEventMap.event.requestPermission()
|
|
478
|
+
.then(function (permission) {
|
|
479
|
+
resolve(toPermissionState(permission));
|
|
480
|
+
})
|
|
481
|
+
.catch(function () {
|
|
482
|
+
resolve(exports.PermissionState.Prompt);
|
|
483
|
+
});
|
|
484
|
+
}, 50);
|
|
485
|
+
});
|
|
486
|
+
}
|
|
128
487
|
return new Promise(function (resolve) {
|
|
129
488
|
if (typeof globalThis.navigator.permissions === 'undefined')
|
|
130
489
|
return resolve(exports.PermissionState.Unsupported);
|