native-fn 1.3.0 → 1.3.2
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
|
@@ -17,9 +17,20 @@ var FALLBACK_MEDIA_QUERY_LIST = {
|
|
|
17
17
|
|
|
18
18
|
var Orientation;
|
|
19
19
|
(function (Orientation) {
|
|
20
|
-
Orientation["
|
|
21
|
-
Orientation["
|
|
22
|
-
Orientation["
|
|
20
|
+
Orientation["PortraitPrimary"] = "portrait-primary";
|
|
21
|
+
Orientation["PortraitSecondary"] = "portrait-secondary";
|
|
22
|
+
Orientation["LandscapePrimary"] = "landscape-primary";
|
|
23
|
+
Orientation["LandscapeSecondary"] = "landscape-secondary";
|
|
24
|
+
})(Orientation || (Orientation = {}));
|
|
25
|
+
(function (Orientation) {
|
|
26
|
+
function isLandscape(orientation) {
|
|
27
|
+
return orientation === Orientation.LandscapePrimary || orientation === Orientation.LandscapeSecondary;
|
|
28
|
+
}
|
|
29
|
+
Orientation.isLandscape = isLandscape;
|
|
30
|
+
function isPortrait(orientation) {
|
|
31
|
+
return orientation === Orientation.PortraitPrimary || orientation === Orientation.PortraitSecondary;
|
|
32
|
+
}
|
|
33
|
+
Orientation.isPortrait = isPortrait;
|
|
23
34
|
})(Orientation || (Orientation = {}));
|
|
24
35
|
var ENV_PRESETS = {
|
|
25
36
|
'safe-area-inset': {
|
|
@@ -471,7 +482,6 @@ function createViewportSegmentObserver() {
|
|
|
471
482
|
var segmentMediaQueryLists = [];
|
|
472
483
|
var previousSegments = null;
|
|
473
484
|
function attachCSSFallbackListeners() {
|
|
474
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
475
485
|
segmentMediaQueryLists = buildSegmentMediaQueryLists();
|
|
476
486
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
477
487
|
EventListener.add(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
@@ -479,50 +489,53 @@ function createViewportSegmentObserver() {
|
|
|
479
489
|
EventListener.add(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
480
490
|
}
|
|
481
491
|
function detachCSSFallbackListeners() {
|
|
482
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
483
492
|
for (var i = 0; i < segmentMediaQueryLists.length; i++)
|
|
484
493
|
EventListener.remove(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
|
|
485
494
|
segmentMediaQueryLists = [];
|
|
486
495
|
if (DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
|
|
487
496
|
EventListener.remove(DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
|
|
488
497
|
}
|
|
498
|
+
function attachDevicePostureChangeListener() {
|
|
499
|
+
if (hasDevicePosture)
|
|
500
|
+
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
501
|
+
attachCSSFallbackListeners();
|
|
502
|
+
}
|
|
503
|
+
function detachDevicePostureChangeListener() {
|
|
504
|
+
if (hasDevicePosture)
|
|
505
|
+
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
506
|
+
detachCSSFallbackListeners();
|
|
507
|
+
}
|
|
508
|
+
function attachVisualViewportResizeListener() {
|
|
509
|
+
EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
510
|
+
}
|
|
511
|
+
function detachVisualViewportResizeListener() {
|
|
512
|
+
EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
|
|
513
|
+
}
|
|
489
514
|
function attachOnChange() {
|
|
515
|
+
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
490
516
|
if (hasSegmentsAPI) {
|
|
491
|
-
|
|
492
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
493
|
-
EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
494
|
-
}
|
|
495
|
-
else {
|
|
496
|
-
attachCSSFallbackListeners();
|
|
497
|
-
}
|
|
517
|
+
attachDevicePostureChangeListener();
|
|
498
518
|
}
|
|
499
519
|
else if (hasLegacySegmentsAPI) {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
520
|
+
attachVisualViewportResizeListener();
|
|
521
|
+
attachDevicePostureChangeListener();
|
|
503
522
|
}
|
|
504
523
|
else {
|
|
505
524
|
getOrCreateCachedDiv();
|
|
506
|
-
|
|
525
|
+
attachVisualViewportResizeListener();
|
|
507
526
|
}
|
|
508
527
|
}
|
|
509
528
|
function detachOnChange() {
|
|
529
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
510
530
|
if (hasSegmentsAPI) {
|
|
511
|
-
|
|
512
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
513
|
-
EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
detachCSSFallbackListeners();
|
|
517
|
-
}
|
|
531
|
+
detachDevicePostureChangeListener();
|
|
518
532
|
}
|
|
519
533
|
else if (hasLegacySegmentsAPI) {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
|
|
534
|
+
detachVisualViewportResizeListener();
|
|
535
|
+
detachDevicePostureChangeListener();
|
|
523
536
|
}
|
|
524
537
|
else {
|
|
525
|
-
|
|
538
|
+
detachVisualViewportResizeListener();
|
|
526
539
|
releaseDiv();
|
|
527
540
|
}
|
|
528
541
|
}
|
|
@@ -674,7 +687,7 @@ function createViewportSegmentObserver() {
|
|
|
674
687
|
function applySegments(segments) {
|
|
675
688
|
for (var i = segments.length; i < lastCount; i++) {
|
|
676
689
|
for (var j = 0; j < attributes.length; j++) {
|
|
677
|
-
element.style.removeProperty(
|
|
690
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
678
691
|
}
|
|
679
692
|
}
|
|
680
693
|
lastCount = segments.length;
|
|
@@ -682,7 +695,7 @@ function createViewportSegmentObserver() {
|
|
|
682
695
|
var segment = segments[i];
|
|
683
696
|
for (var j = 0; j < attributes.length; j++) {
|
|
684
697
|
var attribute = attributes[j];
|
|
685
|
-
element.style.setProperty(
|
|
698
|
+
element.style.setProperty('--' + prefix + '-' + i + '-' + attribute, segment[attribute] + 'px');
|
|
686
699
|
}
|
|
687
700
|
}
|
|
688
701
|
}
|
|
@@ -694,7 +707,7 @@ function createViewportSegmentObserver() {
|
|
|
694
707
|
unsubscribe();
|
|
695
708
|
for (var i = 0; i < lastCount; i++)
|
|
696
709
|
for (var j = 0; j < attributes.length; j++)
|
|
697
|
-
element.style.removeProperty(
|
|
710
|
+
element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
|
|
698
711
|
lastCount = 0;
|
|
699
712
|
};
|
|
700
713
|
}
|
|
@@ -708,15 +721,11 @@ function createViewportSegmentObserver() {
|
|
|
708
721
|
}
|
|
709
722
|
function createVirtualKeyboardObserver() {
|
|
710
723
|
var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
|
|
711
|
-
var previousOverlaysContent = false;
|
|
712
724
|
function attachOnChange() {
|
|
713
|
-
previousOverlaysContent = globalThis.navigator.virtualKeyboard.overlaysContent;
|
|
714
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = true;
|
|
715
725
|
EventListener.add(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
716
726
|
}
|
|
717
727
|
function detachOnChange() {
|
|
718
728
|
EventListener.remove(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
|
|
719
|
-
globalThis.navigator.virtualKeyboard.overlaysContent = previousOverlaysContent;
|
|
720
729
|
}
|
|
721
730
|
function onGeometryChange() {
|
|
722
731
|
onChangeSubscriptionManager.emit(getValue());
|
|
@@ -754,7 +763,7 @@ function createVirtualKeyboardObserver() {
|
|
|
754
763
|
function applyValues(values) {
|
|
755
764
|
for (var i = 0; i < attributes.length; i++) {
|
|
756
765
|
var attribute = attributes[i];
|
|
757
|
-
element.style.setProperty(
|
|
766
|
+
element.style.setProperty('--' + prefix + '-' + attribute, values[attribute] + 'px');
|
|
758
767
|
}
|
|
759
768
|
}
|
|
760
769
|
applyValues(getValue());
|
|
@@ -764,7 +773,7 @@ function createVirtualKeyboardObserver() {
|
|
|
764
773
|
return function () {
|
|
765
774
|
unsubscribe();
|
|
766
775
|
for (var i = 0; i < attributes.length; i++)
|
|
767
|
-
element.style.removeProperty(
|
|
776
|
+
element.style.removeProperty('--' + prefix + '-' + attributes[i]);
|
|
768
777
|
};
|
|
769
778
|
}
|
|
770
779
|
return {
|
|
@@ -953,7 +962,7 @@ function createEnvironmentObserver(preset) {
|
|
|
953
962
|
function applyValues(values) {
|
|
954
963
|
for (var i = 0; i < attributes.length; i++) {
|
|
955
964
|
var attribute = attributes[i];
|
|
956
|
-
element.style.setProperty(
|
|
965
|
+
element.style.setProperty('--' + prefix + '-' + String(attributes[i]), values[attribute] + 'px');
|
|
957
966
|
}
|
|
958
967
|
}
|
|
959
968
|
var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
|
|
@@ -963,7 +972,7 @@ function createEnvironmentObserver(preset) {
|
|
|
963
972
|
return function () {
|
|
964
973
|
unsubscribe();
|
|
965
974
|
for (var i = 0; i < attributes.length; i++)
|
|
966
|
-
element.style.removeProperty(
|
|
975
|
+
element.style.removeProperty('--' + prefix + '-' + String(attributes[i]));
|
|
967
976
|
};
|
|
968
977
|
}
|
|
969
978
|
return {
|
|
@@ -985,51 +994,151 @@ function createEnvironmentObserver(preset) {
|
|
|
985
994
|
};
|
|
986
995
|
}
|
|
987
996
|
|
|
997
|
+
function createCustomError(name, Base) {
|
|
998
|
+
if (Base === void 0) { Base = Error; }
|
|
999
|
+
function CustomError(message) {
|
|
1000
|
+
if (!(this instanceof CustomError))
|
|
1001
|
+
return new CustomError(message);
|
|
1002
|
+
var error = (function () {
|
|
1003
|
+
if (typeof message === 'undefined')
|
|
1004
|
+
return new Base('');
|
|
1005
|
+
return new Base(message);
|
|
1006
|
+
})();
|
|
1007
|
+
if (typeof Object.setPrototypeOf === 'function')
|
|
1008
|
+
Object.setPrototypeOf(error, CustomError.prototype);
|
|
1009
|
+
else
|
|
1010
|
+
error.__proto__ = CustomError.prototype;
|
|
1011
|
+
error.name = name;
|
|
1012
|
+
if (typeof message !== 'undefined')
|
|
1013
|
+
error.message = message;
|
|
1014
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1015
|
+
try {
|
|
1016
|
+
Object.defineProperty(error, Symbol.toStringTag, {
|
|
1017
|
+
value: name,
|
|
1018
|
+
writable: false,
|
|
1019
|
+
enumerable: false,
|
|
1020
|
+
configurable: true
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
catch (_) {
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
1027
|
+
Error.captureStackTrace(error, CustomError);
|
|
1028
|
+
}
|
|
1029
|
+
else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
|
|
1030
|
+
Base.captureStackTrace(error, CustomError);
|
|
1031
|
+
}
|
|
1032
|
+
else {
|
|
1033
|
+
try {
|
|
1034
|
+
var tempError = new Base();
|
|
1035
|
+
if (tempError.stack)
|
|
1036
|
+
error.stack = tempError.stack;
|
|
1037
|
+
}
|
|
1038
|
+
catch (_) {
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
return error;
|
|
1042
|
+
}
|
|
1043
|
+
CustomError.prototype = Object.create(Base.prototype, {
|
|
1044
|
+
constructor: {
|
|
1045
|
+
value: CustomError,
|
|
1046
|
+
writable: true,
|
|
1047
|
+
enumerable: false,
|
|
1048
|
+
configurable: true
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
try {
|
|
1052
|
+
Object.defineProperty(CustomError.prototype, 'name', {
|
|
1053
|
+
value: name,
|
|
1054
|
+
writable: true,
|
|
1055
|
+
enumerable: false,
|
|
1056
|
+
configurable: true
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
catch (_) {
|
|
1060
|
+
try {
|
|
1061
|
+
CustomError.prototype.name = name;
|
|
1062
|
+
}
|
|
1063
|
+
catch (_) {
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
try {
|
|
1067
|
+
Object.defineProperty(CustomError, 'name', {
|
|
1068
|
+
value: name,
|
|
1069
|
+
writable: false,
|
|
1070
|
+
enumerable: false,
|
|
1071
|
+
configurable: true
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
catch (_) {
|
|
1075
|
+
}
|
|
1076
|
+
return CustomError;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
|
|
1080
|
+
|
|
1081
|
+
var NotSupportedError = createCustomError('NotSupportedError');
|
|
1082
|
+
|
|
988
1083
|
var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
|
|
989
1084
|
var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
|
|
990
1085
|
var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
|
|
991
1086
|
var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
|
|
992
1087
|
var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
|
|
993
|
-
var
|
|
1088
|
+
var onDimensionChangeSubscriptionManager = createSubscriptionManager(attachOnDimensionChange, detachOnDimensionChange);
|
|
1089
|
+
var onScreenOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnScreenOrientationChange, detachOnScreenOrientationChange);
|
|
1090
|
+
var onDeviceOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnDeviceOrientationChange, detachOnDeviceOrientationChange);
|
|
994
1091
|
var dimensionRef = null;
|
|
1092
|
+
var screenOrientationRef = null;
|
|
1093
|
+
var deviceOrientationRef = null;
|
|
995
1094
|
var Dimension = {
|
|
996
1095
|
get value() {
|
|
997
1096
|
return getDimension();
|
|
998
1097
|
},
|
|
999
1098
|
environment: getEnvironment(),
|
|
1000
|
-
|
|
1099
|
+
screenOrientation: getScreenOrientation(),
|
|
1100
|
+
deviceOrientation: getDeviceOrientation(),
|
|
1101
|
+
onChange: onDimensionChangeSubscriptionManager.subscribe,
|
|
1001
1102
|
Constants: {
|
|
1002
1103
|
Orientation: Orientation,
|
|
1003
1104
|
},
|
|
1004
|
-
Errors: {
|
|
1105
|
+
Errors: {
|
|
1106
|
+
NotSupportedError: NotSupportedError,
|
|
1107
|
+
PermissionNotGrantedError: PermissionNotGrantedError,
|
|
1108
|
+
},
|
|
1005
1109
|
};
|
|
1006
1110
|
function getOrientation() {
|
|
1007
|
-
if (typeof globalThis.screen !== 'undefined') {
|
|
1111
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined') {
|
|
1008
1112
|
switch (globalThis.screen.orientation.type) {
|
|
1009
1113
|
case 'portrait-primary':
|
|
1114
|
+
return Orientation.PortraitPrimary;
|
|
1010
1115
|
case 'portrait-secondary':
|
|
1011
|
-
return Orientation.
|
|
1116
|
+
return Orientation.PortraitSecondary;
|
|
1012
1117
|
case 'landscape-primary':
|
|
1118
|
+
return Orientation.LandscapePrimary;
|
|
1013
1119
|
case 'landscape-secondary':
|
|
1014
|
-
return Orientation.
|
|
1120
|
+
return Orientation.LandscapeSecondary;
|
|
1015
1121
|
}
|
|
1016
1122
|
}
|
|
1017
1123
|
if (typeof globalThis.orientation !== 'undefined') {
|
|
1018
1124
|
switch (globalThis.orientation) {
|
|
1019
1125
|
case 0:
|
|
1126
|
+
return Orientation.PortraitPrimary;
|
|
1020
1127
|
case 180:
|
|
1021
|
-
return Orientation.
|
|
1128
|
+
return Orientation.PortraitSecondary;
|
|
1022
1129
|
case 90:
|
|
1130
|
+
return Orientation.LandscapePrimary;
|
|
1131
|
+
case -90:
|
|
1023
1132
|
case 270:
|
|
1024
|
-
return Orientation.
|
|
1133
|
+
return Orientation.LandscapeSecondary;
|
|
1025
1134
|
}
|
|
1026
1135
|
}
|
|
1027
1136
|
if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
return Orientation.
|
|
1137
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
1138
|
+
if (ORIENTATION_MEDIA_QUERY_LIST.matches)
|
|
1139
|
+
return Orientation.PortraitPrimary;
|
|
1031
1140
|
else
|
|
1032
|
-
return Orientation.
|
|
1141
|
+
return Orientation.LandscapePrimary;
|
|
1033
1142
|
}
|
|
1034
1143
|
function getScale() {
|
|
1035
1144
|
if (typeof globalThis.devicePixelRatio !== 'undefined')
|
|
@@ -1045,47 +1154,168 @@ function getEnvironment() {
|
|
|
1045
1154
|
viewportSegment: viewportSegmentObserver,
|
|
1046
1155
|
};
|
|
1047
1156
|
}
|
|
1048
|
-
function
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1157
|
+
function getScreenOrientation() {
|
|
1158
|
+
return {
|
|
1159
|
+
get supported() {
|
|
1160
|
+
return screenOrientationSupported();
|
|
1161
|
+
},
|
|
1162
|
+
get value() {
|
|
1163
|
+
return getOrientation();
|
|
1164
|
+
},
|
|
1165
|
+
onChange: onScreenOrientationChangeSubscriptionManager.subscribe,
|
|
1056
1166
|
};
|
|
1167
|
+
}
|
|
1168
|
+
function getDeviceOrientation() {
|
|
1169
|
+
return {
|
|
1170
|
+
get supported() {
|
|
1171
|
+
return deviceOrientationSupported();
|
|
1172
|
+
},
|
|
1173
|
+
get value() {
|
|
1174
|
+
return getDeviceOrientationValue();
|
|
1175
|
+
},
|
|
1176
|
+
onChange: onDeviceOrientationChangeSubscriptionManager.subscribe,
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function getDimension() {
|
|
1180
|
+
var innerWidth = 0;
|
|
1181
|
+
var innerHeight = 0;
|
|
1182
|
+
var outerWidth = 0;
|
|
1183
|
+
var outerHeight = 0;
|
|
1184
|
+
var scale = getScale();
|
|
1057
1185
|
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1186
|
+
innerWidth = globalThis.innerWidth;
|
|
1187
|
+
innerHeight = globalThis.innerHeight;
|
|
1188
|
+
outerWidth = globalThis.outerWidth;
|
|
1189
|
+
outerHeight = globalThis.outerHeight;
|
|
1062
1190
|
}
|
|
1063
|
-
return
|
|
1191
|
+
return {
|
|
1192
|
+
innerWidth: innerWidth,
|
|
1193
|
+
innerHeight: innerHeight,
|
|
1194
|
+
outerWidth: outerWidth,
|
|
1195
|
+
outerHeight: outerHeight,
|
|
1196
|
+
scale: scale,
|
|
1197
|
+
};
|
|
1064
1198
|
}
|
|
1065
|
-
function
|
|
1199
|
+
function attachOnDimensionChange() {
|
|
1066
1200
|
dimensionRef = getDimension();
|
|
1067
|
-
EventListener.add(globalThis, { type: 'resize', callback:
|
|
1068
|
-
|
|
1069
|
-
|
|
1201
|
+
EventListener.add(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
1202
|
+
}
|
|
1203
|
+
function detachOnDimensionChange() {
|
|
1204
|
+
dimensionRef = null;
|
|
1205
|
+
EventListener.remove(globalThis, { type: 'resize', callback: onDimensionChange });
|
|
1206
|
+
}
|
|
1207
|
+
function onDimensionChange() {
|
|
1208
|
+
var dimension = getDimension();
|
|
1209
|
+
if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale)
|
|
1210
|
+
onDimensionChangeSubscriptionManager.emit(dimensionRef = dimension);
|
|
1211
|
+
}
|
|
1212
|
+
function screenOrientationSupported() {
|
|
1213
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined')
|
|
1214
|
+
return true;
|
|
1215
|
+
if (typeof globalThis.orientation !== 'undefined')
|
|
1216
|
+
return true;
|
|
1217
|
+
return ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all';
|
|
1218
|
+
}
|
|
1219
|
+
function attachOnScreenOrientationChange() {
|
|
1220
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.addEventListener === 'function')
|
|
1221
|
+
return EventListener.add(globalThis.screen.orientation, {
|
|
1222
|
+
type: 'change',
|
|
1223
|
+
callback: onScreenOrientationChange
|
|
1224
|
+
});
|
|
1070
1225
|
else if (typeof globalThis.orientation !== 'undefined')
|
|
1071
|
-
EventListener.add(globalThis, { type: '
|
|
1226
|
+
return EventListener.add(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
1072
1227
|
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1073
|
-
EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback:
|
|
1228
|
+
return EventListener.add(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
1229
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
1074
1230
|
}
|
|
1075
|
-
function
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1231
|
+
function detachOnScreenOrientationChange() {
|
|
1232
|
+
if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.removeEventListener === 'function')
|
|
1233
|
+
return EventListener.remove(globalThis.screen.orientation, {
|
|
1234
|
+
type: 'change',
|
|
1235
|
+
callback: onScreenOrientationChange
|
|
1236
|
+
});
|
|
1080
1237
|
else if (typeof globalThis.orientation !== 'undefined')
|
|
1081
|
-
EventListener.remove(globalThis, { type: '
|
|
1238
|
+
return EventListener.remove(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
|
|
1082
1239
|
else if (ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
|
|
1083
|
-
EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback:
|
|
1240
|
+
return EventListener.remove(ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
|
|
1241
|
+
throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
|
|
1084
1242
|
}
|
|
1085
|
-
function
|
|
1086
|
-
var
|
|
1087
|
-
if (
|
|
1088
|
-
|
|
1243
|
+
function onScreenOrientationChange() {
|
|
1244
|
+
var orientation = getOrientation();
|
|
1245
|
+
if (screenOrientationRef === null || orientation !== screenOrientationRef)
|
|
1246
|
+
onScreenOrientationChangeSubscriptionManager.emit(screenOrientationRef = orientation);
|
|
1247
|
+
}
|
|
1248
|
+
function deviceOrientationSupported() {
|
|
1249
|
+
return typeof globalThis.DeviceOrientationEvent !== 'undefined';
|
|
1250
|
+
}
|
|
1251
|
+
function attachOnDeviceOrientationChange() {
|
|
1252
|
+
return new Promise(function (resolve, reject) {
|
|
1253
|
+
if (!deviceOrientationSupported())
|
|
1254
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
1255
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
1256
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
1257
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
1258
|
+
if (permission === 'granted') {
|
|
1259
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
1260
|
+
return resolve();
|
|
1261
|
+
}
|
|
1262
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
1263
|
+
}).catch(function (_) {
|
|
1264
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
1269
|
+
return resolve();
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
function detachOnDeviceOrientationChange() {
|
|
1274
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
|
|
1275
|
+
}
|
|
1276
|
+
function onDeviceOrientationChange(event) {
|
|
1277
|
+
deviceOrientationRef = {
|
|
1278
|
+
alpha: event.alpha,
|
|
1279
|
+
beta: event.beta,
|
|
1280
|
+
gamma: event.gamma,
|
|
1281
|
+
absolute: event.absolute,
|
|
1282
|
+
};
|
|
1283
|
+
onDeviceOrientationChangeSubscriptionManager.emit(deviceOrientationRef);
|
|
1284
|
+
}
|
|
1285
|
+
function getDeviceOrientationValue() {
|
|
1286
|
+
return new Promise(function (resolve, reject) {
|
|
1287
|
+
if (deviceOrientationRef !== null)
|
|
1288
|
+
return resolve(deviceOrientationRef);
|
|
1289
|
+
if (!deviceOrientationSupported())
|
|
1290
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
1291
|
+
var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
|
|
1292
|
+
var callback = function (event) {
|
|
1293
|
+
var value = {
|
|
1294
|
+
alpha: event.alpha,
|
|
1295
|
+
beta: event.beta,
|
|
1296
|
+
gamma: event.gamma,
|
|
1297
|
+
absolute: event.absolute,
|
|
1298
|
+
};
|
|
1299
|
+
deviceOrientationRef = value;
|
|
1300
|
+
EventListener.remove(globalThis, { type: 'deviceorientation', callback: callback });
|
|
1301
|
+
return resolve(value);
|
|
1302
|
+
};
|
|
1303
|
+
if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
|
|
1304
|
+
DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
|
|
1305
|
+
if (permission === 'granted') {
|
|
1306
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
|
|
1310
|
+
}).catch(function (_) {
|
|
1311
|
+
return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1089
1319
|
}
|
|
1090
1320
|
|
|
1091
1321
|
export { DEVICE_POSTURE_MEDIA_QUERY_LIST, ENV_PRESETS, ORIENTATION_MEDIA_QUERY_LIST, Orientation, Dimension as default };
|
|
@@ -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': {
|