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.
Files changed (313) hide show
  1. package/README.md +159 -41
  2. package/dist/index.d.ts +117 -88
  3. package/dist/native.cjs +464 -244
  4. package/dist/native.min.cjs +1 -1
  5. package/dist/native.min.mjs +1 -1
  6. package/dist/native.mjs +464 -244
  7. package/dist/native.umd.js +464 -244
  8. package/dist/native.umd.min.js +1 -1
  9. package/dist/plugin/appearance/index.cjs +49 -46
  10. package/dist/plugin/appearance/index.d.ts +3 -3
  11. package/dist/plugin/appearance/index.mjs +49 -46
  12. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +3 -3
  13. package/dist/plugin/appearance/src/plugin/badge/types/badge.d.ts +3 -3
  14. package/dist/plugin/appearance/src/plugin/battery/types/battery.d.ts +3 -3
  15. package/dist/plugin/appearance/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  16. package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +8 -3
  17. package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +37 -15
  18. package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  19. package/dist/plugin/appearance/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  20. package/dist/plugin/appearance/src/plugin/notification/types/notification.d.ts +4 -4
  21. package/dist/plugin/appearance/src/plugin/open/types/open.d.ts +12 -12
  22. package/dist/plugin/appearance/src/plugin/permission/constants/index.d.ts +3 -1
  23. package/dist/plugin/appearance/src/plugin/permission/types/permission.d.ts +7 -4
  24. package/dist/plugin/appearance/src/plugin/pip/types/pip.d.ts +7 -7
  25. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +13 -13
  26. package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -2
  27. package/dist/plugin/appearance/src/plugin/vibration/types/vibration.d.ts +3 -3
  28. package/dist/plugin/appearance/src/types/subscription-manager.d.ts +3 -3
  29. package/dist/plugin/appearance/src/utils/create-subscription-manager.d.ts +1 -1
  30. package/dist/plugin/badge/index.d.ts +3 -3
  31. package/dist/plugin/badge/src/plugin/appearance/types/appearance.d.ts +3 -3
  32. package/dist/plugin/badge/src/plugin/badge/types/badge.d.ts +3 -3
  33. package/dist/plugin/badge/src/plugin/battery/types/battery.d.ts +3 -3
  34. package/dist/plugin/badge/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  35. package/dist/plugin/badge/src/plugin/dimension/constants/index.d.ts +8 -3
  36. package/dist/plugin/badge/src/plugin/dimension/types/dimensions.d.ts +37 -15
  37. package/dist/plugin/badge/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  38. package/dist/plugin/badge/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  39. package/dist/plugin/badge/src/plugin/notification/types/notification.d.ts +4 -4
  40. package/dist/plugin/badge/src/plugin/open/types/open.d.ts +12 -12
  41. package/dist/plugin/badge/src/plugin/permission/constants/index.d.ts +3 -1
  42. package/dist/plugin/badge/src/plugin/permission/types/permission.d.ts +7 -4
  43. package/dist/plugin/badge/src/plugin/pip/types/pip.d.ts +7 -7
  44. package/dist/plugin/badge/src/plugin/platform/types/platform.d.ts +13 -13
  45. package/dist/plugin/badge/src/plugin/theme/types/theme.d.ts +2 -2
  46. package/dist/plugin/badge/src/plugin/vibration/types/vibration.d.ts +3 -3
  47. package/dist/plugin/badge/src/types/subscription-manager.d.ts +3 -3
  48. package/dist/plugin/badge/src/utils/create-subscription-manager.d.ts +1 -1
  49. package/dist/plugin/battery/index.d.ts +3 -3
  50. package/dist/plugin/battery/src/plugin/appearance/types/appearance.d.ts +3 -3
  51. package/dist/plugin/battery/src/plugin/badge/types/badge.d.ts +3 -3
  52. package/dist/plugin/battery/src/plugin/battery/types/battery.d.ts +3 -3
  53. package/dist/plugin/battery/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  54. package/dist/plugin/battery/src/plugin/dimension/constants/index.d.ts +8 -3
  55. package/dist/plugin/battery/src/plugin/dimension/types/dimensions.d.ts +37 -15
  56. package/dist/plugin/battery/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  57. package/dist/plugin/battery/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  58. package/dist/plugin/battery/src/plugin/notification/types/notification.d.ts +4 -4
  59. package/dist/plugin/battery/src/plugin/open/types/open.d.ts +12 -12
  60. package/dist/plugin/battery/src/plugin/permission/constants/index.d.ts +3 -1
  61. package/dist/plugin/battery/src/plugin/permission/types/permission.d.ts +7 -4
  62. package/dist/plugin/battery/src/plugin/pip/types/pip.d.ts +7 -7
  63. package/dist/plugin/battery/src/plugin/platform/types/platform.d.ts +13 -13
  64. package/dist/plugin/battery/src/plugin/theme/types/theme.d.ts +2 -2
  65. package/dist/plugin/battery/src/plugin/vibration/types/vibration.d.ts +3 -3
  66. package/dist/plugin/battery/src/types/subscription-manager.d.ts +3 -3
  67. package/dist/plugin/battery/src/utils/create-subscription-manager.d.ts +1 -1
  68. package/dist/plugin/clipboard/index.d.ts +2 -2
  69. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +3 -3
  70. package/dist/plugin/clipboard/src/plugin/badge/types/badge.d.ts +3 -3
  71. package/dist/plugin/clipboard/src/plugin/battery/types/battery.d.ts +3 -3
  72. package/dist/plugin/clipboard/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  73. package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +8 -3
  74. package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +37 -15
  75. package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  76. package/dist/plugin/clipboard/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  77. package/dist/plugin/clipboard/src/plugin/notification/types/notification.d.ts +4 -4
  78. package/dist/plugin/clipboard/src/plugin/open/types/open.d.ts +12 -12
  79. package/dist/plugin/clipboard/src/plugin/permission/constants/index.d.ts +3 -1
  80. package/dist/plugin/clipboard/src/plugin/permission/types/permission.d.ts +7 -4
  81. package/dist/plugin/clipboard/src/plugin/pip/types/pip.d.ts +7 -7
  82. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +13 -13
  83. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -2
  84. package/dist/plugin/clipboard/src/plugin/vibration/types/vibration.d.ts +3 -3
  85. package/dist/plugin/clipboard/src/types/subscription-manager.d.ts +3 -3
  86. package/dist/plugin/clipboard/src/utils/create-subscription-manager.d.ts +1 -1
  87. package/dist/plugin/dimension/index.cjs +310 -80
  88. package/dist/plugin/dimension/index.d.ts +48 -19
  89. package/dist/plugin/dimension/index.mjs +310 -80
  90. package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +3 -3
  91. package/dist/plugin/dimension/src/plugin/badge/types/badge.d.ts +3 -3
  92. package/dist/plugin/dimension/src/plugin/battery/types/battery.d.ts +3 -3
  93. package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  94. package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +8 -3
  95. package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +37 -15
  96. package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  97. package/dist/plugin/dimension/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  98. package/dist/plugin/dimension/src/plugin/notification/types/notification.d.ts +4 -4
  99. package/dist/plugin/dimension/src/plugin/open/types/open.d.ts +12 -12
  100. package/dist/plugin/dimension/src/plugin/permission/constants/index.d.ts +3 -1
  101. package/dist/plugin/dimension/src/plugin/permission/types/permission.d.ts +7 -4
  102. package/dist/plugin/dimension/src/plugin/pip/types/pip.d.ts +7 -7
  103. package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +13 -13
  104. package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +2 -2
  105. package/dist/plugin/dimension/src/plugin/vibration/types/vibration.d.ts +3 -3
  106. package/dist/plugin/dimension/src/types/subscription-manager.d.ts +3 -3
  107. package/dist/plugin/dimension/src/utils/create-subscription-manager.d.ts +1 -1
  108. package/dist/plugin/fullscreen/index.cjs +87 -80
  109. package/dist/plugin/fullscreen/index.d.ts +7 -7
  110. package/dist/plugin/fullscreen/index.mjs +87 -80
  111. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +3 -3
  112. package/dist/plugin/fullscreen/src/plugin/badge/types/badge.d.ts +3 -3
  113. package/dist/plugin/fullscreen/src/plugin/battery/types/battery.d.ts +3 -3
  114. package/dist/plugin/fullscreen/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  115. package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +8 -3
  116. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +37 -15
  117. package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  118. package/dist/plugin/fullscreen/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  119. package/dist/plugin/fullscreen/src/plugin/notification/types/notification.d.ts +4 -4
  120. package/dist/plugin/fullscreen/src/plugin/open/types/open.d.ts +12 -12
  121. package/dist/plugin/fullscreen/src/plugin/permission/constants/index.d.ts +3 -1
  122. package/dist/plugin/fullscreen/src/plugin/permission/types/permission.d.ts +7 -4
  123. package/dist/plugin/fullscreen/src/plugin/pip/types/pip.d.ts +7 -7
  124. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +13 -13
  125. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -2
  126. package/dist/plugin/fullscreen/src/plugin/vibration/types/vibration.d.ts +3 -3
  127. package/dist/plugin/fullscreen/src/types/subscription-manager.d.ts +3 -3
  128. package/dist/plugin/fullscreen/src/utils/create-subscription-manager.d.ts +1 -1
  129. package/dist/plugin/geolocation/index.cjs +245 -176
  130. package/dist/plugin/geolocation/index.d.ts +4 -4
  131. package/dist/plugin/geolocation/index.mjs +245 -176
  132. package/dist/plugin/geolocation/src/plugin/appearance/types/appearance.d.ts +3 -3
  133. package/dist/plugin/geolocation/src/plugin/badge/types/badge.d.ts +3 -3
  134. package/dist/plugin/geolocation/src/plugin/battery/types/battery.d.ts +3 -3
  135. package/dist/plugin/geolocation/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  136. package/dist/plugin/geolocation/src/plugin/dimension/constants/index.d.ts +8 -3
  137. package/dist/plugin/geolocation/src/plugin/dimension/types/dimensions.d.ts +37 -15
  138. package/dist/plugin/geolocation/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  139. package/dist/plugin/geolocation/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  140. package/dist/plugin/geolocation/src/plugin/notification/types/notification.d.ts +4 -4
  141. package/dist/plugin/geolocation/src/plugin/open/types/open.d.ts +12 -12
  142. package/dist/plugin/geolocation/src/plugin/permission/constants/index.d.ts +3 -1
  143. package/dist/plugin/geolocation/src/plugin/permission/types/permission.d.ts +7 -4
  144. package/dist/plugin/geolocation/src/plugin/pip/types/pip.d.ts +7 -7
  145. package/dist/plugin/geolocation/src/plugin/platform/types/platform.d.ts +13 -13
  146. package/dist/plugin/geolocation/src/plugin/theme/types/theme.d.ts +2 -2
  147. package/dist/plugin/geolocation/src/plugin/vibration/types/vibration.d.ts +3 -3
  148. package/dist/plugin/geolocation/src/types/subscription-manager.d.ts +3 -3
  149. package/dist/plugin/geolocation/src/utils/create-subscription-manager.d.ts +1 -1
  150. package/dist/plugin/notification/index.cjs +288 -13
  151. package/dist/plugin/notification/index.d.ts +4 -4
  152. package/dist/plugin/notification/index.mjs +288 -13
  153. package/dist/plugin/notification/src/plugin/appearance/types/appearance.d.ts +3 -3
  154. package/dist/plugin/notification/src/plugin/badge/types/badge.d.ts +3 -3
  155. package/dist/plugin/notification/src/plugin/battery/types/battery.d.ts +3 -3
  156. package/dist/plugin/notification/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  157. package/dist/plugin/notification/src/plugin/dimension/constants/index.d.ts +8 -3
  158. package/dist/plugin/notification/src/plugin/dimension/types/dimensions.d.ts +37 -15
  159. package/dist/plugin/notification/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  160. package/dist/plugin/notification/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  161. package/dist/plugin/notification/src/plugin/notification/types/notification.d.ts +4 -4
  162. package/dist/plugin/notification/src/plugin/open/types/open.d.ts +12 -12
  163. package/dist/plugin/notification/src/plugin/permission/constants/index.d.ts +3 -1
  164. package/dist/plugin/notification/src/plugin/permission/types/permission.d.ts +7 -4
  165. package/dist/plugin/notification/src/plugin/pip/types/pip.d.ts +7 -7
  166. package/dist/plugin/notification/src/plugin/platform/types/platform.d.ts +13 -13
  167. package/dist/plugin/notification/src/plugin/theme/types/theme.d.ts +2 -2
  168. package/dist/plugin/notification/src/plugin/vibration/types/vibration.d.ts +3 -3
  169. package/dist/plugin/notification/src/types/subscription-manager.d.ts +3 -3
  170. package/dist/plugin/notification/src/utils/create-subscription-manager.d.ts +1 -1
  171. package/dist/plugin/open/index.cjs +58 -49
  172. package/dist/plugin/open/index.d.ts +12 -12
  173. package/dist/plugin/open/index.mjs +58 -49
  174. package/dist/plugin/open/src/plugin/appearance/types/appearance.d.ts +3 -3
  175. package/dist/plugin/open/src/plugin/badge/types/badge.d.ts +3 -3
  176. package/dist/plugin/open/src/plugin/battery/types/battery.d.ts +3 -3
  177. package/dist/plugin/open/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  178. package/dist/plugin/open/src/plugin/dimension/constants/index.d.ts +8 -3
  179. package/dist/plugin/open/src/plugin/dimension/types/dimensions.d.ts +37 -15
  180. package/dist/plugin/open/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  181. package/dist/plugin/open/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  182. package/dist/plugin/open/src/plugin/notification/types/notification.d.ts +4 -4
  183. package/dist/plugin/open/src/plugin/open/types/open.d.ts +12 -12
  184. package/dist/plugin/open/src/plugin/permission/constants/index.d.ts +3 -1
  185. package/dist/plugin/open/src/plugin/permission/types/permission.d.ts +7 -4
  186. package/dist/plugin/open/src/plugin/pip/types/pip.d.ts +7 -7
  187. package/dist/plugin/open/src/plugin/platform/types/platform.d.ts +13 -13
  188. package/dist/plugin/open/src/plugin/theme/types/theme.d.ts +2 -2
  189. package/dist/plugin/open/src/plugin/vibration/types/vibration.d.ts +3 -3
  190. package/dist/plugin/open/src/types/subscription-manager.d.ts +3 -3
  191. package/dist/plugin/open/src/utils/create-subscription-manager.d.ts +1 -1
  192. package/dist/plugin/permission/index.cjs +372 -13
  193. package/dist/plugin/permission/index.d.ts +11 -5
  194. package/dist/plugin/permission/index.mjs +372 -13
  195. package/dist/plugin/permission/src/plugin/appearance/types/appearance.d.ts +3 -3
  196. package/dist/plugin/permission/src/plugin/badge/types/badge.d.ts +3 -3
  197. package/dist/plugin/permission/src/plugin/battery/types/battery.d.ts +3 -3
  198. package/dist/plugin/permission/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  199. package/dist/plugin/permission/src/plugin/dimension/constants/index.d.ts +8 -3
  200. package/dist/plugin/permission/src/plugin/dimension/types/dimensions.d.ts +37 -15
  201. package/dist/plugin/permission/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  202. package/dist/plugin/permission/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  203. package/dist/plugin/permission/src/plugin/notification/types/notification.d.ts +4 -4
  204. package/dist/plugin/permission/src/plugin/open/types/open.d.ts +12 -12
  205. package/dist/plugin/permission/src/plugin/permission/constants/index.d.ts +3 -1
  206. package/dist/plugin/permission/src/plugin/permission/types/permission.d.ts +7 -4
  207. package/dist/plugin/permission/src/plugin/pip/types/pip.d.ts +7 -7
  208. package/dist/plugin/permission/src/plugin/platform/types/platform.d.ts +13 -13
  209. package/dist/plugin/permission/src/plugin/theme/types/theme.d.ts +2 -2
  210. package/dist/plugin/permission/src/plugin/vibration/types/vibration.d.ts +3 -3
  211. package/dist/plugin/permission/src/types/subscription-manager.d.ts +3 -3
  212. package/dist/plugin/permission/src/utils/create-subscription-manager.d.ts +1 -1
  213. package/dist/plugin/pip/index.cjs +49 -46
  214. package/dist/plugin/pip/index.d.ts +7 -7
  215. package/dist/plugin/pip/index.mjs +49 -46
  216. package/dist/plugin/pip/src/plugin/appearance/types/appearance.d.ts +3 -3
  217. package/dist/plugin/pip/src/plugin/badge/types/badge.d.ts +3 -3
  218. package/dist/plugin/pip/src/plugin/battery/types/battery.d.ts +3 -3
  219. package/dist/plugin/pip/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  220. package/dist/plugin/pip/src/plugin/dimension/constants/index.d.ts +8 -3
  221. package/dist/plugin/pip/src/plugin/dimension/types/dimensions.d.ts +37 -15
  222. package/dist/plugin/pip/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  223. package/dist/plugin/pip/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  224. package/dist/plugin/pip/src/plugin/notification/types/notification.d.ts +4 -4
  225. package/dist/plugin/pip/src/plugin/open/types/open.d.ts +12 -12
  226. package/dist/plugin/pip/src/plugin/permission/constants/index.d.ts +3 -1
  227. package/dist/plugin/pip/src/plugin/permission/types/permission.d.ts +7 -4
  228. package/dist/plugin/pip/src/plugin/pip/types/pip.d.ts +7 -7
  229. package/dist/plugin/pip/src/plugin/platform/types/platform.d.ts +13 -13
  230. package/dist/plugin/pip/src/plugin/theme/types/theme.d.ts +2 -2
  231. package/dist/plugin/pip/src/plugin/vibration/types/vibration.d.ts +3 -3
  232. package/dist/plugin/pip/src/types/subscription-manager.d.ts +3 -3
  233. package/dist/plugin/pip/src/utils/create-subscription-manager.d.ts +1 -1
  234. package/dist/plugin/platform/index.cjs +87 -80
  235. package/dist/plugin/platform/index.d.ts +13 -13
  236. package/dist/plugin/platform/index.mjs +87 -80
  237. package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +3 -3
  238. package/dist/plugin/platform/src/plugin/badge/types/badge.d.ts +3 -3
  239. package/dist/plugin/platform/src/plugin/battery/types/battery.d.ts +3 -3
  240. package/dist/plugin/platform/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  241. package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +8 -3
  242. package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +37 -15
  243. package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  244. package/dist/plugin/platform/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  245. package/dist/plugin/platform/src/plugin/notification/types/notification.d.ts +4 -4
  246. package/dist/plugin/platform/src/plugin/open/types/open.d.ts +12 -12
  247. package/dist/plugin/platform/src/plugin/permission/constants/index.d.ts +3 -1
  248. package/dist/plugin/platform/src/plugin/permission/types/permission.d.ts +7 -4
  249. package/dist/plugin/platform/src/plugin/pip/types/pip.d.ts +7 -7
  250. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +13 -13
  251. package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -2
  252. package/dist/plugin/platform/src/plugin/vibration/types/vibration.d.ts +3 -3
  253. package/dist/plugin/platform/src/types/subscription-manager.d.ts +3 -3
  254. package/dist/plugin/platform/src/utils/create-subscription-manager.d.ts +1 -1
  255. package/dist/plugin/theme/index.cjs +58 -49
  256. package/dist/plugin/theme/index.d.ts +2 -2
  257. package/dist/plugin/theme/index.mjs +58 -49
  258. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +3 -3
  259. package/dist/plugin/theme/src/plugin/badge/types/badge.d.ts +3 -3
  260. package/dist/plugin/theme/src/plugin/battery/types/battery.d.ts +3 -3
  261. package/dist/plugin/theme/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  262. package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +8 -3
  263. package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +37 -15
  264. package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  265. package/dist/plugin/theme/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  266. package/dist/plugin/theme/src/plugin/notification/types/notification.d.ts +4 -4
  267. package/dist/plugin/theme/src/plugin/open/types/open.d.ts +12 -12
  268. package/dist/plugin/theme/src/plugin/permission/constants/index.d.ts +3 -1
  269. package/dist/plugin/theme/src/plugin/permission/types/permission.d.ts +7 -4
  270. package/dist/plugin/theme/src/plugin/pip/types/pip.d.ts +7 -7
  271. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +13 -13
  272. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -2
  273. package/dist/plugin/theme/src/plugin/vibration/types/vibration.d.ts +3 -3
  274. package/dist/plugin/theme/src/types/subscription-manager.d.ts +3 -3
  275. package/dist/plugin/theme/src/utils/create-subscription-manager.d.ts +1 -1
  276. package/dist/plugin/vibration/index.d.ts +3 -3
  277. package/dist/plugin/vibration/src/plugin/appearance/types/appearance.d.ts +3 -3
  278. package/dist/plugin/vibration/src/plugin/badge/types/badge.d.ts +3 -3
  279. package/dist/plugin/vibration/src/plugin/battery/types/battery.d.ts +3 -3
  280. package/dist/plugin/vibration/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  281. package/dist/plugin/vibration/src/plugin/dimension/constants/index.d.ts +8 -3
  282. package/dist/plugin/vibration/src/plugin/dimension/types/dimensions.d.ts +37 -15
  283. package/dist/plugin/vibration/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  284. package/dist/plugin/vibration/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  285. package/dist/plugin/vibration/src/plugin/notification/types/notification.d.ts +4 -4
  286. package/dist/plugin/vibration/src/plugin/open/types/open.d.ts +12 -12
  287. package/dist/plugin/vibration/src/plugin/permission/constants/index.d.ts +3 -1
  288. package/dist/plugin/vibration/src/plugin/permission/types/permission.d.ts +7 -4
  289. package/dist/plugin/vibration/src/plugin/pip/types/pip.d.ts +7 -7
  290. package/dist/plugin/vibration/src/plugin/platform/types/platform.d.ts +13 -13
  291. package/dist/plugin/vibration/src/plugin/theme/types/theme.d.ts +2 -2
  292. package/dist/plugin/vibration/src/plugin/vibration/types/vibration.d.ts +3 -3
  293. package/dist/plugin/vibration/src/types/subscription-manager.d.ts +3 -3
  294. package/dist/plugin/vibration/src/utils/create-subscription-manager.d.ts +1 -1
  295. package/dist/src/plugin/appearance/types/appearance.d.ts +3 -3
  296. package/dist/src/plugin/badge/types/badge.d.ts +3 -3
  297. package/dist/src/plugin/battery/types/battery.d.ts +3 -3
  298. package/dist/src/plugin/clipboard/types/clipboard.d.ts +2 -2
  299. package/dist/src/plugin/dimension/constants/index.d.ts +8 -3
  300. package/dist/src/plugin/dimension/types/dimensions.d.ts +37 -15
  301. package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +7 -7
  302. package/dist/src/plugin/geolocation/types/geolocation.d.ts +4 -4
  303. package/dist/src/plugin/notification/types/notification.d.ts +4 -4
  304. package/dist/src/plugin/open/types/open.d.ts +12 -12
  305. package/dist/src/plugin/permission/constants/index.d.ts +3 -1
  306. package/dist/src/plugin/permission/types/permission.d.ts +7 -4
  307. package/dist/src/plugin/pip/types/pip.d.ts +7 -7
  308. package/dist/src/plugin/platform/types/platform.d.ts +13 -13
  309. package/dist/src/plugin/theme/types/theme.d.ts +2 -2
  310. package/dist/src/plugin/vibration/types/vibration.d.ts +3 -3
  311. package/dist/src/types/subscription-manager.d.ts +3 -3
  312. package/dist/src/utils/create-subscription-manager.d.ts +1 -1
  313. package/package.json +1 -1
@@ -21,9 +21,20 @@ var FALLBACK_MEDIA_QUERY_LIST = {
21
21
 
22
22
  exports.Orientation = void 0;
23
23
  (function (Orientation) {
24
- Orientation["Portrait"] = "portrait";
25
- Orientation["Landscape"] = "landscape";
26
- Orientation["Unknown"] = "unknown";
24
+ Orientation["PortraitPrimary"] = "portrait-primary";
25
+ Orientation["PortraitSecondary"] = "portrait-secondary";
26
+ Orientation["LandscapePrimary"] = "landscape-primary";
27
+ Orientation["LandscapeSecondary"] = "landscape-secondary";
28
+ })(exports.Orientation || (exports.Orientation = {}));
29
+ (function (Orientation) {
30
+ function isLandscape(orientation) {
31
+ return orientation === Orientation.LandscapePrimary || orientation === Orientation.LandscapeSecondary;
32
+ }
33
+ Orientation.isLandscape = isLandscape;
34
+ function isPortrait(orientation) {
35
+ return orientation === Orientation.PortraitPrimary || orientation === Orientation.PortraitSecondary;
36
+ }
37
+ Orientation.isPortrait = isPortrait;
27
38
  })(exports.Orientation || (exports.Orientation = {}));
28
39
  var ENV_PRESETS = {
29
40
  'safe-area-inset': {
@@ -475,7 +486,6 @@ function createViewportSegmentObserver() {
475
486
  var segmentMediaQueryLists = [];
476
487
  var previousSegments = null;
477
488
  function attachCSSFallbackListeners() {
478
- EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
479
489
  segmentMediaQueryLists = buildSegmentMediaQueryLists();
480
490
  for (var i = 0; i < segmentMediaQueryLists.length; i++)
481
491
  EventListener.add(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
@@ -483,50 +493,53 @@ function createViewportSegmentObserver() {
483
493
  EventListener.add(exports.DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
484
494
  }
485
495
  function detachCSSFallbackListeners() {
486
- EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
487
496
  for (var i = 0; i < segmentMediaQueryLists.length; i++)
488
497
  EventListener.remove(segmentMediaQueryLists[i], { type: 'change', callback: onSegmentChange });
489
498
  segmentMediaQueryLists = [];
490
499
  if (exports.DEVICE_POSTURE_MEDIA_QUERY_LIST.media !== 'not all')
491
500
  EventListener.remove(exports.DEVICE_POSTURE_MEDIA_QUERY_LIST, { type: 'change', callback: onSegmentChange });
492
501
  }
502
+ function attachDevicePostureChangeListener() {
503
+ if (hasDevicePosture)
504
+ EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
505
+ attachCSSFallbackListeners();
506
+ }
507
+ function detachDevicePostureChangeListener() {
508
+ if (hasDevicePosture)
509
+ EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
510
+ detachCSSFallbackListeners();
511
+ }
512
+ function attachVisualViewportResizeListener() {
513
+ EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
514
+ }
515
+ function detachVisualViewportResizeListener() {
516
+ EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
517
+ }
493
518
  function attachOnChange() {
519
+ EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
494
520
  if (hasSegmentsAPI) {
495
- if (hasDevicePosture) {
496
- EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
497
- EventListener.add(globalThis, { type: 'resize', callback: onSegmentChange });
498
- }
499
- else {
500
- attachCSSFallbackListeners();
501
- }
521
+ attachDevicePostureChangeListener();
502
522
  }
503
523
  else if (hasLegacySegmentsAPI) {
504
- EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
505
- if (hasSegmentsAPI)
506
- EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
524
+ attachVisualViewportResizeListener();
525
+ attachDevicePostureChangeListener();
507
526
  }
508
527
  else {
509
528
  getOrCreateCachedDiv();
510
- attachCSSFallbackListeners();
529
+ attachVisualViewportResizeListener();
511
530
  }
512
531
  }
513
532
  function detachOnChange() {
533
+ EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
514
534
  if (hasSegmentsAPI) {
515
- if (hasDevicePosture) {
516
- EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
517
- EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
518
- }
519
- else {
520
- detachCSSFallbackListeners();
521
- }
535
+ detachDevicePostureChangeListener();
522
536
  }
523
537
  else if (hasLegacySegmentsAPI) {
524
- EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
525
- if (hasSegmentsAPI)
526
- EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
538
+ detachVisualViewportResizeListener();
539
+ detachDevicePostureChangeListener();
527
540
  }
528
541
  else {
529
- detachCSSFallbackListeners();
542
+ detachVisualViewportResizeListener();
530
543
  releaseDiv();
531
544
  }
532
545
  }
@@ -678,7 +691,7 @@ function createViewportSegmentObserver() {
678
691
  function applySegments(segments) {
679
692
  for (var i = segments.length; i < lastCount; i++) {
680
693
  for (var j = 0; j < attributes.length; j++) {
681
- element.style.removeProperty("--".concat(prefix, "-").concat(i, "-").concat(attributes[j]));
694
+ element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
682
695
  }
683
696
  }
684
697
  lastCount = segments.length;
@@ -686,7 +699,7 @@ function createViewportSegmentObserver() {
686
699
  var segment = segments[i];
687
700
  for (var j = 0; j < attributes.length; j++) {
688
701
  var attribute = attributes[j];
689
- element.style.setProperty("--".concat(prefix, "-").concat(i, "-").concat(attribute), segment[attribute] + 'px');
702
+ element.style.setProperty('--' + prefix + '-' + i + '-' + attribute, segment[attribute] + 'px');
690
703
  }
691
704
  }
692
705
  }
@@ -698,7 +711,7 @@ function createViewportSegmentObserver() {
698
711
  unsubscribe();
699
712
  for (var i = 0; i < lastCount; i++)
700
713
  for (var j = 0; j < attributes.length; j++)
701
- element.style.removeProperty("--".concat(prefix, "-").concat(i, "-").concat(attributes[j]));
714
+ element.style.removeProperty('--' + prefix + '-' + i + '-' + attributes[j]);
702
715
  lastCount = 0;
703
716
  };
704
717
  }
@@ -712,15 +725,11 @@ function createViewportSegmentObserver() {
712
725
  }
713
726
  function createVirtualKeyboardObserver() {
714
727
  var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
715
- var previousOverlaysContent = false;
716
728
  function attachOnChange() {
717
- previousOverlaysContent = globalThis.navigator.virtualKeyboard.overlaysContent;
718
- globalThis.navigator.virtualKeyboard.overlaysContent = true;
719
729
  EventListener.add(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
720
730
  }
721
731
  function detachOnChange() {
722
732
  EventListener.remove(globalThis.navigator.virtualKeyboard, { type: 'geometrychange', callback: onGeometryChange, options: { passive: true } });
723
- globalThis.navigator.virtualKeyboard.overlaysContent = previousOverlaysContent;
724
733
  }
725
734
  function onGeometryChange() {
726
735
  onChangeSubscriptionManager.emit(getValue());
@@ -758,7 +767,7 @@ function createVirtualKeyboardObserver() {
758
767
  function applyValues(values) {
759
768
  for (var i = 0; i < attributes.length; i++) {
760
769
  var attribute = attributes[i];
761
- element.style.setProperty("--".concat(prefix, "-").concat(attribute), values[attribute] + 'px');
770
+ element.style.setProperty('--' + prefix + '-' + attribute, values[attribute] + 'px');
762
771
  }
763
772
  }
764
773
  applyValues(getValue());
@@ -768,7 +777,7 @@ function createVirtualKeyboardObserver() {
768
777
  return function () {
769
778
  unsubscribe();
770
779
  for (var i = 0; i < attributes.length; i++)
771
- element.style.removeProperty("--".concat(prefix, "-").concat(attributes[i]));
780
+ element.style.removeProperty('--' + prefix + '-' + attributes[i]);
772
781
  };
773
782
  }
774
783
  return {
@@ -957,7 +966,7 @@ function createEnvironmentObserver(preset) {
957
966
  function applyValues(values) {
958
967
  for (var i = 0; i < attributes.length; i++) {
959
968
  var attribute = attributes[i];
960
- element.style.setProperty("--".concat(prefix, "-").concat(String(attribute)), values[attribute] + 'px');
969
+ element.style.setProperty('--' + prefix + '-' + String(attributes[i]), values[attribute] + 'px');
961
970
  }
962
971
  }
963
972
  var unsubscribe = onChangeSubscriptionManager.subscribe(function (values) {
@@ -967,7 +976,7 @@ function createEnvironmentObserver(preset) {
967
976
  return function () {
968
977
  unsubscribe();
969
978
  for (var i = 0; i < attributes.length; i++)
970
- element.style.removeProperty("--".concat(prefix, "-").concat(String(attributes[i])));
979
+ element.style.removeProperty('--' + prefix + '-' + String(attributes[i]));
971
980
  };
972
981
  }
973
982
  return {
@@ -989,51 +998,151 @@ function createEnvironmentObserver(preset) {
989
998
  };
990
999
  }
991
1000
 
1001
+ function createCustomError(name, Base) {
1002
+ if (Base === void 0) { Base = Error; }
1003
+ function CustomError(message) {
1004
+ if (!(this instanceof CustomError))
1005
+ return new CustomError(message);
1006
+ var error = (function () {
1007
+ if (typeof message === 'undefined')
1008
+ return new Base('');
1009
+ return new Base(message);
1010
+ })();
1011
+ if (typeof Object.setPrototypeOf === 'function')
1012
+ Object.setPrototypeOf(error, CustomError.prototype);
1013
+ else
1014
+ error.__proto__ = CustomError.prototype;
1015
+ error.name = name;
1016
+ if (typeof message !== 'undefined')
1017
+ error.message = message;
1018
+ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1019
+ try {
1020
+ Object.defineProperty(error, Symbol.toStringTag, {
1021
+ value: name,
1022
+ writable: false,
1023
+ enumerable: false,
1024
+ configurable: true
1025
+ });
1026
+ }
1027
+ catch (_) {
1028
+ }
1029
+ }
1030
+ if (typeof Error.captureStackTrace === 'function') {
1031
+ Error.captureStackTrace(error, CustomError);
1032
+ }
1033
+ else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
1034
+ Base.captureStackTrace(error, CustomError);
1035
+ }
1036
+ else {
1037
+ try {
1038
+ var tempError = new Base();
1039
+ if (tempError.stack)
1040
+ error.stack = tempError.stack;
1041
+ }
1042
+ catch (_) {
1043
+ }
1044
+ }
1045
+ return error;
1046
+ }
1047
+ CustomError.prototype = Object.create(Base.prototype, {
1048
+ constructor: {
1049
+ value: CustomError,
1050
+ writable: true,
1051
+ enumerable: false,
1052
+ configurable: true
1053
+ }
1054
+ });
1055
+ try {
1056
+ Object.defineProperty(CustomError.prototype, 'name', {
1057
+ value: name,
1058
+ writable: true,
1059
+ enumerable: false,
1060
+ configurable: true
1061
+ });
1062
+ }
1063
+ catch (_) {
1064
+ try {
1065
+ CustomError.prototype.name = name;
1066
+ }
1067
+ catch (_) {
1068
+ }
1069
+ }
1070
+ try {
1071
+ Object.defineProperty(CustomError, 'name', {
1072
+ value: name,
1073
+ writable: false,
1074
+ enumerable: false,
1075
+ configurable: true
1076
+ });
1077
+ }
1078
+ catch (_) {
1079
+ }
1080
+ return CustomError;
1081
+ }
1082
+
1083
+ var PermissionNotGrantedError = createCustomError('PermissionNotGrantedError');
1084
+
1085
+ var NotSupportedError = createCustomError('NotSupportedError');
1086
+
992
1087
  var safeAreaInsetObserver = createEnvironmentObserver('safe-area-inset');
993
1088
  var safeAreaMaxInsetObserver = createEnvironmentObserver('safe-area-max-inset');
994
1089
  var keyboardInsetObserver = createEnvironmentObserver('keyboard-inset');
995
1090
  var titlebarAreaObserver = createEnvironmentObserver('titlebar-area');
996
1091
  var viewportSegmentObserver = createEnvironmentObserver('viewport-segment');
997
- var onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
1092
+ var onDimensionChangeSubscriptionManager = createSubscriptionManager(attachOnDimensionChange, detachOnDimensionChange);
1093
+ var onScreenOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnScreenOrientationChange, detachOnScreenOrientationChange);
1094
+ var onDeviceOrientationChangeSubscriptionManager = createSubscriptionManager(attachOnDeviceOrientationChange, detachOnDeviceOrientationChange);
998
1095
  var dimensionRef = null;
1096
+ var screenOrientationRef = null;
1097
+ var deviceOrientationRef = null;
999
1098
  var Dimension = {
1000
1099
  get value() {
1001
1100
  return getDimension();
1002
1101
  },
1003
1102
  environment: getEnvironment(),
1004
- onChange: onChangeSubscriptionManager.subscribe,
1103
+ screenOrientation: getScreenOrientation(),
1104
+ deviceOrientation: getDeviceOrientation(),
1105
+ onChange: onDimensionChangeSubscriptionManager.subscribe,
1005
1106
  Constants: {
1006
1107
  Orientation: exports.Orientation,
1007
1108
  },
1008
- Errors: {},
1109
+ Errors: {
1110
+ NotSupportedError: NotSupportedError,
1111
+ PermissionNotGrantedError: PermissionNotGrantedError,
1112
+ },
1009
1113
  };
1010
1114
  function getOrientation() {
1011
- if (typeof globalThis.screen !== 'undefined') {
1115
+ if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined') {
1012
1116
  switch (globalThis.screen.orientation.type) {
1013
1117
  case 'portrait-primary':
1118
+ return exports.Orientation.PortraitPrimary;
1014
1119
  case 'portrait-secondary':
1015
- return exports.Orientation.Portrait;
1120
+ return exports.Orientation.PortraitSecondary;
1016
1121
  case 'landscape-primary':
1122
+ return exports.Orientation.LandscapePrimary;
1017
1123
  case 'landscape-secondary':
1018
- return exports.Orientation.Landscape;
1124
+ return exports.Orientation.LandscapeSecondary;
1019
1125
  }
1020
1126
  }
1021
1127
  if (typeof globalThis.orientation !== 'undefined') {
1022
1128
  switch (globalThis.orientation) {
1023
1129
  case 0:
1130
+ return exports.Orientation.PortraitPrimary;
1024
1131
  case 180:
1025
- return exports.Orientation.Portrait;
1132
+ return exports.Orientation.PortraitSecondary;
1026
1133
  case 90:
1134
+ return exports.Orientation.LandscapePrimary;
1135
+ case -90:
1027
1136
  case 270:
1028
- return exports.Orientation.Landscape;
1137
+ return exports.Orientation.LandscapeSecondary;
1029
1138
  }
1030
1139
  }
1031
1140
  if (exports.ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
1032
- return exports.Orientation.Unknown;
1033
- else if (exports.ORIENTATION_MEDIA_QUERY_LIST.matches)
1034
- return exports.Orientation.Portrait;
1141
+ throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
1142
+ if (exports.ORIENTATION_MEDIA_QUERY_LIST.matches)
1143
+ return exports.Orientation.PortraitPrimary;
1035
1144
  else
1036
- return exports.Orientation.Landscape;
1145
+ return exports.Orientation.LandscapePrimary;
1037
1146
  }
1038
1147
  function getScale() {
1039
1148
  if (typeof globalThis.devicePixelRatio !== 'undefined')
@@ -1049,47 +1158,168 @@ function getEnvironment() {
1049
1158
  viewportSegment: viewportSegmentObserver,
1050
1159
  };
1051
1160
  }
1052
- function getDimension() {
1053
- var dimensions = {
1054
- innerWidth: 0,
1055
- innerHeight: 0,
1056
- outerWidth: 0,
1057
- outerHeight: 0,
1058
- scale: getScale(),
1059
- orientation: getOrientation(),
1161
+ function getScreenOrientation() {
1162
+ return {
1163
+ get supported() {
1164
+ return screenOrientationSupported();
1165
+ },
1166
+ get value() {
1167
+ return getOrientation();
1168
+ },
1169
+ onChange: onScreenOrientationChangeSubscriptionManager.subscribe,
1060
1170
  };
1171
+ }
1172
+ function getDeviceOrientation() {
1173
+ return {
1174
+ get supported() {
1175
+ return deviceOrientationSupported();
1176
+ },
1177
+ get value() {
1178
+ return getDeviceOrientationValue();
1179
+ },
1180
+ onChange: onDeviceOrientationChangeSubscriptionManager.subscribe,
1181
+ };
1182
+ }
1183
+ function getDimension() {
1184
+ var innerWidth = 0;
1185
+ var innerHeight = 0;
1186
+ var outerWidth = 0;
1187
+ var outerHeight = 0;
1188
+ var scale = getScale();
1061
1189
  if (typeof globalThis.innerWidth !== 'undefined') {
1062
- dimensions.innerWidth = globalThis.innerWidth;
1063
- dimensions.innerHeight = globalThis.innerHeight;
1064
- dimensions.outerWidth = globalThis.outerWidth;
1065
- dimensions.outerHeight = globalThis.outerHeight;
1190
+ innerWidth = globalThis.innerWidth;
1191
+ innerHeight = globalThis.innerHeight;
1192
+ outerWidth = globalThis.outerWidth;
1193
+ outerHeight = globalThis.outerHeight;
1066
1194
  }
1067
- return dimensions;
1195
+ return {
1196
+ innerWidth: innerWidth,
1197
+ innerHeight: innerHeight,
1198
+ outerWidth: outerWidth,
1199
+ outerHeight: outerHeight,
1200
+ scale: scale,
1201
+ };
1068
1202
  }
1069
- function attachOnChange() {
1203
+ function attachOnDimensionChange() {
1070
1204
  dimensionRef = getDimension();
1071
- EventListener.add(globalThis, { type: 'resize', callback: onResize });
1072
- if (typeof globalThis.screen.orientation.addEventListener === 'function')
1073
- EventListener.add(globalThis.screen.orientation, { type: 'change', callback: onResize });
1205
+ EventListener.add(globalThis, { type: 'resize', callback: onDimensionChange });
1206
+ }
1207
+ function detachOnDimensionChange() {
1208
+ dimensionRef = null;
1209
+ EventListener.remove(globalThis, { type: 'resize', callback: onDimensionChange });
1210
+ }
1211
+ function onDimensionChange() {
1212
+ var dimension = getDimension();
1213
+ if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale)
1214
+ onDimensionChangeSubscriptionManager.emit(dimensionRef = dimension);
1215
+ }
1216
+ function screenOrientationSupported() {
1217
+ if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.type !== 'undefined')
1218
+ return true;
1219
+ if (typeof globalThis.orientation !== 'undefined')
1220
+ return true;
1221
+ return exports.ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all';
1222
+ }
1223
+ function attachOnScreenOrientationChange() {
1224
+ if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.addEventListener === 'function')
1225
+ EventListener.add(globalThis.screen.orientation, {
1226
+ type: 'change',
1227
+ callback: onScreenOrientationChange
1228
+ });
1074
1229
  else if (typeof globalThis.orientation !== 'undefined')
1075
- EventListener.add(globalThis, { type: 'orientationChange', callback: onResize });
1230
+ EventListener.add(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
1076
1231
  else if (exports.ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
1077
- EventListener.add(exports.ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
1232
+ EventListener.add(exports.ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
1233
+ throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
1078
1234
  }
1079
- function detachOnChange() {
1080
- dimensionRef = null;
1081
- EventListener.remove(globalThis, { type: 'resize', callback: onResize });
1082
- if (typeof globalThis.screen.orientation.removeEventListener === 'function')
1083
- EventListener.remove(globalThis.screen.orientation, { type: 'change', callback: onResize });
1235
+ function detachOnScreenOrientationChange() {
1236
+ if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.removeEventListener === 'function')
1237
+ EventListener.remove(globalThis.screen.orientation, {
1238
+ type: 'change',
1239
+ callback: onScreenOrientationChange
1240
+ });
1084
1241
  else if (typeof globalThis.orientation !== 'undefined')
1085
- EventListener.remove(globalThis, { type: 'orientationChange', callback: onResize });
1242
+ EventListener.remove(globalThis, { type: 'orientationchange', callback: onScreenOrientationChange });
1086
1243
  else if (exports.ORIENTATION_MEDIA_QUERY_LIST.media !== 'not all')
1087
- EventListener.remove(exports.ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onResize });
1244
+ EventListener.remove(exports.ORIENTATION_MEDIA_QUERY_LIST, { type: 'change', callback: onScreenOrientationChange });
1245
+ throw new NotSupportedError('\'screen.orientation\', \'window.orientation\', and the orientation media query are all unsupported');
1088
1246
  }
1089
- function onResize() {
1090
- var dimension = getDimension();
1091
- if (dimensionRef === null || dimension.innerWidth !== dimensionRef.innerWidth || dimension.innerHeight !== dimensionRef.innerHeight || dimension.outerWidth !== dimensionRef.outerWidth || dimension.outerHeight !== dimensionRef.outerHeight || dimension.scale !== dimensionRef.scale || dimension.orientation !== dimensionRef.orientation)
1092
- onChangeSubscriptionManager.emit(dimensionRef = dimension);
1247
+ function onScreenOrientationChange() {
1248
+ var orientation = getOrientation();
1249
+ if (screenOrientationRef === null || orientation !== screenOrientationRef)
1250
+ onScreenOrientationChangeSubscriptionManager.emit(screenOrientationRef = orientation);
1251
+ }
1252
+ function deviceOrientationSupported() {
1253
+ return typeof globalThis.DeviceOrientationEvent !== 'undefined';
1254
+ }
1255
+ function attachOnDeviceOrientationChange() {
1256
+ return new Promise(function (resolve, reject) {
1257
+ if (!deviceOrientationSupported())
1258
+ return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
1259
+ var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
1260
+ if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
1261
+ DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
1262
+ if (permission === 'granted') {
1263
+ EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
1264
+ return resolve();
1265
+ }
1266
+ return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
1267
+ }).catch(function (_) {
1268
+ return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
1269
+ });
1270
+ }
1271
+ else {
1272
+ EventListener.add(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
1273
+ return resolve();
1274
+ }
1275
+ });
1276
+ }
1277
+ function detachOnDeviceOrientationChange() {
1278
+ EventListener.remove(globalThis, { type: 'deviceorientation', callback: onDeviceOrientationChange });
1279
+ }
1280
+ function onDeviceOrientationChange(event) {
1281
+ deviceOrientationRef = {
1282
+ alpha: event.alpha,
1283
+ beta: event.beta,
1284
+ gamma: event.gamma,
1285
+ absolute: event.absolute,
1286
+ };
1287
+ onDeviceOrientationChangeSubscriptionManager.emit(deviceOrientationRef);
1288
+ }
1289
+ function getDeviceOrientationValue() {
1290
+ return new Promise(function (resolve, reject) {
1291
+ if (deviceOrientationRef !== null)
1292
+ return resolve(deviceOrientationRef);
1293
+ if (!deviceOrientationSupported())
1294
+ return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
1295
+ var DeviceOrientationEventWithPermission = DeviceOrientationEvent;
1296
+ var callback = function (event) {
1297
+ var value = {
1298
+ alpha: event.alpha,
1299
+ beta: event.beta,
1300
+ gamma: event.gamma,
1301
+ absolute: event.absolute,
1302
+ };
1303
+ deviceOrientationRef = value;
1304
+ EventListener.remove(globalThis, { type: 'deviceorientation', callback: callback });
1305
+ return resolve(value);
1306
+ };
1307
+ if (typeof DeviceOrientationEventWithPermission.requestPermission === 'function') {
1308
+ DeviceOrientationEventWithPermission.requestPermission().then(function (permission) {
1309
+ if (permission === 'granted') {
1310
+ EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
1311
+ return;
1312
+ }
1313
+ return reject(new PermissionNotGrantedError('\'deviceorientation\' permission is not granted.'));
1314
+ }).catch(function (_) {
1315
+ return reject(new NotSupportedError('\'window.DeviceOrientationEvent\' does not supported.'));
1316
+ });
1317
+ }
1318
+ else {
1319
+ EventListener.add(globalThis, { type: 'deviceorientation', callback: callback });
1320
+ return;
1321
+ }
1322
+ });
1093
1323
  }
1094
1324
 
1095
1325
  exports.ENV_PRESETS = ENV_PRESETS;
@@ -1,7 +1,12 @@
1
1
  declare enum Orientation {
2
- Portrait = "portrait",
3
- Landscape = "landscape",
4
- Unknown = "unknown"
2
+ PortraitPrimary = "portrait-primary",
3
+ PortraitSecondary = "portrait-secondary",
4
+ LandscapePrimary = "landscape-primary",
5
+ LandscapeSecondary = "landscape-secondary"
6
+ }
7
+ declare namespace Orientation {
8
+ function isLandscape(orientation: Orientation): boolean;
9
+ function isPortrait(orientation: Orientation): boolean;
5
10
  }
6
11
  declare const ENV_PRESETS: {
7
12
  readonly 'safe-area-inset': {
@@ -42,17 +47,21 @@ declare const ENV_PRESETS: {
42
47
  declare let ORIENTATION_MEDIA_QUERY_LIST: MediaQueryList;
43
48
  declare let DEVICE_POSTURE_MEDIA_QUERY_LIST: MediaQueryList;
44
49
 
50
+ declare const NotSupportedError: ErrorConstructor;
51
+
52
+ declare const PermissionNotGrantedError: ErrorConstructor;
53
+
45
54
  type EnvironmentPresetKey = keyof typeof ENV_PRESETS;
46
55
  type EnvironmentPresetAttribute<K extends EnvironmentPresetKey> = keyof typeof ENV_PRESETS[K];
47
56
  type EnvironmentPresetValues<K extends EnvironmentPresetKey> = {
48
57
  [P in EnvironmentPresetAttribute<K>]: number;
49
58
  };
50
59
  declare interface Environment {
51
- safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
52
- safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
53
- keyboardInset: EnvironmentObserver<'keyboard-inset'>;
54
- titlebarArea: EnvironmentObserver<'titlebar-area'>;
55
- viewportSegment: EnvironmentObserver<'viewport-segment'>;
60
+ readonly safeAreaInset: EnvironmentObserver<'safe-area-inset'>;
61
+ readonly safeAreaMaxInset: EnvironmentObserver<'safe-area-max-inset'>;
62
+ readonly keyboardInset: EnvironmentObserver<'keyboard-inset'>;
63
+ readonly titlebarArea: EnvironmentObserver<'titlebar-area'>;
64
+ readonly viewportSegment: EnvironmentObserver<'viewport-segment'>;
56
65
  }
57
66
  declare interface SegmentsObserver {
58
67
  get value(): EnvironmentPresetValues<'viewport-segment'>[];
@@ -65,21 +74,41 @@ declare type EnvironmentObserver<K extends EnvironmentPresetKey> = K extends 'vi
65
74
  useCssVariable(prefix: string): () => void;
66
75
  };
67
76
  declare interface Dimensions {
68
- outerWidth: number;
69
- outerHeight: number;
70
- innerWidth: number;
71
- innerHeight: number;
72
- scale: number;
73
- orientation: Orientation;
77
+ readonly outerWidth: number;
78
+ readonly outerHeight: number;
79
+ readonly innerWidth: number;
80
+ readonly innerHeight: number;
81
+ readonly scale: number;
82
+ }
83
+ declare interface DeviceOrientationValue {
84
+ readonly alpha: number | null;
85
+ readonly beta: number | null;
86
+ readonly gamma: number | null;
87
+ readonly absolute: boolean;
88
+ }
89
+ declare interface DeviceOrientationInstance {
90
+ get supported(): boolean;
91
+ readonly value: Promise<DeviceOrientationValue>;
92
+ onChange(listener: (value: DeviceOrientationValue) => void, options?: AddEventListenerOptions): () => void;
93
+ }
94
+ declare interface ScreenOrientationInstance {
95
+ get supported(): boolean;
96
+ readonly value: Orientation;
97
+ onChange(listener: (value: Orientation) => void, options?: AddEventListenerOptions): () => void;
74
98
  }
75
99
  declare interface DimensionInstance {
76
100
  get value(): Dimensions;
77
- environment: Environment;
101
+ readonly environment: Environment;
102
+ readonly screenOrientation: ScreenOrientationInstance;
103
+ readonly deviceOrientation: DeviceOrientationInstance;
78
104
  onChange(listener: (dimension: Dimensions) => void, options?: AddEventListenerOptions): () => void;
79
- Constants: {
80
- Orientation: typeof Orientation;
105
+ readonly Constants: {
106
+ readonly Orientation: typeof Orientation;
107
+ };
108
+ readonly Errors: {
109
+ readonly NotSupportedError: typeof NotSupportedError;
110
+ readonly PermissionNotGrantedError: typeof PermissionNotGrantedError;
81
111
  };
82
- Errors: {};
83
112
  }
84
113
 
85
114
  declare global {
@@ -100,4 +129,4 @@ declare global {
100
129
  declare const Dimension: DimensionInstance;
101
130
 
102
131
  export { DEVICE_POSTURE_MEDIA_QUERY_LIST, ENV_PRESETS, ORIENTATION_MEDIA_QUERY_LIST, Orientation, Dimension as default };
103
- export type { DimensionInstance, Dimensions, Environment, EnvironmentObserver, EnvironmentPresetAttribute, EnvironmentPresetKey, EnvironmentPresetValues, SegmentsObserver };
132
+ export type { DeviceOrientationInstance, DeviceOrientationValue, DimensionInstance, Dimensions, Environment, EnvironmentObserver, EnvironmentPresetAttribute, EnvironmentPresetKey, EnvironmentPresetValues, ScreenOrientationInstance, SegmentsObserver };