@chipmobilesdk/rn-ads 0.7.0 → 0.8.0

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 (319) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/lib/commonjs/config/resolveAdUnit.js +80 -0
  3. package/lib/commonjs/config/resolveAdUnit.js.map +1 -0
  4. package/lib/commonjs/config/types.js +138 -0
  5. package/lib/commonjs/config/types.js.map +1 -0
  6. package/lib/commonjs/config/validate.js +150 -0
  7. package/lib/commonjs/config/validate.js.map +1 -0
  8. package/lib/commonjs/core/adOriginatedReturn.js +119 -0
  9. package/lib/commonjs/core/adOriginatedReturn.js.map +1 -0
  10. package/lib/commonjs/core/adsInstance.js +129 -0
  11. package/lib/commonjs/core/adsInstance.js.map +1 -0
  12. package/lib/commonjs/core/consentFlow.js +154 -0
  13. package/lib/commonjs/core/consentFlow.js.map +1 -0
  14. package/lib/commonjs/core/enablement.js +64 -0
  15. package/lib/commonjs/core/enablement.js.map +1 -0
  16. package/lib/commonjs/core/fullScreenLock.js +48 -0
  17. package/lib/commonjs/core/fullScreenLock.js.map +1 -0
  18. package/lib/commonjs/core/gates.js +95 -0
  19. package/lib/commonjs/core/gates.js.map +1 -0
  20. package/lib/commonjs/core/initMachine.js +159 -0
  21. package/lib/commonjs/core/initMachine.js.map +1 -0
  22. package/lib/commonjs/core/instance/consent.js +155 -0
  23. package/lib/commonjs/core/instance/consent.js.map +1 -0
  24. package/lib/commonjs/core/instance/context.js +217 -0
  25. package/lib/commonjs/core/instance/context.js.map +1 -0
  26. package/lib/commonjs/core/instance/gate.js +194 -0
  27. package/lib/commonjs/core/instance/gate.js.map +1 -0
  28. package/lib/commonjs/core/instance/init.js +326 -0
  29. package/lib/commonjs/core/instance/init.js.map +1 -0
  30. package/lib/commonjs/core/instance/internals.js +115 -0
  31. package/lib/commonjs/core/instance/internals.js.map +1 -0
  32. package/lib/commonjs/core/instance/load.js +458 -0
  33. package/lib/commonjs/core/instance/load.js.map +1 -0
  34. package/lib/commonjs/core/instance/show.js +243 -0
  35. package/lib/commonjs/core/instance/show.js.map +1 -0
  36. package/lib/commonjs/core/instance/types.js +6 -0
  37. package/lib/commonjs/core/instance/types.js.map +1 -0
  38. package/lib/commonjs/core/placementMachine.js +116 -0
  39. package/lib/commonjs/core/placementMachine.js.map +1 -0
  40. package/lib/commonjs/core/privacyGate.js +93 -0
  41. package/lib/commonjs/core/privacyGate.js.map +1 -0
  42. package/lib/commonjs/core/requestThrottle.js +152 -0
  43. package/lib/commonjs/core/requestThrottle.js.map +1 -0
  44. package/lib/commonjs/core/retryPolicy.js +120 -0
  45. package/lib/commonjs/core/retryPolicy.js.map +1 -0
  46. package/lib/commonjs/core/rewardedSession.js +65 -0
  47. package/lib/commonjs/core/rewardedSession.js.map +1 -0
  48. package/lib/commonjs/core/timers.js +162 -0
  49. package/lib/commonjs/core/timers.js.map +1 -0
  50. package/lib/commonjs/diagnostics/correlation.js +33 -0
  51. package/lib/commonjs/diagnostics/correlation.js.map +1 -0
  52. package/lib/commonjs/diagnostics/errors.js +152 -0
  53. package/lib/commonjs/diagnostics/errors.js.map +1 -0
  54. package/lib/commonjs/diagnostics/events.js +132 -0
  55. package/lib/commonjs/diagnostics/events.js.map +1 -0
  56. package/lib/commonjs/engine/admobBanner.js +58 -0
  57. package/lib/commonjs/engine/admobBanner.js.map +1 -0
  58. package/lib/commonjs/engine/admobEngine.js +343 -0
  59. package/lib/commonjs/engine/admobEngine.js.map +1 -0
  60. package/lib/commonjs/engine/admobErrors.js +45 -0
  61. package/lib/commonjs/engine/admobErrors.js.map +1 -0
  62. package/lib/commonjs/engine/port.js +6 -0
  63. package/lib/commonjs/engine/port.js.map +1 -0
  64. package/lib/commonjs/engine/testAdUnits.js +61 -0
  65. package/lib/commonjs/engine/testAdUnits.js.map +1 -0
  66. package/lib/commonjs/index.js +218 -0
  67. package/lib/commonjs/index.js.map +1 -0
  68. package/lib/commonjs/package.json +1 -0
  69. package/lib/commonjs/react/AdsBanner.js +317 -0
  70. package/lib/commonjs/react/AdsBanner.js.map +1 -0
  71. package/lib/commonjs/react/AdsProvider.js +54 -0
  72. package/lib/commonjs/react/AdsProvider.js.map +1 -0
  73. package/lib/commonjs/react/hooks.js +63 -0
  74. package/lib/commonjs/react/hooks.js.map +1 -0
  75. package/lib/commonjs/testing/clock.js +76 -0
  76. package/lib/commonjs/testing/clock.js.map +1 -0
  77. package/lib/commonjs/testing/conformance.js +99 -0
  78. package/lib/commonjs/testing/conformance.js.map +1 -0
  79. package/lib/commonjs/testing/index.js +389 -0
  80. package/lib/commonjs/testing/index.js.map +1 -0
  81. package/lib/module/config/resolveAdUnit.js +75 -0
  82. package/lib/module/config/resolveAdUnit.js.map +1 -0
  83. package/lib/module/config/types.js +134 -0
  84. package/lib/module/config/types.js.map +1 -0
  85. package/lib/module/config/validate.js +146 -0
  86. package/lib/module/config/validate.js.map +1 -0
  87. package/lib/module/core/adOriginatedReturn.js +115 -0
  88. package/lib/module/core/adOriginatedReturn.js.map +1 -0
  89. package/lib/module/core/adsInstance.js +121 -0
  90. package/lib/module/core/adsInstance.js.map +1 -0
  91. package/lib/module/core/consentFlow.js +143 -0
  92. package/lib/module/core/consentFlow.js.map +1 -0
  93. package/lib/module/core/enablement.js +58 -0
  94. package/lib/module/core/enablement.js.map +1 -0
  95. package/lib/module/core/fullScreenLock.js +44 -0
  96. package/lib/module/core/fullScreenLock.js.map +1 -0
  97. package/lib/module/core/gates.js +91 -0
  98. package/lib/module/core/gates.js.map +1 -0
  99. package/lib/module/core/initMachine.js +152 -0
  100. package/lib/module/core/initMachine.js.map +1 -0
  101. package/lib/module/core/instance/consent.js +151 -0
  102. package/lib/module/core/instance/consent.js.map +1 -0
  103. package/lib/module/core/instance/context.js +212 -0
  104. package/lib/module/core/instance/context.js.map +1 -0
  105. package/lib/module/core/instance/gate.js +183 -0
  106. package/lib/module/core/instance/gate.js.map +1 -0
  107. package/lib/module/core/instance/init.js +321 -0
  108. package/lib/module/core/instance/init.js.map +1 -0
  109. package/lib/module/core/instance/internals.js +109 -0
  110. package/lib/module/core/instance/internals.js.map +1 -0
  111. package/lib/module/core/instance/load.js +452 -0
  112. package/lib/module/core/instance/load.js.map +1 -0
  113. package/lib/module/core/instance/show.js +238 -0
  114. package/lib/module/core/instance/show.js.map +1 -0
  115. package/lib/module/core/instance/types.js +4 -0
  116. package/lib/module/core/instance/types.js.map +1 -0
  117. package/lib/module/core/placementMachine.js +109 -0
  118. package/lib/module/core/placementMachine.js.map +1 -0
  119. package/lib/module/core/privacyGate.js +86 -0
  120. package/lib/module/core/privacyGate.js.map +1 -0
  121. package/lib/module/core/requestThrottle.js +146 -0
  122. package/lib/module/core/requestThrottle.js.map +1 -0
  123. package/lib/module/core/retryPolicy.js +113 -0
  124. package/lib/module/core/retryPolicy.js.map +1 -0
  125. package/lib/module/core/rewardedSession.js +61 -0
  126. package/lib/module/core/rewardedSession.js.map +1 -0
  127. package/lib/module/core/timers.js +150 -0
  128. package/lib/module/core/timers.js.map +1 -0
  129. package/lib/module/diagnostics/correlation.js +29 -0
  130. package/lib/module/diagnostics/correlation.js.map +1 -0
  131. package/lib/module/diagnostics/errors.js +143 -0
  132. package/lib/module/diagnostics/errors.js.map +1 -0
  133. package/lib/module/diagnostics/events.js +128 -0
  134. package/lib/module/diagnostics/events.js.map +1 -0
  135. package/lib/module/engine/admobBanner.js +52 -0
  136. package/lib/module/engine/admobBanner.js.map +1 -0
  137. package/lib/module/engine/admobEngine.js +334 -0
  138. package/lib/module/engine/admobEngine.js.map +1 -0
  139. package/lib/module/engine/admobErrors.js +41 -0
  140. package/lib/module/engine/admobErrors.js.map +1 -0
  141. package/lib/module/engine/port.js +4 -0
  142. package/lib/module/engine/port.js.map +1 -0
  143. package/lib/module/engine/testAdUnits.js +56 -0
  144. package/lib/module/engine/testAdUnits.js.map +1 -0
  145. package/lib/module/index.js +59 -0
  146. package/lib/module/index.js.map +1 -0
  147. package/lib/module/package.json +1 -0
  148. package/lib/module/react/AdsBanner.js +312 -0
  149. package/lib/module/react/AdsBanner.js.map +1 -0
  150. package/lib/module/react/AdsProvider.js +48 -0
  151. package/lib/module/react/AdsProvider.js.map +1 -0
  152. package/lib/module/react/hooks.js +58 -0
  153. package/lib/module/react/hooks.js.map +1 -0
  154. package/lib/module/testing/clock.js +72 -0
  155. package/lib/module/testing/clock.js.map +1 -0
  156. package/lib/module/testing/conformance.js +93 -0
  157. package/lib/module/testing/conformance.js.map +1 -0
  158. package/lib/module/testing/index.js +366 -0
  159. package/lib/module/testing/index.js.map +1 -0
  160. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts +43 -0
  161. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/config/types.d.ts +280 -0
  163. package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/config/validate.d.ts +49 -0
  165. package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts +61 -0
  167. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/core/adsInstance.d.ts +33 -0
  169. package/lib/typescript/commonjs/core/adsInstance.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/core/consentFlow.d.ts +84 -0
  171. package/lib/typescript/commonjs/core/consentFlow.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/core/enablement.d.ts +74 -0
  173. package/lib/typescript/commonjs/core/enablement.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/core/fullScreenLock.d.ts +25 -0
  175. package/lib/typescript/commonjs/core/fullScreenLock.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/core/gates.d.ts +76 -0
  177. package/lib/typescript/commonjs/core/gates.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/core/initMachine.d.ts +66 -0
  179. package/lib/typescript/commonjs/core/initMachine.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/core/instance/consent.d.ts +4 -0
  181. package/lib/typescript/commonjs/core/instance/consent.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/core/instance/context.d.ts +118 -0
  183. package/lib/typescript/commonjs/core/instance/context.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/core/instance/gate.d.ts +38 -0
  185. package/lib/typescript/commonjs/core/instance/gate.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/core/instance/init.d.ts +13 -0
  187. package/lib/typescript/commonjs/core/instance/init.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/core/instance/internals.d.ts +60 -0
  189. package/lib/typescript/commonjs/core/instance/internals.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/core/instance/load.d.ts +9 -0
  191. package/lib/typescript/commonjs/core/instance/load.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/core/instance/show.d.ts +7 -0
  193. package/lib/typescript/commonjs/core/instance/show.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/core/instance/types.d.ts +240 -0
  195. package/lib/typescript/commonjs/core/instance/types.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/core/placementMachine.d.ts +55 -0
  197. package/lib/typescript/commonjs/core/placementMachine.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/core/privacyGate.d.ts +40 -0
  199. package/lib/typescript/commonjs/core/privacyGate.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/core/requestThrottle.d.ts +99 -0
  201. package/lib/typescript/commonjs/core/requestThrottle.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/core/retryPolicy.d.ts +66 -0
  203. package/lib/typescript/commonjs/core/retryPolicy.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/core/rewardedSession.d.ts +37 -0
  205. package/lib/typescript/commonjs/core/rewardedSession.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/core/timers.d.ts +135 -0
  207. package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
  208. package/lib/typescript/commonjs/diagnostics/correlation.d.ts +18 -0
  209. package/lib/typescript/commonjs/diagnostics/correlation.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/diagnostics/errors.d.ts +59 -0
  211. package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/diagnostics/events.d.ts +126 -0
  213. package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/engine/admobBanner.d.ts +10 -0
  215. package/lib/typescript/commonjs/engine/admobBanner.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/engine/admobEngine.d.ts +71 -0
  217. package/lib/typescript/commonjs/engine/admobEngine.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/engine/admobErrors.d.ts +9 -0
  219. package/lib/typescript/commonjs/engine/admobErrors.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/engine/port.d.ts +171 -0
  221. package/lib/typescript/commonjs/engine/port.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/engine/testAdUnits.d.ts +33 -0
  223. package/lib/typescript/commonjs/engine/testAdUnits.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/index.d.ts +42 -0
  225. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/package.json +1 -0
  227. package/lib/typescript/commonjs/react/AdsBanner.d.ts +29 -0
  228. package/lib/typescript/commonjs/react/AdsBanner.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/react/AdsProvider.d.ts +36 -0
  230. package/lib/typescript/commonjs/react/AdsProvider.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/react/hooks.d.ts +27 -0
  232. package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/testing/clock.d.ts +29 -0
  234. package/lib/typescript/commonjs/testing/clock.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/testing/conformance.d.ts +26 -0
  236. package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/testing/index.d.ts +133 -0
  238. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  239. package/lib/typescript/module/config/resolveAdUnit.d.ts +43 -0
  240. package/lib/typescript/module/config/resolveAdUnit.d.ts.map +1 -0
  241. package/lib/typescript/module/config/types.d.ts +280 -0
  242. package/lib/typescript/module/config/types.d.ts.map +1 -0
  243. package/lib/typescript/module/config/validate.d.ts +49 -0
  244. package/lib/typescript/module/config/validate.d.ts.map +1 -0
  245. package/lib/typescript/module/core/adOriginatedReturn.d.ts +61 -0
  246. package/lib/typescript/module/core/adOriginatedReturn.d.ts.map +1 -0
  247. package/lib/typescript/module/core/adsInstance.d.ts +33 -0
  248. package/lib/typescript/module/core/adsInstance.d.ts.map +1 -0
  249. package/lib/typescript/module/core/consentFlow.d.ts +84 -0
  250. package/lib/typescript/module/core/consentFlow.d.ts.map +1 -0
  251. package/lib/typescript/module/core/enablement.d.ts +74 -0
  252. package/lib/typescript/module/core/enablement.d.ts.map +1 -0
  253. package/lib/typescript/module/core/fullScreenLock.d.ts +25 -0
  254. package/lib/typescript/module/core/fullScreenLock.d.ts.map +1 -0
  255. package/lib/typescript/module/core/gates.d.ts +76 -0
  256. package/lib/typescript/module/core/gates.d.ts.map +1 -0
  257. package/lib/typescript/module/core/initMachine.d.ts +66 -0
  258. package/lib/typescript/module/core/initMachine.d.ts.map +1 -0
  259. package/lib/typescript/module/core/instance/consent.d.ts +4 -0
  260. package/lib/typescript/module/core/instance/consent.d.ts.map +1 -0
  261. package/lib/typescript/module/core/instance/context.d.ts +118 -0
  262. package/lib/typescript/module/core/instance/context.d.ts.map +1 -0
  263. package/lib/typescript/module/core/instance/gate.d.ts +38 -0
  264. package/lib/typescript/module/core/instance/gate.d.ts.map +1 -0
  265. package/lib/typescript/module/core/instance/init.d.ts +13 -0
  266. package/lib/typescript/module/core/instance/init.d.ts.map +1 -0
  267. package/lib/typescript/module/core/instance/internals.d.ts +60 -0
  268. package/lib/typescript/module/core/instance/internals.d.ts.map +1 -0
  269. package/lib/typescript/module/core/instance/load.d.ts +9 -0
  270. package/lib/typescript/module/core/instance/load.d.ts.map +1 -0
  271. package/lib/typescript/module/core/instance/show.d.ts +7 -0
  272. package/lib/typescript/module/core/instance/show.d.ts.map +1 -0
  273. package/lib/typescript/module/core/instance/types.d.ts +240 -0
  274. package/lib/typescript/module/core/instance/types.d.ts.map +1 -0
  275. package/lib/typescript/module/core/placementMachine.d.ts +55 -0
  276. package/lib/typescript/module/core/placementMachine.d.ts.map +1 -0
  277. package/lib/typescript/module/core/privacyGate.d.ts +40 -0
  278. package/lib/typescript/module/core/privacyGate.d.ts.map +1 -0
  279. package/lib/typescript/module/core/requestThrottle.d.ts +99 -0
  280. package/lib/typescript/module/core/requestThrottle.d.ts.map +1 -0
  281. package/lib/typescript/module/core/retryPolicy.d.ts +66 -0
  282. package/lib/typescript/module/core/retryPolicy.d.ts.map +1 -0
  283. package/lib/typescript/module/core/rewardedSession.d.ts +37 -0
  284. package/lib/typescript/module/core/rewardedSession.d.ts.map +1 -0
  285. package/lib/typescript/module/core/timers.d.ts +135 -0
  286. package/lib/typescript/module/core/timers.d.ts.map +1 -0
  287. package/lib/typescript/module/diagnostics/correlation.d.ts +18 -0
  288. package/lib/typescript/module/diagnostics/correlation.d.ts.map +1 -0
  289. package/lib/typescript/module/diagnostics/errors.d.ts +59 -0
  290. package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
  291. package/lib/typescript/module/diagnostics/events.d.ts +126 -0
  292. package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
  293. package/lib/typescript/module/engine/admobBanner.d.ts +10 -0
  294. package/lib/typescript/module/engine/admobBanner.d.ts.map +1 -0
  295. package/lib/typescript/module/engine/admobEngine.d.ts +71 -0
  296. package/lib/typescript/module/engine/admobEngine.d.ts.map +1 -0
  297. package/lib/typescript/module/engine/admobErrors.d.ts +9 -0
  298. package/lib/typescript/module/engine/admobErrors.d.ts.map +1 -0
  299. package/lib/typescript/module/engine/port.d.ts +171 -0
  300. package/lib/typescript/module/engine/port.d.ts.map +1 -0
  301. package/lib/typescript/module/engine/testAdUnits.d.ts +33 -0
  302. package/lib/typescript/module/engine/testAdUnits.d.ts.map +1 -0
  303. package/lib/typescript/module/index.d.ts +42 -0
  304. package/lib/typescript/module/index.d.ts.map +1 -0
  305. package/lib/typescript/module/package.json +1 -0
  306. package/lib/typescript/module/react/AdsBanner.d.ts +29 -0
  307. package/lib/typescript/module/react/AdsBanner.d.ts.map +1 -0
  308. package/lib/typescript/module/react/AdsProvider.d.ts +36 -0
  309. package/lib/typescript/module/react/AdsProvider.d.ts.map +1 -0
  310. package/lib/typescript/module/react/hooks.d.ts +27 -0
  311. package/lib/typescript/module/react/hooks.d.ts.map +1 -0
  312. package/lib/typescript/module/testing/clock.d.ts +29 -0
  313. package/lib/typescript/module/testing/clock.d.ts.map +1 -0
  314. package/lib/typescript/module/testing/conformance.d.ts +26 -0
  315. package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
  316. package/lib/typescript/module/testing/index.d.ts +133 -0
  317. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  318. package/package.json +48 -12
  319. package/src/testing/index.ts +17 -3
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Timeout and staleness policy (FR-032, FR-034).
3
+ *
4
+ * Defaults and bounds live here rather than at each call site so there is one
5
+ * place to read what the package will wait for. Values outside a band are a
6
+ * configuration error rather than being silently clamped: silently clamping a
7
+ * one-second load timeout to five would mean the app is told it configured
8
+ * something it did not (FR-008).
9
+ */
10
+ import { type Range } from '@chipmobilesdk/rn-core';
11
+ import { type AdsErrorCode } from '../diagnostics/errors.js';
12
+ import type { TimeoutConfig } from '../config/types.js';
13
+ /** Comfortably longer than a normal fill on a slow mobile network, still bounded. */
14
+ export declare const DEFAULT_LOAD_TIMEOUT_MS = 30000;
15
+ /** Generous for what is essentially a local presentation. */
16
+ export declare const DEFAULT_SHOW_TIMEOUT_MS = 10000;
17
+ /**
18
+ * Google documents that a loaded ad object expires about an hour after load.
19
+ * Sixty minutes is the provider's own number; choosing anything else would be
20
+ * inventing a constraint (R7).
21
+ */
22
+ export declare const DEFAULT_AD_VALIDITY_MS = 3600000;
23
+ /**
24
+ * App-open's own window, deliberately shorter than the hour the other
25
+ * full-screen formats get (FR-130).
26
+ *
27
+ * Worth being explicit about why: Google expires app-open ads after **four
28
+ * hours**, which is *longer* than DEFAULT_AD_VALIDITY_MS, so the provider does
29
+ * not constrain this at all. The shorter window is a product decision. An
30
+ * app-open ad shows at the most prominent moment the app has, and a creative
31
+ * cached for an hour is stale by then; thirty minutes still spares a returning
32
+ * user the spinner of a cold load, which is both the worst app-open experience
33
+ * and the specific behavior store policy penalizes.
34
+ */
35
+ export declare const DEFAULT_APP_OPEN_VALIDITY_MS = 1800000;
36
+ /**
37
+ * How long `enabled: 'undecided'` may go unresolved before one warning fires.
38
+ *
39
+ * Ten seconds is several times a realistic worst case for the round trip this
40
+ * state exists to cover — asking a store whether the user owns an ad-removal
41
+ * entitlement — so an app doing the right thing essentially never trips it,
42
+ * while an app that forgot to resolve trips it inside a single QA session,
43
+ * which is where it needs to be caught (FR-119).
44
+ */
45
+ export declare const DEFAULT_UNDECIDED_WARNING_MS = 10000;
46
+ export declare const LOAD_TIMEOUT_BOUNDS: {
47
+ readonly min: 5000;
48
+ readonly max: 120000;
49
+ };
50
+ export declare const SHOW_TIMEOUT_BOUNDS: {
51
+ readonly min: 5000;
52
+ readonly max: 30000;
53
+ };
54
+ export declare const AD_VALIDITY_BOUNDS: {
55
+ readonly min: 60000;
56
+ readonly max: 3600000;
57
+ };
58
+ /** Ceiling is one hour so app-open can never outlive the general window. */
59
+ export declare const APP_OPEN_VALIDITY_BOUNDS: {
60
+ readonly min: 60000;
61
+ readonly max: 3600000;
62
+ };
63
+ export declare const UNDECIDED_WARNING_BOUNDS: {
64
+ readonly min: 1000;
65
+ readonly max: 120000;
66
+ };
67
+ /**
68
+ * Retry defaults (FR-136).
69
+ *
70
+ * Two retries rather than more: each one is a billable request, and two covers
71
+ * the transient network failure and the momentary no-fill — the cases where
72
+ * trying again plausibly helps. A third mostly pays for a failure that was not
73
+ * transient. 2s then 4s keeps both inside a window the user still associates
74
+ * with the action that triggered the load.
75
+ */
76
+ export declare const DEFAULT_RETRY_POLICY: {
77
+ readonly maxRetries: 2;
78
+ readonly initialDelayMs: 2000;
79
+ readonly maxDelayMs: 30000;
80
+ };
81
+ export declare const RETRY_BOUNDS: {
82
+ readonly maxRetries: {
83
+ readonly min: 1;
84
+ readonly max: 5;
85
+ };
86
+ readonly initialDelayMs: {
87
+ readonly min: 500;
88
+ readonly max: 30000;
89
+ };
90
+ readonly maxDelayMs: {
91
+ readonly min: 1000;
92
+ readonly max: 60000;
93
+ };
94
+ };
95
+ /**
96
+ * Ad-originated return detection (FR-128).
97
+ *
98
+ * A background transition within CLICK_WINDOW of a click is attributed to a
99
+ * browser the ad opened. An absence longer than MAX_AWAY is no longer
100
+ * attributable to the ad — the user did something else in between. GRACE covers
101
+ * the moment right after the return, where an app-open show would otherwise
102
+ * fire, without outliving it and refusing a genuinely later show.
103
+ */
104
+ export declare const AD_CLICK_WINDOW_MS = 2000;
105
+ export declare const AD_RETURN_MAX_AWAY_MS = 300000;
106
+ export declare const AD_RETURN_GRACE_MS = 10000;
107
+ export interface ResolvedTimeouts {
108
+ readonly load: number;
109
+ readonly show: number;
110
+ readonly adValidity: number;
111
+ readonly appOpenValidity: number;
112
+ readonly undecidedWarning: number;
113
+ }
114
+ /**
115
+ * `value` when it is inside `bounds`, else an `AdsConfigError` with `code`: each
116
+ * field reports the code its documentation names, so a retry policy out of bounds
117
+ * is `retry_out_of_bounds`, not a timeout's code (CORE-04, ADS-16).
118
+ */
119
+ export declare function checkBand(label: string, value: number, bounds: Range, code?: AdsErrorCode, unit?: string): number;
120
+ export interface TimeoutInput {
121
+ readonly timeouts?: TimeoutConfig;
122
+ readonly adValidityMs?: number;
123
+ readonly appOpenValidityMs?: number;
124
+ readonly undecidedWarningMs?: number;
125
+ }
126
+ export declare function resolveTimeouts(input: TimeoutInput): ResolvedTimeouts;
127
+ /**
128
+ * How timers are scheduled, and the set that tracks them so `dispose()` can prove
129
+ * it released every one (SC-008): rn-core's, injectable so a test drives retry
130
+ * backoff, app-open expiry and the undecided warning by moving a clock.
131
+ */
132
+ export { createTimerSet, type Scheduler, type TimerSet } from '@chipmobilesdk/rn-core';
133
+ /** A loaded ad past its validity window must never be reported ready (FR-034). */
134
+ export declare function isStale(loadedAtMs: number, nowMs: number, adValidityMs: number): boolean;
135
+ //# sourceMappingURL=timers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timers.d.ts","sourceRoot":"","sources":["../../../../src/core/timers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,0BAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAiB,CAAC;AAErD,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAC9C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,UAAY,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,UAAY,CAAC;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,eAAO,MAAM,mBAAmB;;;CAAwC,CAAC;AACzE,eAAO,MAAM,mBAAmB;;;CAAuC,CAAC;AACxE,eAAO,MAAM,kBAAkB;;;CAA2C,CAAC;AAC3E,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB;;;CAA2C,CAAC;AACjF,eAAO,MAAM,wBAAwB;;;CAAwC,CAAC;AAE9E;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAIf,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AACxC,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAC7C,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,KAAK,EACb,IAAI,GAAE,YAAsC,EAC5C,IAAI,SAAO,GACT,MAAM,CAER;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,gBAAgB,CA6BrE;AAED;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvF,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAExF"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Correlation identifiers (FR-052).
3
+ *
4
+ * One value is minted when a load begins and carried by every event of that
5
+ * load/show cycle through its terminal event. It is what lets a consumer
6
+ * reconstruct a single ad's life from an event stream alone (SC-009) without the
7
+ * package having to store any history of its own.
8
+ *
9
+ * Opaque and monotonic per instance. Not a UUID, and deliberately not derived
10
+ * from anything about the device or the user — it exists to group events, and
11
+ * anything with more meaning than that would be a payload the package has
12
+ * promised not to carry (FR-021).
13
+ */
14
+ export interface CorrelationIssuer {
15
+ next(): string;
16
+ }
17
+ export declare function createCorrelationIssuer(prefix?: string): CorrelationIssuer;
18
+ //# sourceMappingURL=correlation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correlation.d.ts","sourceRoot":"","sources":["../../../../src/diagnostics/correlation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,iBAAiB;IACjC,IAAI,IAAI,MAAM,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,MAAM,SAAO,GAAG,iBAAiB,CAYxE"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Normalized error model (FR-053) and redaction (NFR-006).
3
+ *
4
+ * Codes are stable public API: renaming one is a breaking change under LIB-008.
5
+ * They exist so a consuming app branches on `code` and `retryable` rather than
6
+ * string-matching a provider message that may change under it.
7
+ *
8
+ * `cause` is a redacted string, never the provider's error object. A provider
9
+ * object reaching a consumer would be a contract leak (FR-002) and a potential
10
+ * carrier for identifiers the package promises never to emit (FR-021).
11
+ */
12
+ import { SdkError } from '@chipmobilesdk/rn-core';
13
+ import type { AdFormat } from '../config/types.js';
14
+ export type AdsOperation = 'initialize' | 'load' | 'show' | 'configure';
15
+ export type AdsErrorCode = 'invalid_config' | 'duplicate_placement_key' | 'missing_ad_unit_id' | 'format_mismatch' | 'placement_not_found' | 'production_in_dev_build' | 'timeout_out_of_bounds' | 'unsupported_platform' | 'provider_missing' | 'disabled' | 'undecided' | 'consent_required' | 'consent_undetermined' | 'requires_reinitialization' | 'consent_flow_required' | 'consent_flow_failed' | 'no_fill' | 'network_error' | 'load_timeout' | 'show_timeout' | 'ad_expired' | 'not_ready' | 'busy' | 'consumed' | 'app_inactive' | 'ad_originated_return' | 'provider_error' | 'provider_rejected' | 'internal_error' | 'retry_out_of_bounds';
16
+ export interface AdsErrorOptions {
17
+ readonly message?: string;
18
+ readonly operation?: AdsOperation;
19
+ readonly placementKey?: string;
20
+ readonly format?: AdFormat;
21
+ readonly cause?: unknown;
22
+ }
23
+ /** The package's error; an `SdkError` (`@chipmobilesdk/rn-core`) with `pkg: 'rn-ads'`. */
24
+ export declare class AdsError extends SdkError<AdsErrorCode> {
25
+ readonly operation?: AdsOperation;
26
+ readonly placementKey?: string;
27
+ readonly format?: AdFormat;
28
+ /** Redacted provider detail. Never a provider object. */
29
+ readonly cause?: string;
30
+ constructor(code: AdsErrorCode, options?: AdsErrorOptions);
31
+ }
32
+ /**
33
+ * Configuration faults are thrown rather than returned, because they mean the
34
+ * app is wired wrong and no runtime result could describe a usable outcome.
35
+ * Every other failure in the package is a typed result (FR-004).
36
+ */
37
+ export declare class AdsConfigError extends AdsError {
38
+ constructor(code: AdsErrorCode, options?: AdsErrorOptions);
39
+ }
40
+ export declare function isAdsError(value: unknown): value is AdsError;
41
+ /**
42
+ * Reduces an arbitrary provider value to a safe string (FR-053, NFR-006).
43
+ *
44
+ * Returns a string rather than a structure on purpose: a redacted object still
45
+ * hands the consumer a reference into provider-owned memory, and the contract
46
+ * promises no provider object crosses the boundary. An `AdsError` reduces to its
47
+ * code.
48
+ */
49
+ export declare function redact(value: unknown): string;
50
+ /**
51
+ * Maps a provider failure onto the normalized taxonomy.
52
+ *
53
+ * The adapter's classification wins when it gave one (ADS-08). Otherwise the
54
+ * match is on substrings that have been stable across provider releases, and
55
+ * anything unrecognized becomes a retryable `provider_error` rather than being
56
+ * reshaped into a code that means something specific.
57
+ */
58
+ export declare function normalizeProviderError(value: unknown, options?: AdsErrorOptions, kind?: 'no_fill' | 'network' | 'rejected'): AdsError;
59
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["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EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB;CAa7D;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,QAAQ;gBAC/B,IAAI,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB;CAI7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAmCD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,eAAoB,EAC7B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GACvC,QAAQ,CAoBV"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Normalized event model and emitter (FR-051, FR-052, FR-054, FR-056).
3
+ *
4
+ * Events are the package's only observability surface. They carry no provider
5
+ * object, no advertising identifier, no consent payload, and nothing that
6
+ * identifies a user — a consuming app forwards them to whatever logging or
7
+ * analytics it already has, and the package depends on none (FR-055).
8
+ *
9
+ * Dispatch iterates a snapshot of the listener set so subscribing or
10
+ * unsubscribing during a dispatch neither skips a listener nor double-invokes
11
+ * one. A listener that throws is caught and reported once; it cannot corrupt a
12
+ * state machine or starve another listener (FR-056).
13
+ */
14
+ import type { AdFormat, PrivacyBlockReason, Reward, UnavailableReason, Unsubscribe } from '../config/types.js';
15
+ import { AdsError, type AdsOperation } from './errors.js';
16
+ export type AdEventType = 'initialization' | 'load_started' | 'loaded' | 'load_failed' | 'display_started' | 'impression' | 'click' | 'display_failed' | 'dismissed' | 'reward_earned' | 'disabled' | 'unavailable' | 'config_warning' | 'retry_scheduled' | 'request_throttled' | 'internal_error';
17
+ interface BaseEvent {
18
+ readonly timestamp: number;
19
+ readonly placementKey?: string;
20
+ readonly format?: AdFormat;
21
+ readonly correlationId?: string;
22
+ }
23
+ /**
24
+ * `source` records whether the provider reported a true impression or the
25
+ * package derived one. Banners get a real impression callback; full-screen
26
+ * formats have none in the provider's event enum, so theirs is derived from the
27
+ * ad opening. Flattening that away would make the model quietly wrong for anyone
28
+ * reconciling these events against revenue reporting.
29
+ */
30
+ export type ImpressionSource = 'provider' | 'derived';
31
+ export type AdEvent = BaseEvent & ({
32
+ readonly type: 'initialization';
33
+ readonly status: string;
34
+ readonly retryable?: boolean;
35
+ } | {
36
+ readonly type: 'load_started';
37
+ } | {
38
+ readonly type: 'loaded';
39
+ readonly durationMs: number;
40
+ } | {
41
+ readonly type: 'load_failed';
42
+ readonly error: AdsError;
43
+ } | {
44
+ readonly type: 'display_started';
45
+ } | {
46
+ readonly type: 'impression';
47
+ readonly source: ImpressionSource;
48
+ } | {
49
+ readonly type: 'click';
50
+ } | {
51
+ readonly type: 'display_failed';
52
+ readonly error: AdsError;
53
+ } | {
54
+ readonly type: 'dismissed';
55
+ readonly rewardEarned?: boolean;
56
+ } | {
57
+ readonly type: 'reward_earned';
58
+ readonly reward: Reward;
59
+ } | {
60
+ readonly type: 'disabled';
61
+ readonly operation: AdsOperation;
62
+ } | {
63
+ readonly type: 'unavailable';
64
+ readonly operation: AdsOperation;
65
+ readonly reason: UnavailableReason | PrivacyBlockReason;
66
+ } | {
67
+ readonly type: 'retry_scheduled';
68
+ /** 1-based: the first retry is attempt 1, not 0. */
69
+ readonly attempt: number;
70
+ readonly delayMs: number;
71
+ readonly error: AdsError;
72
+ } | {
73
+ readonly type: 'request_throttled';
74
+ /** How long until this placement may request again. */
75
+ readonly retryAfterMs: number;
76
+ /** The configured floor that refused it, so the cause is readable. */
77
+ readonly minRequestIntervalMs: number;
78
+ } | {
79
+ readonly type: 'config_warning';
80
+ readonly warning: ConfigWarning;
81
+ /**
82
+ * Placements the warning concerns. Empty for warnings that are not
83
+ * placement-scoped.
84
+ *
85
+ * Present on every config warning rather than only on the one that
86
+ * uses it, so that 0.1.0 code which reads `placementKeys` after
87
+ * checking `type === 'config_warning'` keeps compiling. Splitting
88
+ * this into one variant per warning would have been tidier and
89
+ * would have broken every such consumer for no behavioral gain.
90
+ */
91
+ readonly placementKeys: readonly string[];
92
+ /** Consent tools ignored, for `consent_tool_ignored_in_production`. */
93
+ readonly tools?: readonly string[];
94
+ /** How long the app left the state unresolved, for the undecided warning. */
95
+ readonly elapsedMs?: number;
96
+ } | {
97
+ readonly type: 'internal_error';
98
+ readonly error: AdsError;
99
+ });
100
+ /**
101
+ * Configuration problems worth telling the app about, all under one event type.
102
+ *
103
+ * One type rather than three because FR-132 forbids a parallel vocabulary, and
104
+ * because a consumer already routing `config_warning` into its logging should
105
+ * not have to subscribe again to keep seeing everything.
106
+ */
107
+ export type ConfigWarning =
108
+ /** A production ad unit was replaced with an official test unit (FR-011a). */
109
+ 'test_ad_unit_substituted'
110
+ /** The app left `enabled: 'undecided'` unresolved past its window (FR-119). */
111
+ | 'enablement_undecided_timeout'
112
+ /** Consent testing tools were supplied in production and ignored (FR-113). */
113
+ | 'consent_tool_ignored_in_production';
114
+ export type AdEventListener = (event: AdEvent) => void;
115
+ export interface AdEventEmitter {
116
+ emit(event: AdEvent): void;
117
+ subscribe(listener: AdEventListener): Unsubscribe;
118
+ /** Releases every listener and the once-per-cycle bookkeeping (FR-035). */
119
+ dispose(): void;
120
+ listenerCount(): number;
121
+ }
122
+ export declare function createEventEmitter(): AdEventEmitter;
123
+ /** Normalizes a provider reward descriptor. No provider object crosses this (FR-047). */
124
+ export declare function normalizeReward(value: unknown): Reward;
125
+ export {};
126
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/diagnostics/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,MAAM,oBAAiB,CAAC;AAQzB,OAAO,EAAE,QAAQ,E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CAAC,EAAE,MAAM,CAAC;CAC3B,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAC/D,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,aAAa;AACxB,8EAA8E;AAC5E,0BAA0B;AAC5B,+EAA+E;GAC7E,8BAA8B;AAChC,8EAA8E;GAC5E,oCAAoC,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAWvD,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CAAC;IAClD,2EAA2E;IAC3E,OAAO,IAAI,IAAI,CAAC;IAChB,aAAa,IAAI,MAAM,CAAC;CACxB;AAkCD,wBAAgB,kBAAkB,IAAI,cAAc,CA8CnD;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOtD"}
@@ -0,0 +1,10 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { EngineBanner } from './port.js';
3
+ /** The slice of the bridge the banner uses. */
4
+ interface ProviderBannerModule {
5
+ readonly BannerAd?: ComponentType<Record<string, unknown>>;
6
+ readonly BannerAdSize?: Record<string, string>;
7
+ }
8
+ export declare function createAdMobBanner(getProvider: () => ProviderBannerModule | null): EngineBanner;
9
+ export {};
10
+ //# sourceMappingURL=admobBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admobBanner.d.ts","sourceRoot":"","sources":["../../../../src/engine/admobBanner.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,WAAQ,CAAC;AAE9D,+CAA+C;AAC/C,UAAU,oBAAoB;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/C;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,oBAAoB,GAAG,IAAI,GAAG,YAAY,CAiC9F"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Default AdsEngine adapter for Google AdMob on Android.
3
+ *
4
+ * **This is the only module in the package that knows an ad provider exists.**
5
+ * It lazily requires `react-native-google-mobile-ads`, mirroring
6
+ * `packages/rn-camera/src/native/cameraEngine.ts`, so unit tests that inject the
7
+ * fake never load native code and an unsupported platform never loads it at all.
8
+ *
9
+ * Targets bridge 16.0.3, whose ads SDK (24.9.0) predates the Kotlin 2.3 metadata
10
+ * bump that makes newer releases uncompilable under React Native 0.85's pinned
11
+ * Kotlin compiler — see specs/011-rn-advertising-sdk/research.md (R2).
12
+ *
13
+ * Ordering note: `setRequestConfiguration` must run *before* `initialize`, or
14
+ * the child-directed and under-age flags do not take effect. That is why FR-020
15
+ * treats a later change as requiring re-initialization rather than pretending it
16
+ * applied.
17
+ */
18
+ import type { ComponentType } from 'react';
19
+ import type { AdsEngine } from './port.js';
20
+ /** The slice of the bridge this adapter uses. Kept local so nothing else sees it. */
21
+ interface ProviderFullScreenAd {
22
+ load(): void;
23
+ show(): Promise<unknown>;
24
+ addAdEventListener(type: string, listener: (payload?: unknown) => void): () => void;
25
+ }
26
+ interface ProviderModule {
27
+ MobileAds: () => {
28
+ initialize(): Promise<unknown>;
29
+ setRequestConfiguration(config: Record<string, unknown>): Promise<unknown>;
30
+ };
31
+ InterstitialAd: {
32
+ createForAdRequest(adUnitId: string, options?: Record<string, unknown>): ProviderFullScreenAd;
33
+ };
34
+ RewardedAd: {
35
+ createForAdRequest(adUnitId: string, options?: Record<string, unknown>): ProviderFullScreenAd;
36
+ };
37
+ AppOpenAd: {
38
+ createForAdRequest(adUnitId: string, options?: Record<string, unknown>): ProviderFullScreenAd;
39
+ };
40
+ AdEventType: Record<string, string>;
41
+ RewardedAdEventType: Record<string, string>;
42
+ MaxAdContentRating: Record<string, string>;
43
+ AdsConsent: ProviderConsent;
44
+ AdsConsentDebugGeography: Record<string, number>;
45
+ BannerAd?: ComponentType<Record<string, unknown>>;
46
+ BannerAdSize?: Record<string, string>;
47
+ }
48
+ /** The slice of the bridge's consent module this adapter uses. */
49
+ interface ProviderConsent {
50
+ requestInfoUpdate(options?: Record<string, unknown>): Promise<ProviderConsentInfo>;
51
+ loadAndShowConsentFormIfRequired(): Promise<ProviderConsentInfo>;
52
+ showPrivacyOptionsForm(): Promise<ProviderConsentInfo>;
53
+ getConsentInfo(): Promise<ProviderConsentInfo>;
54
+ reset(): void;
55
+ }
56
+ interface ProviderConsentInfo {
57
+ status?: string;
58
+ canRequestAds?: boolean;
59
+ isConsentFormAvailable?: boolean;
60
+ privacyOptionsRequirementStatus?: string;
61
+ }
62
+ /**
63
+ * The provider bridge, loaded on first use (rn-core's lazy peer). It is a required
64
+ * peer, but a consumer can still have it missing mid-install or excluded from a
65
+ * build: reporting `provider_missing` beats crashing the host app's launch
66
+ * (FR-025, NFR-005). The banner component reaches it through the same loader.
67
+ */
68
+ export declare const admobProvider: import("@chipmobilesdk/rn-core").LazyPeer<ProviderModule>;
69
+ export declare function createAdMobEngine(): AdsEngine;
70
+ export { classifyProviderFailure } from './admobErrors.js';
71
+ //# sourceMappingURL=admobEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admobEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/admobEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EACX,SAAS,EAQT,MAAM,WAAQ,CAAC;AAEhB,qFA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AAO,CAAC,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,kEAAkE;AAClE,UAAU,eAAe;IACxB,iBAAiB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnF,gCAAgC,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjE,sBAAsB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvD,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/C,KAAK,IAAI,IAAI,CAAC;CACd;AAED,UAAU,mBAAmB;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,+BAA+B,CAAC,EAAE,MAAM,CAAC;CACzC;AAqED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,2DAOxB,CAAC;AAiCH,wBAAgB,iBAAiB,IAAI,SAAS,CA4J7C;AAiED,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAe,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AdMob's error vocabulary, translated into the port's neutral failure kinds
3
+ * (ADS-08). Shared by the full-screen engine and the banner component, which
4
+ * are the only two places that see a provider error.
5
+ */
6
+ import type { EngineFailureKind } from './port.js';
7
+ /** Classifies a provider failure in neutral terms; undefined when it cannot tell. */
8
+ export declare function classifyProviderFailure(cause: unknown): EngineFailureKind | undefined;
9
+ //# sourceMappingURL=admobErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admobErrors.d.ts","sourceRoot":"","sources":["../../../../src/engine/admobErrors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAQ,CAAC;AAyBhD,qFAAqF;AACrF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAYrF"}
@@ -0,0 +1,171 @@
1
+ /**
2
+ * The internal engine port (NFR-008, FR-006).
3
+ *
4
+ * This interface names no platform and no ad provider. That is what makes an
5
+ * iOS adapter an additive change: it implements this, and nothing in the public
6
+ * contract moves. `core/` talks only to this shape; the AdMob bridge exists
7
+ * behind exactly one implementation of it, in `admobEngine.ts`.
8
+ *
9
+ * Banners are absent on purpose. The provider owns a banner's whole lifecycle
10
+ * through a React component, so `react/AdsBanner` adapts those callbacks
11
+ * directly rather than routing them through a handle model that would have to
12
+ * pretend a banner is a load-then-show resource.
13
+ */
14
+ import type { ComponentType } from 'react';
15
+ import type { AdContentRating, FullScreenFormat, Reward, Unsubscribe } from '../config/types.js';
16
+ /** Privacy state as the engine needs it — no consumer-facing shape leaks in. */
17
+ export interface EnginePrivacy {
18
+ readonly childDirected?: boolean;
19
+ readonly underAgeOfConsent?: boolean;
20
+ readonly maxAdContentRating?: AdContentRating;
21
+ readonly personalizedAds?: boolean;
22
+ readonly testDeviceIds?: readonly string[];
23
+ }
24
+ /**
25
+ * Privacy that applies to each ad request rather than to initialization.
26
+ *
27
+ * `personalizedAds` is here, not only in `EnginePrivacy`, because the provider
28
+ * reads it per request and `updatePrivacy` may change it without
29
+ * reinitializing: a request must carry the value current at request time.
30
+ */
31
+ export interface EngineRequestOptions {
32
+ readonly personalizedAds: boolean;
33
+ }
34
+ /**
35
+ * Provider callbacks, normalized to the vocabulary the core state machines use.
36
+ * `rewarded` and `dismissed` are separate members because they are separate
37
+ * facts that can arrive in either order (FR-049).
38
+ */
39
+ /**
40
+ * What kind of failure the provider reported, in words that name no provider
41
+ * (ADS-08). Only the adapter knows its provider's error vocabulary, so it
42
+ * classifies; core decides what each kind means for retrying.
43
+ *
44
+ * - `no_fill`: the network had nothing to give.
45
+ * - `network`: the request did not get through.
46
+ * - `rejected`: the provider refused the request itself — an invalid ad unit, a
47
+ * missing app id. The same request will fail the same way.
48
+ */
49
+ export type EngineFailureKind = 'no_fill' | 'network' | 'rejected';
50
+ /** What an engine's banner component receives. Names no provider (ADS-12). */
51
+ export interface EngineBannerProps {
52
+ readonly adUnitId: string;
53
+ /** False asks the provider for non-personalized ads only (FR-017). */
54
+ readonly personalizedAds: boolean;
55
+ readonly onLoaded: () => void;
56
+ readonly onFailed: (cause: unknown, kind?: EngineFailureKind) => void;
57
+ /** A real provider impression, as opposed to the derived full-screen one (R5). */
58
+ readonly onImpression: () => void;
59
+ readonly onClicked: () => void;
60
+ }
61
+ /** An engine's banner: one adaptive banner filling its container's width (FR-038). */
62
+ export interface EngineBanner {
63
+ /** Whether the provider's banner can render here, e.g. its native module is linked. */
64
+ isAvailable(): boolean;
65
+ readonly Component: ComponentType<EngineBannerProps>;
66
+ }
67
+ export type EngineAdEvent = {
68
+ readonly type: 'loaded';
69
+ } | {
70
+ readonly type: 'failed';
71
+ readonly cause: unknown;
72
+ /** Optional, so an engine that does not classify keeps working. */
73
+ readonly kind?: EngineFailureKind;
74
+ } | {
75
+ readonly type: 'opened';
76
+ } | {
77
+ readonly type: 'clicked';
78
+ } | {
79
+ readonly type: 'dismissed';
80
+ } | {
81
+ readonly type: 'rewarded';
82
+ readonly reward: Reward;
83
+ };
84
+ /** An opaque reference to one loaded ad. Never exposed publicly. */
85
+ export interface EngineAdHandle {
86
+ readonly id: string;
87
+ }
88
+ /**
89
+ * Consent status as the engine reports it — the provider's own vocabulary,
90
+ * lowercased, with nothing provider-shaped attached. `core/consentFlow.ts`
91
+ * normalizes this into the public `ConsentState`; keeping the two separate is
92
+ * what lets an iOS adapter map a different mechanism onto the same public shape
93
+ * without either side changing.
94
+ */
95
+ export interface EngineConsentInfo {
96
+ readonly status: 'unknown' | 'required' | 'not_required' | 'obtained';
97
+ readonly canRequestAds: boolean;
98
+ readonly isFormAvailable: boolean;
99
+ /** Whether the provider requires a "change my choice" entry point (FR-150). */
100
+ readonly privacyOptions: 'unknown' | 'required' | 'not_required';
101
+ }
102
+ export interface EngineConsentOptions {
103
+ /** Already stripped by config validation when the environment is production. */
104
+ readonly debugGeography?: 'disabled' | 'eea' | 'not_eea' | 'regulated_us_state' | 'other';
105
+ readonly underAgeOfConsent?: boolean;
106
+ readonly testDeviceIds?: readonly string[];
107
+ }
108
+ /**
109
+ * The provider's consent platform, behind the same boundary as everything else.
110
+ *
111
+ * It is a separate member of `AdsEngine` rather than more methods on it because
112
+ * it is a genuinely separate native module - the ads SDK and the consent SDK
113
+ * initialize independently and neither requires the other.
114
+ *
115
+ * The package orchestrates; it never renders. `showFormIfRequired` asks the
116
+ * provider to present its own form and reports what came back (FR-103).
117
+ */
118
+ export interface ConsentPort {
119
+ /** Refreshes consent information, applying any testing options. */
120
+ requestInfoUpdate(options: EngineConsentOptions): Promise<EngineConsentInfo>;
121
+ /** Presents the provider's form if one is required; a no-op otherwise. */
122
+ showFormIfRequired(): Promise<EngineConsentInfo>;
123
+ /**
124
+ * Presents the provider's privacy options form, through which a user changes
125
+ * an answer already given (FR-151). Resolves when the form closes, whether or
126
+ * not anything changed; rejects if it could not be presented. The caller has
127
+ * already checked the requirement, so the adapter does not re-check.
128
+ */
129
+ showPrivacyOptionsForm(): Promise<EngineConsentInfo>;
130
+ /** Last known information without contacting the network. */
131
+ getInfo(): Promise<EngineConsentInfo>;
132
+ /** Clears the stored decision. Inert in production by configuration. */
133
+ reset(): void;
134
+ }
135
+ export interface AdsEngine {
136
+ /**
137
+ * True when this platform has a working adapter. Checked before anything
138
+ * else so an unsupported platform never loads the provider at all (FR-025).
139
+ */
140
+ isAvailable(): boolean;
141
+ /**
142
+ * Applies privacy configuration and then initializes the provider. The order
143
+ * matters: child-directed and under-age flags only take effect if they reach
144
+ * the provider before it initializes (FR-017, R9).
145
+ *
146
+ * The caller guarantees this is invoked at most once per instance; the
147
+ * engine does not have to be idempotent itself.
148
+ */
149
+ initialize(privacy: EnginePrivacy): Promise<void>;
150
+ /**
151
+ * Creates and begins loading one full-screen ad. Resolves on request, not on
152
+ * load. `request` is optional so engines written against 0.4.0 still satisfy
153
+ * the port; an engine that ignores it requests personalized ads.
154
+ */
155
+ createFullScreen(format: FullScreenFormat, adUnitId: string, request?: EngineRequestOptions): Promise<EngineAdHandle>;
156
+ /** Presents a loaded ad. Rejects if the provider refuses to present. */
157
+ show(handle: EngineAdHandle): Promise<void>;
158
+ /** Provider callbacks for one handle. Returns an unsubscribe (FR-005). */
159
+ subscribe(handle: EngineAdHandle, listener: (event: EngineAdEvent) => void): Unsubscribe;
160
+ /** Releases the handle's provider resources. Safe to call more than once. */
161
+ dispose(handle: EngineAdHandle): void;
162
+ /** The provider's consent platform. Only touched if the app opts in (FR-102). */
163
+ readonly consent: ConsentPort;
164
+ /**
165
+ * The adaptive banner, rendered by `AdsBanner` (ADS-12). Optional, so an
166
+ * engine written against 0.6.0 still satisfies the port; without it banners
167
+ * report `unavailable`.
168
+ */
169
+ readonly banner?: EngineBanner;
170
+ }
171
+ //# sourceMappingURL=port.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../../../src/engine/port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAC;AAE9F,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC;IAC9C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED;;;;;;GAMG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