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
@@ -17,9 +17,20 @@ var FALLBACK_MEDIA_QUERY_LIST = {
17
17
 
18
18
  var Orientation;
19
19
  (function (Orientation) {
20
- Orientation["Portrait"] = "portrait";
21
- Orientation["Landscape"] = "landscape";
22
- Orientation["Unknown"] = "unknown";
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
- if (hasDevicePosture) {
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
- EventListener.add(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
501
- if (hasSegmentsAPI)
502
- EventListener.add(devicePosture, { type: 'change', callback: onSegmentChange });
520
+ attachVisualViewportResizeListener();
521
+ attachDevicePostureChangeListener();
503
522
  }
504
523
  else {
505
524
  getOrCreateCachedDiv();
506
- attachCSSFallbackListeners();
525
+ attachVisualViewportResizeListener();
507
526
  }
508
527
  }
509
528
  function detachOnChange() {
529
+ EventListener.remove(globalThis, { type: 'resize', callback: onSegmentChange });
510
530
  if (hasSegmentsAPI) {
511
- if (hasDevicePosture) {
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
- EventListener.remove(visualViewport, { type: 'resize', callback: onSegmentChange, options: { passive: true } });
521
- if (hasSegmentsAPI)
522
- EventListener.remove(devicePosture, { type: 'change', callback: onSegmentChange });
534
+ detachVisualViewportResizeListener();
535
+ detachDevicePostureChangeListener();
523
536
  }
524
537
  else {
525
- detachCSSFallbackListeners();
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("--".concat(prefix, "-").concat(i, "-").concat(attributes[j]));
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("--".concat(prefix, "-").concat(i, "-").concat(attribute), segment[attribute] + 'px');
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("--".concat(prefix, "-").concat(i, "-").concat(attributes[j]));
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("--".concat(prefix, "-").concat(attribute), values[attribute] + 'px');
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("--".concat(prefix, "-").concat(attributes[i]));
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("--".concat(prefix, "-").concat(String(attribute)), values[attribute] + 'px');
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("--".concat(prefix, "-").concat(String(attributes[i])));
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 onChangeSubscriptionManager = createSubscriptionManager(attachOnChange, detachOnChange);
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
- onChange: onChangeSubscriptionManager.subscribe,
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.Portrait;
1116
+ return Orientation.PortraitSecondary;
1012
1117
  case 'landscape-primary':
1118
+ return Orientation.LandscapePrimary;
1013
1119
  case 'landscape-secondary':
1014
- return Orientation.Landscape;
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.Portrait;
1128
+ return Orientation.PortraitSecondary;
1022
1129
  case 90:
1130
+ return Orientation.LandscapePrimary;
1131
+ case -90:
1023
1132
  case 270:
1024
- return Orientation.Landscape;
1133
+ return Orientation.LandscapeSecondary;
1025
1134
  }
1026
1135
  }
1027
1136
  if (ORIENTATION_MEDIA_QUERY_LIST.media === 'not all')
1028
- return Orientation.Unknown;
1029
- else if (ORIENTATION_MEDIA_QUERY_LIST.matches)
1030
- return Orientation.Portrait;
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.Landscape;
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 getDimension() {
1049
- var dimensions = {
1050
- innerWidth: 0,
1051
- innerHeight: 0,
1052
- outerWidth: 0,
1053
- outerHeight: 0,
1054
- scale: getScale(),
1055
- orientation: getOrientation(),
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
- dimensions.innerWidth = globalThis.innerWidth;
1059
- dimensions.innerHeight = globalThis.innerHeight;
1060
- dimensions.outerWidth = globalThis.outerWidth;
1061
- dimensions.outerHeight = globalThis.outerHeight;
1186
+ innerWidth = globalThis.innerWidth;
1187
+ innerHeight = globalThis.innerHeight;
1188
+ outerWidth = globalThis.outerWidth;
1189
+ outerHeight = globalThis.outerHeight;
1062
1190
  }
1063
- return dimensions;
1191
+ return {
1192
+ innerWidth: innerWidth,
1193
+ innerHeight: innerHeight,
1194
+ outerWidth: outerWidth,
1195
+ outerHeight: outerHeight,
1196
+ scale: scale,
1197
+ };
1064
1198
  }
1065
- function attachOnChange() {
1199
+ function attachOnDimensionChange() {
1066
1200
  dimensionRef = getDimension();
1067
- EventListener.add(globalThis, { type: 'resize', callback: onResize });
1068
- if (typeof globalThis.screen.orientation.addEventListener === 'function')
1069
- EventListener.add(globalThis.screen.orientation, { type: 'change', callback: onResize });
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
+ 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: 'orientationChange', callback: onResize });
1226
+ 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: onResize });
1228
+ 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 detachOnChange() {
1076
- dimensionRef = null;
1077
- EventListener.remove(globalThis, { type: 'resize', callback: onResize });
1078
- if (typeof globalThis.screen.orientation.removeEventListener === 'function')
1079
- EventListener.remove(globalThis.screen.orientation, { type: 'change', callback: onResize });
1231
+ function detachOnScreenOrientationChange() {
1232
+ if (typeof globalThis.screen !== 'undefined' && typeof globalThis.screen.orientation !== 'undefined' && typeof globalThis.screen.orientation.removeEventListener === 'function')
1233
+ 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: 'orientationChange', callback: onResize });
1238
+ 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: onResize });
1240
+ 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 onResize() {
1086
- var dimension = getDimension();
1087
- 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)
1088
- onChangeSubscriptionManager.emit(dimensionRef = dimension);
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,6 +1,6 @@
1
1
  export declare interface ClipboardInstance {
2
2
  copy(item: any): Promise<boolean>;
3
3
  paste(): Promise<string>;
4
- Constants: {};
5
- Errors: {};
4
+ readonly Constants: {};
5
+ readonly Errors: {};
6
6
  }
@@ -1,7 +1,12 @@
1
1
  export 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
+ 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': {