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
|
@@ -12,7 +12,9 @@ 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
|
declare enum PermissionState {
|
|
18
20
|
Grant = "grant",
|
|
@@ -22,15 +24,19 @@ declare enum PermissionState {
|
|
|
22
24
|
}
|
|
23
25
|
declare const GET_USER_MEDIA: ((constraints?: MediaStreamConstraints) => Promise<MediaStream>) | undefined;
|
|
24
26
|
|
|
27
|
+
declare const NotSupportedError: ErrorConstructor;
|
|
28
|
+
|
|
25
29
|
declare interface PermissionInstance {
|
|
26
30
|
get supported(): boolean;
|
|
27
31
|
request(type: PermissionType): Promise<PermissionState>;
|
|
28
32
|
check(type: PermissionType): Promise<PermissionState>;
|
|
29
|
-
Constants: {
|
|
30
|
-
PermissionType: typeof PermissionType;
|
|
31
|
-
PermissionState: typeof PermissionState;
|
|
33
|
+
readonly Constants: {
|
|
34
|
+
readonly PermissionType: typeof PermissionType;
|
|
35
|
+
readonly PermissionState: typeof PermissionState;
|
|
36
|
+
};
|
|
37
|
+
readonly Errors: {
|
|
38
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
32
39
|
};
|
|
33
|
-
Errors: {};
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
declare const Permission: PermissionInstance;
|
|
@@ -6,6 +6,8 @@ var PermissionType;
|
|
|
6
6
|
PermissionType["ClipboardRead"] = "clipboard-read";
|
|
7
7
|
PermissionType["Microphone"] = "microphone";
|
|
8
8
|
PermissionType["MIDI"] = "midi";
|
|
9
|
+
PermissionType["DeviceOrientation"] = "device-orientation";
|
|
10
|
+
PermissionType["DeviceMotion"] = "device-motion";
|
|
9
11
|
})(PermissionType || (PermissionType = {}));
|
|
10
12
|
var PermissionState;
|
|
11
13
|
(function (PermissionState) {
|
|
@@ -37,6 +39,296 @@ var GET_USER_MEDIA = (function () {
|
|
|
37
39
|
}
|
|
38
40
|
})();
|
|
39
41
|
|
|
42
|
+
var IE_WRAPPER_STORE = [];
|
|
43
|
+
var MEDIA_QUERY_LIST_WRAPPER_STORE = [];
|
|
44
|
+
function isEventListenerCallback(callback) {
|
|
45
|
+
return (typeof callback === 'function' ||
|
|
46
|
+
(typeof callback === 'object' && callback !== null && typeof callback.handleEvent === 'function'));
|
|
47
|
+
}
|
|
48
|
+
function isMediaQueryListTarget(target) {
|
|
49
|
+
return typeof target.media === 'string' && typeof target.matches === 'boolean';
|
|
50
|
+
}
|
|
51
|
+
function findIEWrapper(target, type, callback) {
|
|
52
|
+
for (var i = 0; i < IE_WRAPPER_STORE.length; i++) {
|
|
53
|
+
var wrapper = IE_WRAPPER_STORE[i];
|
|
54
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback)
|
|
55
|
+
return wrapper.wrapper;
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
function setIEWrapper(target, type, callback, wrapper) {
|
|
60
|
+
IE_WRAPPER_STORE.push({ target: target, type: type, callback: callback, wrapper: wrapper });
|
|
61
|
+
}
|
|
62
|
+
function removeIEWrapper(target, type, callback) {
|
|
63
|
+
for (var i = 0; i < IE_WRAPPER_STORE.length; i++) {
|
|
64
|
+
var wrapper = IE_WRAPPER_STORE[i];
|
|
65
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback) {
|
|
66
|
+
IE_WRAPPER_STORE.splice(i, 1);
|
|
67
|
+
return wrapper.wrapper;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
function findMediaQueryListWrapper(target, type, callback) {
|
|
73
|
+
for (var i = 0; i < MEDIA_QUERY_LIST_WRAPPER_STORE.length; i++) {
|
|
74
|
+
var wrapper = MEDIA_QUERY_LIST_WRAPPER_STORE[i];
|
|
75
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback)
|
|
76
|
+
return wrapper.wrapper;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
function setMediaQueryListWrapper(target, type, callback, wrapper) {
|
|
81
|
+
MEDIA_QUERY_LIST_WRAPPER_STORE.push({ target: target, type: type, callback: callback, wrapper: wrapper });
|
|
82
|
+
}
|
|
83
|
+
function removeMediaQueryListWrapper(target, type, callback) {
|
|
84
|
+
for (var i = 0; i < MEDIA_QUERY_LIST_WRAPPER_STORE.length; i++) {
|
|
85
|
+
var wrapper = MEDIA_QUERY_LIST_WRAPPER_STORE[i];
|
|
86
|
+
if (wrapper.target === target && wrapper.type === type && wrapper.callback === callback) {
|
|
87
|
+
MEDIA_QUERY_LIST_WRAPPER_STORE.splice(i, 1);
|
|
88
|
+
return wrapper.wrapper;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
function createMediaQueryListWrapper(callback) {
|
|
94
|
+
return function (event) {
|
|
95
|
+
if (typeof callback === 'function') {
|
|
96
|
+
callback.call(this, event);
|
|
97
|
+
}
|
|
98
|
+
else if (callback && typeof callback.handleEvent === 'function') {
|
|
99
|
+
callback.handleEvent(event);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function capitalize(_) {
|
|
104
|
+
var groups = [];
|
|
105
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
106
|
+
groups[_i - 1] = arguments[_i];
|
|
107
|
+
}
|
|
108
|
+
var result = '';
|
|
109
|
+
for (var i = 0; i < groups.length - 2; i++) {
|
|
110
|
+
var arg = groups[i];
|
|
111
|
+
if (typeof arg !== 'undefined')
|
|
112
|
+
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
function withVendor(target, type) {
|
|
117
|
+
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
118
|
+
return type;
|
|
119
|
+
if (typeof target.webkitEnterFullscreen === 'function' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
120
|
+
return type;
|
|
121
|
+
var types;
|
|
122
|
+
if (typeof LEGACY_TYPE_MAP[type] !== 'undefined')
|
|
123
|
+
types = LEGACY_TYPE_MAP[type];
|
|
124
|
+
else if (EVENT_TYPE_REGEXP.test(type))
|
|
125
|
+
types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
|
|
126
|
+
else
|
|
127
|
+
types = [type];
|
|
128
|
+
for (var i = 0; i < VENDORS.length; i++) {
|
|
129
|
+
for (var j = 0; j < types.length; j++) {
|
|
130
|
+
var name_1 = VENDORS[i] + types[j];
|
|
131
|
+
if (typeof target['on' + name_1] !== 'undefined')
|
|
132
|
+
return name_1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return type;
|
|
136
|
+
}
|
|
137
|
+
function preventDefaultPolyfill() {
|
|
138
|
+
this.returnValue = false;
|
|
139
|
+
}
|
|
140
|
+
function stopPropagationPolyfill() {
|
|
141
|
+
this.cancelBubble = true;
|
|
142
|
+
}
|
|
143
|
+
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;
|
|
144
|
+
var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
|
|
145
|
+
var LEGACY_TYPE_MAP = {
|
|
146
|
+
'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
|
|
147
|
+
'focus': ['focus', 'focusin'],
|
|
148
|
+
'blur': ['blur', 'focusout'],
|
|
149
|
+
'beforeinput': ['beforeinput', 'textInput'],
|
|
150
|
+
};
|
|
151
|
+
var EventListener = {
|
|
152
|
+
useStd: typeof globalThis.document.addEventListener === 'function',
|
|
153
|
+
add: function (target, eventListenerOptions) {
|
|
154
|
+
if (typeof eventListenerOptions.type === 'undefined')
|
|
155
|
+
return;
|
|
156
|
+
if (typeof target === 'undefined')
|
|
157
|
+
return;
|
|
158
|
+
var callback = eventListenerOptions.callback;
|
|
159
|
+
var type = withVendor(target, eventListenerOptions.type);
|
|
160
|
+
var options = eventListenerOptions.options;
|
|
161
|
+
if (isMediaQueryListTarget(target)) {
|
|
162
|
+
if (typeof target.addListener === 'function') {
|
|
163
|
+
try {
|
|
164
|
+
var wrapper = findMediaQueryListWrapper(target, type, callback);
|
|
165
|
+
if (typeof wrapper === 'undefined') {
|
|
166
|
+
setMediaQueryListWrapper(target, type, callback, wrapper = createMediaQueryListWrapper(callback));
|
|
167
|
+
}
|
|
168
|
+
return target.addListener(wrapper);
|
|
169
|
+
}
|
|
170
|
+
catch (_) {
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (typeof target.addEventListener === 'function') {
|
|
175
|
+
try {
|
|
176
|
+
if (isEventListenerCallback(callback)) {
|
|
177
|
+
return target.addEventListener(type, callback, options);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (_) {
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (typeof target.attachEvent === 'function') {
|
|
184
|
+
var existing = findIEWrapper(target, type, callback);
|
|
185
|
+
if (typeof existing === 'function')
|
|
186
|
+
return;
|
|
187
|
+
var wrapper = function (event) {
|
|
188
|
+
if (typeof event === 'undefined')
|
|
189
|
+
event = globalThis.event;
|
|
190
|
+
if (typeof event === 'undefined')
|
|
191
|
+
return;
|
|
192
|
+
try {
|
|
193
|
+
Object.defineProperty(event, 'currentTarget', { value: target, configurable: true });
|
|
194
|
+
}
|
|
195
|
+
catch (_) {
|
|
196
|
+
}
|
|
197
|
+
if (typeof event.preventDefault !== 'function')
|
|
198
|
+
event.preventDefault = preventDefaultPolyfill.bind(event);
|
|
199
|
+
if (typeof event.stopPropagation !== 'function')
|
|
200
|
+
event.stopPropagation = stopPropagationPolyfill.bind(event);
|
|
201
|
+
if (typeof callback === 'function')
|
|
202
|
+
callback.call(target, event);
|
|
203
|
+
else if (callback && typeof callback.handleEvent === 'function')
|
|
204
|
+
callback.handleEvent(event);
|
|
205
|
+
};
|
|
206
|
+
setIEWrapper(target, type, callback, wrapper);
|
|
207
|
+
return target.attachEvent('on' + type, wrapper);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
remove: function (target, eventListenerOptions) {
|
|
211
|
+
if (typeof eventListenerOptions.type === 'undefined')
|
|
212
|
+
return;
|
|
213
|
+
if (typeof target === 'undefined')
|
|
214
|
+
return;
|
|
215
|
+
var callback = eventListenerOptions.callback;
|
|
216
|
+
var type = withVendor(target, eventListenerOptions.type);
|
|
217
|
+
var options = eventListenerOptions.options;
|
|
218
|
+
if (isMediaQueryListTarget(target)) {
|
|
219
|
+
if (typeof target.removeListener === 'function') {
|
|
220
|
+
try {
|
|
221
|
+
var wrapper = removeMediaQueryListWrapper(target, type, callback);
|
|
222
|
+
if (typeof wrapper === 'function')
|
|
223
|
+
return target.removeListener(wrapper);
|
|
224
|
+
}
|
|
225
|
+
catch (_) {
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (typeof target.removeEventListener === 'function') {
|
|
231
|
+
try {
|
|
232
|
+
if (isEventListenerCallback(callback)) {
|
|
233
|
+
return target.removeEventListener(type, callback, options);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
catch (_) {
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (typeof target.detachEvent === 'function') {
|
|
240
|
+
var wrapper = removeIEWrapper(target, type, callback);
|
|
241
|
+
if (typeof wrapper === 'function')
|
|
242
|
+
target.detachEvent('on' + type, wrapper);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
function createCustomError(name, Base) {
|
|
249
|
+
if (Base === void 0) { Base = Error; }
|
|
250
|
+
function CustomError(message) {
|
|
251
|
+
if (!(this instanceof CustomError))
|
|
252
|
+
return new CustomError(message);
|
|
253
|
+
var error = (function () {
|
|
254
|
+
if (typeof message === 'undefined')
|
|
255
|
+
return new Base('');
|
|
256
|
+
return new Base(message);
|
|
257
|
+
})();
|
|
258
|
+
if (typeof Object.setPrototypeOf === 'function')
|
|
259
|
+
Object.setPrototypeOf(error, CustomError.prototype);
|
|
260
|
+
else
|
|
261
|
+
error.__proto__ = CustomError.prototype;
|
|
262
|
+
error.name = name;
|
|
263
|
+
if (typeof message !== 'undefined')
|
|
264
|
+
error.message = message;
|
|
265
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
266
|
+
try {
|
|
267
|
+
Object.defineProperty(error, Symbol.toStringTag, {
|
|
268
|
+
value: name,
|
|
269
|
+
writable: false,
|
|
270
|
+
enumerable: false,
|
|
271
|
+
configurable: true
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
catch (_) {
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
278
|
+
Error.captureStackTrace(error, CustomError);
|
|
279
|
+
}
|
|
280
|
+
else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
|
|
281
|
+
Base.captureStackTrace(error, CustomError);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
try {
|
|
285
|
+
var tempError = new Base();
|
|
286
|
+
if (tempError.stack)
|
|
287
|
+
error.stack = tempError.stack;
|
|
288
|
+
}
|
|
289
|
+
catch (_) {
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return error;
|
|
293
|
+
}
|
|
294
|
+
CustomError.prototype = Object.create(Base.prototype, {
|
|
295
|
+
constructor: {
|
|
296
|
+
value: CustomError,
|
|
297
|
+
writable: true,
|
|
298
|
+
enumerable: false,
|
|
299
|
+
configurable: true
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
try {
|
|
303
|
+
Object.defineProperty(CustomError.prototype, 'name', {
|
|
304
|
+
value: name,
|
|
305
|
+
writable: true,
|
|
306
|
+
enumerable: false,
|
|
307
|
+
configurable: true
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
catch (_) {
|
|
311
|
+
try {
|
|
312
|
+
CustomError.prototype.name = name;
|
|
313
|
+
}
|
|
314
|
+
catch (_) {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
Object.defineProperty(CustomError, 'name', {
|
|
319
|
+
value: name,
|
|
320
|
+
writable: false,
|
|
321
|
+
enumerable: false,
|
|
322
|
+
configurable: true
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
catch (_) {
|
|
326
|
+
}
|
|
327
|
+
return CustomError;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
var NotSupportedError = createCustomError('NotSupportedError');
|
|
331
|
+
|
|
40
332
|
var Permission = {
|
|
41
333
|
get supported() {
|
|
42
334
|
return supported();
|
|
@@ -47,14 +339,45 @@ var Permission = {
|
|
|
47
339
|
PermissionType: PermissionType,
|
|
48
340
|
PermissionState: PermissionState,
|
|
49
341
|
},
|
|
50
|
-
Errors: {
|
|
342
|
+
Errors: {
|
|
343
|
+
NotSupportedError: NotSupportedError,
|
|
344
|
+
},
|
|
51
345
|
};
|
|
346
|
+
function toPermissionState(permission) {
|
|
347
|
+
switch (permission) {
|
|
348
|
+
case 'granted':
|
|
349
|
+
return PermissionState.Grant;
|
|
350
|
+
case 'denied':
|
|
351
|
+
return PermissionState.Denied;
|
|
352
|
+
case 'prompt':
|
|
353
|
+
case 'default':
|
|
354
|
+
return PermissionState.Prompt;
|
|
355
|
+
default:
|
|
356
|
+
return PermissionState.Unsupported;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function toSafariSensorEventMap(type) {
|
|
360
|
+
switch (type) {
|
|
361
|
+
case PermissionType.DeviceOrientation:
|
|
362
|
+
return {
|
|
363
|
+
event: globalThis.DeviceOrientationEvent,
|
|
364
|
+
type: 'deviceorientation',
|
|
365
|
+
};
|
|
366
|
+
case PermissionType.DeviceMotion:
|
|
367
|
+
return {
|
|
368
|
+
event: globalThis.DeviceMotionEvent,
|
|
369
|
+
type: 'devicemotion',
|
|
370
|
+
};
|
|
371
|
+
default:
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
52
375
|
function supported() {
|
|
53
376
|
return typeof globalThis.navigator.permissions !== 'undefined';
|
|
54
377
|
}
|
|
55
378
|
function request(type) {
|
|
56
379
|
var instance = this;
|
|
57
|
-
return new Promise(function (resolve) {
|
|
380
|
+
return new Promise(function (resolve, reject) {
|
|
58
381
|
function resolveAfterCheck() {
|
|
59
382
|
instance.check(type).then(resolve);
|
|
60
383
|
}
|
|
@@ -66,17 +389,8 @@ function request(type) {
|
|
|
66
389
|
case PermissionType.Notification:
|
|
67
390
|
if (typeof globalThis.Notification === 'undefined')
|
|
68
391
|
return resolve(PermissionState.Unsupported);
|
|
69
|
-
globalThis.Notification.requestPermission().then(function (
|
|
70
|
-
|
|
71
|
-
case 'default':
|
|
72
|
-
return resolve(PermissionState.Prompt);
|
|
73
|
-
case 'granted':
|
|
74
|
-
return resolve(PermissionState.Grant);
|
|
75
|
-
case 'denied':
|
|
76
|
-
return resolve(PermissionState.Denied);
|
|
77
|
-
default:
|
|
78
|
-
resolveAfterCheck();
|
|
79
|
-
}
|
|
392
|
+
globalThis.Notification.requestPermission().then(function (permission) {
|
|
393
|
+
resolve(toPermissionState(permission));
|
|
80
394
|
});
|
|
81
395
|
break;
|
|
82
396
|
case PermissionType.Geolocation:
|
|
@@ -114,6 +428,23 @@ function request(type) {
|
|
|
114
428
|
.then(resolveAfterCheck)
|
|
115
429
|
.catch(resolveAfterCheck);
|
|
116
430
|
break;
|
|
431
|
+
case PermissionType.DeviceOrientation:
|
|
432
|
+
case PermissionType.DeviceMotion:
|
|
433
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
434
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
435
|
+
return resolve(PermissionState.Unsupported);
|
|
436
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
437
|
+
return resolve(PermissionState.Grant);
|
|
438
|
+
try {
|
|
439
|
+
sensorEventMap.event.requestPermission()
|
|
440
|
+
.then(function (permission) {
|
|
441
|
+
resolve(toPermissionState(permission));
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
catch (_) {
|
|
445
|
+
return reject(new NotSupportedError('\'DeviceOrientationEvent.requestPermission()\' must be called within a user gesture context.'));
|
|
446
|
+
}
|
|
447
|
+
break;
|
|
117
448
|
default:
|
|
118
449
|
return resolve(PermissionState.Unsupported);
|
|
119
450
|
}
|
|
@@ -121,6 +452,34 @@ function request(type) {
|
|
|
121
452
|
});
|
|
122
453
|
}
|
|
123
454
|
function check(type) {
|
|
455
|
+
if (type === PermissionType.DeviceOrientation || type === PermissionType.DeviceMotion) {
|
|
456
|
+
return new Promise(function (resolve) {
|
|
457
|
+
var sensorEventMap = toSafariSensorEventMap(type);
|
|
458
|
+
if (typeof sensorEventMap === 'undefined' || typeof sensorEventMap.event === 'undefined')
|
|
459
|
+
return resolve(PermissionState.Unsupported);
|
|
460
|
+
if (typeof sensorEventMap.event.requestPermission !== 'function')
|
|
461
|
+
return resolve(PermissionState.Grant);
|
|
462
|
+
var granted = false;
|
|
463
|
+
EventListener.add(globalThis, {
|
|
464
|
+
type: sensorEventMap.type,
|
|
465
|
+
callback: function () {
|
|
466
|
+
granted = true;
|
|
467
|
+
},
|
|
468
|
+
options: { once: true }
|
|
469
|
+
});
|
|
470
|
+
setTimeout(function () {
|
|
471
|
+
if (granted)
|
|
472
|
+
return resolve(PermissionState.Grant);
|
|
473
|
+
sensorEventMap.event.requestPermission()
|
|
474
|
+
.then(function (permission) {
|
|
475
|
+
resolve(toPermissionState(permission));
|
|
476
|
+
})
|
|
477
|
+
.catch(function () {
|
|
478
|
+
resolve(PermissionState.Prompt);
|
|
479
|
+
});
|
|
480
|
+
}, 50);
|
|
481
|
+
});
|
|
482
|
+
}
|
|
124
483
|
return new Promise(function (resolve) {
|
|
125
484
|
if (typeof globalThis.navigator.permissions === 'undefined')
|
|
126
485
|
return resolve(PermissionState.Unsupported);
|
|
@@ -2,8 +2,8 @@ import { Appearances } from "../constants";
|
|
|
2
2
|
export declare interface AppearanceInstance {
|
|
3
3
|
get value(): Appearances;
|
|
4
4
|
onChange(listener: (appearance: Appearances) => void, options?: AddEventListenerOptions): () => void;
|
|
5
|
-
Constants: {
|
|
6
|
-
Appearances: typeof Appearances;
|
|
5
|
+
readonly Constants: {
|
|
6
|
+
readonly Appearances: typeof Appearances;
|
|
7
7
|
};
|
|
8
|
-
Errors: {};
|
|
8
|
+
readonly Errors: {};
|
|
9
9
|
}
|
|
@@ -3,8 +3,8 @@ export declare interface BadgeInstance {
|
|
|
3
3
|
get supported(): boolean;
|
|
4
4
|
set(contents: number): Promise<void>;
|
|
5
5
|
clear(): Promise<void>;
|
|
6
|
-
Constants: {};
|
|
7
|
-
Errors: {
|
|
8
|
-
NotSupportedError: typeof NotSupportedError;
|
|
6
|
+
readonly Constants: {};
|
|
7
|
+
readonly Errors: {
|
|
8
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -19,8 +19,8 @@ export declare interface BatteryInstance {
|
|
|
19
19
|
get supported(): boolean;
|
|
20
20
|
get value(): Promise<BatteryManager>;
|
|
21
21
|
onChange(listener: (battery: BatteryManager) => void, options?: AddEventListenerOptions): () => void;
|
|
22
|
-
Constants: {};
|
|
23
|
-
Errors: {
|
|
24
|
-
NotSupportedError: typeof NotSupportedError;
|
|
22
|
+
readonly Constants: {};
|
|
23
|
+
readonly Errors: {
|
|
24
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export declare enum Orientation {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
PortraitPrimary = "portrait-primary",
|
|
3
|
+
PortraitSecondary = "portrait-secondary",
|
|
4
|
+
LandscapePrimary = "landscape-primary",
|
|
5
|
+
LandscapeSecondary = "landscape-secondary"
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Orientation {
|
|
8
|
+
function isLandscape(orientation: Orientation): boolean;
|
|
9
|
+
function isPortrait(orientation: Orientation): boolean;
|
|
5
10
|
}
|
|
6
11
|
export declare const ENV_PRESETS: {
|
|
7
12
|
readonly 'safe-area-inset': {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ENV_PRESETS, Orientation } from "../constants";
|
|
2
|
+
import { NotSupportedError } from "../../../errors/not-supported-error";
|
|
3
|
+
import { PermissionNotGrantedError } from "../../../errors/permission-not-granted-error";
|
|
2
4
|
export type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
|
|
3
5
|
export type EnvironmentPresetAttribute<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
|
|
4
6
|
export type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
|
|
5
7
|
[P in EnvironmentPresetAttribute<K>]: number;
|
|
6
8
|
};
|
|
7
9
|
export declare interface Environment {
|
|
8
|
-
safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
|
|
9
|
-
safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
|
|
10
|
-
keyboardInset: EnvironmentObserver<'keyboard-inset'>;
|
|
11
|
-
titlebarArea: EnvironmentObserver<'titlebar-area'>;
|
|
12
|
-
viewportSegment: EnvironmentObserver<'viewport-segment'>;
|
|
10
|
+
readonly safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
|
|
11
|
+
readonly safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
|
|
12
|
+
readonly keyboardInset: EnvironmentObserver<'keyboard-inset'>;
|
|
13
|
+
readonly titlebarArea: EnvironmentObserver<'titlebar-area'>;
|
|
14
|
+
readonly viewportSegment: EnvironmentObserver<'viewport-segment'>;
|
|
13
15
|
}
|
|
14
16
|
export declare interface SegmentsObserver {
|
|
15
17
|
get value(): EnvironmentPresetValues<'viewport-segment'>[];
|
|
@@ -22,19 +24,39 @@ export declare type EnvironmentObserver<K extends EnvironmentPresetKey> = K exte
|
|
|
22
24
|
useCssVariable(prefix: string): () => void;
|
|
23
25
|
};
|
|
24
26
|
export declare interface Dimensions {
|
|
25
|
-
outerWidth: number;
|
|
26
|
-
outerHeight: number;
|
|
27
|
-
innerWidth: number;
|
|
28
|
-
innerHeight: number;
|
|
29
|
-
scale: number;
|
|
30
|
-
|
|
27
|
+
readonly outerWidth: number;
|
|
28
|
+
readonly outerHeight: number;
|
|
29
|
+
readonly innerWidth: number;
|
|
30
|
+
readonly innerHeight: number;
|
|
31
|
+
readonly scale: number;
|
|
32
|
+
}
|
|
33
|
+
export declare interface DeviceOrientationValue {
|
|
34
|
+
readonly alpha: number | null;
|
|
35
|
+
readonly beta: number | null;
|
|
36
|
+
readonly gamma: number | null;
|
|
37
|
+
readonly absolute: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare interface DeviceOrientationInstance {
|
|
40
|
+
get supported(): boolean;
|
|
41
|
+
readonly value: Promise<DeviceOrientationValue>;
|
|
42
|
+
onChange(listener: (value: DeviceOrientationValue) => void, options?: AddEventListenerOptions): () => void;
|
|
43
|
+
}
|
|
44
|
+
export declare interface ScreenOrientationInstance {
|
|
45
|
+
get supported(): boolean;
|
|
46
|
+
readonly value: Orientation;
|
|
47
|
+
onChange(listener: (value: Orientation) => void, options?: AddEventListenerOptions): () => void;
|
|
31
48
|
}
|
|
32
49
|
export declare interface DimensionInstance {
|
|
33
50
|
get value(): Dimensions;
|
|
34
|
-
environment: Environment;
|
|
51
|
+
readonly environment: Environment;
|
|
52
|
+
readonly screenOrientation: ScreenOrientationInstance;
|
|
53
|
+
readonly deviceOrientation: DeviceOrientationInstance;
|
|
35
54
|
onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
|
|
36
|
-
Constants: {
|
|
37
|
-
Orientation: typeof Orientation;
|
|
55
|
+
readonly Constants: {
|
|
56
|
+
readonly Orientation: typeof Orientation;
|
|
57
|
+
};
|
|
58
|
+
readonly Errors: {
|
|
59
|
+
readonly NotSupportedError: typeof NotSupportedError;
|
|
60
|
+
readonly PermissionNotGrantedError: typeof PermissionNotGrantedError;
|
|
38
61
|
};
|
|
39
|
-
Errors: {};
|
|
40
62
|
}
|
|
@@ -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
|
}
|