@picked/client 0.0.1-dev.1794447047683 → 0.0.1-dev.1794522871942

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 (333) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-Ps3qWuLD.js → api-QagLQQ2H.js} +1 -1
  3. package/dist/{api-DKEDg-Jh.cjs → api-_TiBh4tI.cjs} +1 -1
  4. package/dist/cjs/client.d.ts +161 -0
  5. package/dist/cjs/client.d.ts.map +1 -0
  6. package/dist/cjs/data-source/api.d.ts +60 -0
  7. package/dist/cjs/data-source/api.d.ts.map +1 -0
  8. package/dist/cjs/data-source/preview-unavailable.d.ts +21 -0
  9. package/dist/cjs/data-source/preview-unavailable.d.ts.map +1 -0
  10. package/dist/cjs/data-source/provider.d.ts +108 -0
  11. package/dist/cjs/data-source/provider.d.ts.map +1 -0
  12. package/dist/cjs/data-source/registry.d.ts +26 -0
  13. package/dist/cjs/data-source/registry.d.ts.map +1 -0
  14. package/dist/cjs/data-source/request-observer.d.ts +75 -0
  15. package/dist/cjs/data-source/request-observer.d.ts.map +1 -0
  16. package/dist/cjs/data-source/virtual-data.d.ts +19 -0
  17. package/dist/cjs/data-source/virtual-data.d.ts.map +1 -0
  18. package/dist/cjs/entities/action/action.d.ts +156 -0
  19. package/dist/cjs/entities/action/action.d.ts.map +1 -0
  20. package/dist/cjs/entities/component/component.d.ts +91 -0
  21. package/dist/cjs/entities/component/component.d.ts.map +1 -0
  22. package/dist/cjs/entities/component/lazyComponent.d.ts +11 -0
  23. package/dist/cjs/entities/component/lazyComponent.d.ts.map +1 -0
  24. package/dist/cjs/entities/condition/condition.d.ts +29 -0
  25. package/dist/cjs/entities/condition/condition.d.ts.map +1 -0
  26. package/dist/cjs/entities/content/content.d.ts +53 -0
  27. package/dist/cjs/entities/content/content.d.ts.map +1 -0
  28. package/dist/cjs/entities/content/reference.d.ts +101 -0
  29. package/dist/cjs/entities/content/reference.d.ts.map +1 -0
  30. package/dist/cjs/entities/experience/experience.d.ts +228 -0
  31. package/dist/cjs/entities/experience/experience.d.ts.map +1 -0
  32. package/dist/cjs/entities/experience-instance/action-result.d.ts +69 -0
  33. package/dist/cjs/entities/experience-instance/action-result.d.ts.map +1 -0
  34. package/dist/cjs/entities/experience-instance/experience-instance.d.ts +112 -0
  35. package/dist/cjs/entities/experience-instance/experience-instance.d.ts.map +1 -0
  36. package/dist/cjs/entities/feature/feature.d.ts +158 -0
  37. package/dist/cjs/entities/feature/feature.d.ts.map +1 -0
  38. package/dist/cjs/entities/field/field.d.ts +135 -0
  39. package/dist/cjs/entities/field/field.d.ts.map +1 -0
  40. package/dist/cjs/entities/field/policies.d.ts +35 -0
  41. package/dist/cjs/entities/field/policies.d.ts.map +1 -0
  42. package/dist/cjs/entities/framework/framework.d.ts +45 -0
  43. package/dist/cjs/entities/framework/framework.d.ts.map +1 -0
  44. package/dist/cjs/entities/history/history.d.ts +25 -0
  45. package/dist/cjs/entities/history/history.d.ts.map +1 -0
  46. package/dist/cjs/entities/plugin/plugin.d.ts +50 -0
  47. package/dist/cjs/entities/plugin/plugin.d.ts.map +1 -0
  48. package/dist/cjs/entities/predicate/predicate.d.ts +48 -0
  49. package/dist/cjs/entities/predicate/predicate.d.ts.map +1 -0
  50. package/dist/cjs/entities/response/response-validation.d.ts +75 -0
  51. package/dist/cjs/entities/response/response-validation.d.ts.map +1 -0
  52. package/dist/cjs/entities/response/response.d.ts +69 -0
  53. package/dist/cjs/entities/response/response.d.ts.map +1 -0
  54. package/dist/cjs/entities/session/session.d.ts +55 -0
  55. package/dist/cjs/entities/session/session.d.ts.map +1 -0
  56. package/dist/cjs/entities/step/step.d.ts +56 -0
  57. package/dist/cjs/entities/step/step.d.ts.map +1 -0
  58. package/dist/cjs/entities/workspace/workspace.d.ts +37 -0
  59. package/dist/cjs/entities/workspace/workspace.d.ts.map +1 -0
  60. package/dist/cjs/exports.d.ts +34 -0
  61. package/dist/cjs/exports.d.ts.map +1 -0
  62. package/dist/cjs/form/build-responses.d.ts +18 -0
  63. package/dist/cjs/form/build-responses.d.ts.map +1 -0
  64. package/dist/cjs/form/create-field-evaluator.d.ts +28 -0
  65. package/dist/cjs/form/create-field-evaluator.d.ts.map +1 -0
  66. package/dist/cjs/form/create-field-validation.d.ts +60 -0
  67. package/dist/cjs/form/create-field-validation.d.ts.map +1 -0
  68. package/dist/cjs/form/create-form.d.ts +155 -0
  69. package/dist/cjs/form/create-form.d.ts.map +1 -0
  70. package/dist/cjs/form/create-submit-pipeline.d.ts +116 -0
  71. package/dist/cjs/form/create-submit-pipeline.d.ts.map +1 -0
  72. package/dist/cjs/form/get-step-fields.d.ts +19 -0
  73. package/dist/cjs/form/get-step-fields.d.ts.map +1 -0
  74. package/dist/cjs/form/index.d.ts +11 -0
  75. package/dist/cjs/form/index.d.ts.map +1 -0
  76. package/dist/cjs/index.d.ts +27 -0
  77. package/dist/cjs/index.d.ts.map +1 -0
  78. package/dist/cjs/index.js +2 -2
  79. package/dist/cjs/lifecycle/condition-selection.d.ts +146 -0
  80. package/dist/cjs/lifecycle/condition-selection.d.ts.map +1 -0
  81. package/dist/cjs/lifecycle/lifecycle.d.ts +48 -0
  82. package/dist/cjs/lifecycle/lifecycle.d.ts.map +1 -0
  83. package/dist/cjs/lifecycle/rules-logic.d.ts +25 -0
  84. package/dist/cjs/lifecycle/rules-logic.d.ts.map +1 -0
  85. package/dist/cjs/lifecycle/state-snapshot.d.ts +38 -0
  86. package/dist/cjs/lifecycle/state-snapshot.d.ts.map +1 -0
  87. package/dist/cjs/logic-engine.d.ts +38 -0
  88. package/dist/cjs/logic-engine.d.ts.map +1 -0
  89. package/dist/cjs/package.json +3 -0
  90. package/dist/cjs/picked.d.ts +468 -0
  91. package/dist/cjs/picked.d.ts.map +1 -0
  92. package/dist/cjs/plugins/create-experience/create-experience.d.ts +221 -0
  93. package/dist/cjs/plugins/create-experience/create-experience.d.ts.map +1 -0
  94. package/dist/cjs/plugins/create-experience/index.d.ts +6 -0
  95. package/dist/cjs/plugins/create-experience/index.d.ts.map +1 -0
  96. package/dist/cjs/plugins/create-experience/plugin.d.ts +9 -0
  97. package/dist/cjs/plugins/create-experience/plugin.d.ts.map +1 -0
  98. package/dist/cjs/plugins/create-experience/serialization.d.ts +6 -0
  99. package/dist/cjs/plugins/create-experience/serialization.d.ts.map +1 -0
  100. package/dist/cjs/plugins/dom-observer/index.d.ts +3 -0
  101. package/dist/cjs/plugins/dom-observer/index.d.ts.map +1 -0
  102. package/dist/cjs/plugins/dom-observer/plugin.d.ts +50 -0
  103. package/dist/cjs/plugins/dom-observer/plugin.d.ts.map +1 -0
  104. package/dist/cjs/plugins/dynamic-experiences/hash.d.ts +105 -0
  105. package/dist/cjs/plugins/dynamic-experiences/hash.d.ts.map +1 -0
  106. package/dist/cjs/plugins/dynamic-experiences/index.d.ts +8 -0
  107. package/dist/cjs/plugins/dynamic-experiences/index.d.ts.map +1 -0
  108. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  109. package/dist/cjs/plugins/dynamic-experiences/plugin.d.ts +53 -0
  110. package/dist/cjs/plugins/dynamic-experiences/plugin.d.ts.map +1 -0
  111. package/dist/cjs/plugins/dynamic-experiences/types.d.ts +48 -0
  112. package/dist/cjs/plugins/dynamic-experiences/types.d.ts.map +1 -0
  113. package/dist/cjs/plugins/experience-browser-storage/index.d.ts +2 -0
  114. package/dist/cjs/plugins/experience-browser-storage/index.d.ts.map +1 -0
  115. package/dist/cjs/plugins/experience-browser-storage/plugin.d.ts +7 -0
  116. package/dist/cjs/plugins/experience-browser-storage/plugin.d.ts.map +1 -0
  117. package/dist/cjs/plugins/history-browser-storage/index.d.ts +2 -0
  118. package/dist/cjs/plugins/history-browser-storage/index.d.ts.map +1 -0
  119. package/dist/cjs/plugins/history-browser-storage/plugin.d.ts +7 -0
  120. package/dist/cjs/plugins/history-browser-storage/plugin.d.ts.map +1 -0
  121. package/dist/cjs/plugins/responses-browser-storage/index.d.ts +2 -0
  122. package/dist/cjs/plugins/responses-browser-storage/index.d.ts.map +1 -0
  123. package/dist/cjs/plugins/responses-browser-storage/plugin.d.ts +18 -0
  124. package/dist/cjs/plugins/responses-browser-storage/plugin.d.ts.map +1 -0
  125. package/dist/cjs/plugins/responses-indexeddb/index.d.ts +2 -0
  126. package/dist/cjs/plugins/responses-indexeddb/index.d.ts.map +1 -0
  127. package/dist/cjs/plugins/responses-indexeddb/plugin.d.ts +3 -0
  128. package/dist/cjs/plugins/responses-indexeddb/plugin.d.ts.map +1 -0
  129. package/dist/cjs/plugins/single-page-app/index.d.ts +3 -0
  130. package/dist/cjs/plugins/single-page-app/index.d.ts.map +1 -0
  131. package/dist/cjs/plugins/single-page-app/plugin.d.ts +32 -0
  132. package/dist/cjs/plugins/single-page-app/plugin.d.ts.map +1 -0
  133. package/dist/cjs/plugins/telemetry/emit.d.ts +18 -0
  134. package/dist/cjs/plugins/telemetry/emit.d.ts.map +1 -0
  135. package/dist/cjs/plugins/telemetry/index.d.ts +4 -0
  136. package/dist/cjs/plugins/telemetry/index.d.ts.map +1 -0
  137. package/dist/cjs/plugins/telemetry/plugin-summary.d.ts +10 -0
  138. package/dist/cjs/plugins/telemetry/plugin-summary.d.ts.map +1 -0
  139. package/dist/cjs/plugins/telemetry/plugin.d.ts +47 -0
  140. package/dist/cjs/plugins/telemetry/plugin.d.ts.map +1 -0
  141. package/dist/cjs/plugins/web-components/index.d.ts +2 -0
  142. package/dist/cjs/plugins/web-components/index.d.ts.map +1 -0
  143. package/dist/cjs/plugins/web-components/plugin.d.ts +4 -0
  144. package/dist/cjs/plugins/web-components/plugin.d.ts.map +1 -0
  145. package/dist/cjs/plugins/window-object/index.d.ts +2 -0
  146. package/dist/cjs/plugins/window-object/index.d.ts.map +1 -0
  147. package/dist/cjs/plugins/window-object/plugin.d.ts +9 -0
  148. package/dist/cjs/plugins/window-object/plugin.d.ts.map +1 -0
  149. package/dist/cjs/preview/index.d.ts +18 -0
  150. package/dist/cjs/preview/index.d.ts.map +1 -0
  151. package/dist/cjs/preview-bridge/index.d.ts +14 -0
  152. package/dist/cjs/preview-bridge/index.d.ts.map +1 -0
  153. package/dist/cjs/preview-channel.d.ts +16 -0
  154. package/dist/cjs/preview-channel.d.ts.map +1 -0
  155. package/dist/cjs/preview-receiver/apply-ops.d.ts +32 -0
  156. package/dist/cjs/preview-receiver/apply-ops.d.ts.map +1 -0
  157. package/dist/cjs/preview-receiver/index.d.ts +32 -0
  158. package/dist/cjs/preview-receiver/index.d.ts.map +1 -0
  159. package/dist/cjs/preview-receiver/protocol.d.ts +69 -0
  160. package/dist/cjs/preview-receiver/protocol.d.ts.map +1 -0
  161. package/dist/cjs/schema-registry.d.ts +240 -0
  162. package/dist/cjs/schema-registry.d.ts.map +1 -0
  163. package/dist/cjs/server/hydrate.d.ts +21 -0
  164. package/dist/cjs/server/hydrate.d.ts.map +1 -0
  165. package/dist/cjs/server/index.d.ts +28 -0
  166. package/dist/cjs/server/index.d.ts.map +1 -0
  167. package/dist/cjs/server/index.js +1 -1
  168. package/dist/cjs/server/serialize.d.ts +89 -0
  169. package/dist/cjs/server/serialize.d.ts.map +1 -0
  170. package/dist/cjs/storage.d.ts +6 -0
  171. package/dist/cjs/storage.d.ts.map +1 -0
  172. package/dist/cjs/typed-content.d.ts +30 -0
  173. package/dist/cjs/typed-content.d.ts.map +1 -0
  174. package/dist/cjs/utils/api-url.d.ts +2 -0
  175. package/dist/cjs/utils/api-url.d.ts.map +1 -0
  176. package/dist/cjs/utils/client-telemetry.d.ts +25 -0
  177. package/dist/cjs/utils/client-telemetry.d.ts.map +1 -0
  178. package/dist/cjs/utils/content-path.d.ts +37 -0
  179. package/dist/cjs/utils/content-path.d.ts.map +1 -0
  180. package/dist/cjs/utils/devtools-experience.d.ts +4 -0
  181. package/dist/cjs/utils/devtools-experience.d.ts.map +1 -0
  182. package/dist/cjs/utils/dom.d.ts +20 -0
  183. package/dist/cjs/utils/dom.d.ts.map +1 -0
  184. package/dist/cjs/utils/events.d.ts +129 -0
  185. package/dist/cjs/utils/events.d.ts.map +1 -0
  186. package/dist/cjs/utils/global-obj.d.ts +10 -0
  187. package/dist/cjs/utils/global-obj.d.ts.map +1 -0
  188. package/dist/cjs/utils/html-asset-value.d.ts +20 -0
  189. package/dist/cjs/utils/html-asset-value.d.ts.map +1 -0
  190. package/dist/cjs/utils/id.d.ts +11 -0
  191. package/dist/cjs/utils/id.d.ts.map +1 -0
  192. package/dist/cjs/utils/indexed-db.d.ts +12 -0
  193. package/dist/cjs/utils/indexed-db.d.ts.map +1 -0
  194. package/dist/cjs/utils/inert-script-report.d.ts +40 -0
  195. package/dist/cjs/utils/inert-script-report.d.ts.map +1 -0
  196. package/dist/cjs/utils/logger.d.ts +3 -0
  197. package/dist/cjs/utils/logger.d.ts.map +1 -0
  198. package/dist/cjs/utils/node-tree/get-next-node-from-action.d.ts +25 -0
  199. package/dist/cjs/utils/node-tree/get-next-node-from-action.d.ts.map +1 -0
  200. package/dist/cjs/utils/node-tree/get-next-node-from-condition.d.ts +17 -0
  201. package/dist/cjs/utils/node-tree/get-next-node-from-condition.d.ts.map +1 -0
  202. package/dist/cjs/utils/node-tree/get-next-node.d.ts +3 -0
  203. package/dist/cjs/utils/node-tree/get-next-node.d.ts.map +1 -0
  204. package/dist/cjs/utils/node-tree/get-origin-node.d.ts +3 -0
  205. package/dist/cjs/utils/node-tree/get-origin-node.d.ts.map +1 -0
  206. package/dist/cjs/utils/node-tree/min-max-steps-to-leaf.d.ts +21 -0
  207. package/dist/cjs/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -0
  208. package/dist/cjs/utils/node-tree/min-max-steps-to-origin.d.ts +23 -0
  209. package/dist/cjs/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -0
  210. package/dist/cjs/utils/node-tree/next-reachable-step-nodes.d.ts +37 -0
  211. package/dist/cjs/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -0
  212. package/dist/cjs/utils/node-tree/node-adjacency.d.ts +50 -0
  213. package/dist/cjs/utils/node-tree/node-adjacency.d.ts.map +1 -0
  214. package/dist/cjs/utils/node-tree/node-tree-index.d.ts +57 -0
  215. package/dist/cjs/utils/node-tree/node-tree-index.d.ts.map +1 -0
  216. package/dist/cjs/utils/nodes.d.ts +7 -0
  217. package/dist/cjs/utils/nodes.d.ts.map +1 -0
  218. package/dist/cjs/utils/object.d.ts +49 -0
  219. package/dist/cjs/utils/object.d.ts.map +1 -0
  220. package/dist/cjs/utils/picked-config.d.ts +39 -0
  221. package/dist/cjs/utils/picked-config.d.ts.map +1 -0
  222. package/dist/cjs/utils/preview-session.d.ts +12 -0
  223. package/dist/cjs/utils/preview-session.d.ts.map +1 -0
  224. package/dist/cjs/utils/rehydrate-scripts.d.ts +50 -0
  225. package/dist/cjs/utils/rehydrate-scripts.d.ts.map +1 -0
  226. package/dist/cjs/utils/render-string.d.ts +24 -0
  227. package/dist/cjs/utils/render-string.d.ts.map +1 -0
  228. package/dist/cjs/utils/rules-logic.d.ts +36 -0
  229. package/dist/cjs/utils/rules-logic.d.ts.map +1 -0
  230. package/dist/cjs/utils/search-params.d.ts +26 -0
  231. package/dist/cjs/utils/search-params.d.ts.map +1 -0
  232. package/dist/cjs/utils/storage.d.ts +385 -0
  233. package/dist/cjs/utils/storage.d.ts.map +1 -0
  234. package/dist/cjs/utils/supports.d.ts +97 -0
  235. package/dist/cjs/utils/supports.d.ts.map +1 -0
  236. package/dist/cjs/utils/user-timing.d.ts +21 -0
  237. package/dist/cjs/utils/user-timing.d.ts.map +1 -0
  238. package/dist/cjs/utils/version.d.ts +2 -0
  239. package/dist/cjs/utils/version.d.ts.map +1 -0
  240. package/dist/esm/index.js +2 -2
  241. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  242. package/dist/esm/server/index.js +2 -2
  243. package/dist/{plugin-Aje0MrOc.cjs → plugin-4x9roKsW.cjs} +1 -1
  244. package/dist/{plugin-CUKdIPyB.js → plugin-8kWEbrWK.js} +2 -2
  245. package/dist/{preview-unavailable-BYHvskoW.js → preview-unavailable-BXIA2EMs.js} +1 -1
  246. package/dist/{preview-unavailable-BtD0pTQQ.cjs → preview-unavailable-CyeVy46l.cjs} +1 -1
  247. package/dist/{provider-PLBJgT1D.js → provider-BZJtQ6tj.js} +1 -1
  248. package/dist/{provider-Bhv8GXuw.cjs → provider-DO8pSl7q.cjs} +1 -1
  249. package/dist/types/client.d.ts +7 -7
  250. package/dist/types/data-source/provider.d.ts +3 -3
  251. package/dist/types/data-source/registry.d.ts +1 -1
  252. package/dist/types/data-source/virtual-data.d.ts +1 -1
  253. package/dist/types/entities/action/action.d.ts +3 -3
  254. package/dist/types/entities/component/component.d.ts +4 -4
  255. package/dist/types/entities/condition/condition.d.ts +1 -1
  256. package/dist/types/entities/content/reference.d.ts +1 -1
  257. package/dist/types/entities/experience/experience.d.ts +7 -7
  258. package/dist/types/entities/experience-instance/action-result.d.ts +1 -1
  259. package/dist/types/entities/experience-instance/experience-instance.d.ts +6 -6
  260. package/dist/types/entities/feature/feature.d.ts +2 -2
  261. package/dist/types/entities/field/field.d.ts +2 -2
  262. package/dist/types/entities/framework/framework.d.ts +3 -3
  263. package/dist/types/entities/history/history.d.ts +1 -1
  264. package/dist/types/entities/plugin/plugin.d.ts +1 -1
  265. package/dist/types/entities/predicate/predicate.d.ts +2 -2
  266. package/dist/types/entities/response/response-validation.d.ts +2 -2
  267. package/dist/types/entities/response/response.d.ts +5 -5
  268. package/dist/types/entities/step/step.d.ts +1 -1
  269. package/dist/types/exports.d.ts +20 -20
  270. package/dist/types/form/build-responses.d.ts +1 -1
  271. package/dist/types/form/create-field-evaluator.d.ts +2 -2
  272. package/dist/types/form/create-field-validation.d.ts +3 -3
  273. package/dist/types/form/create-form.d.ts +5 -5
  274. package/dist/types/form/create-submit-pipeline.d.ts +6 -6
  275. package/dist/types/form/get-step-fields.d.ts +3 -3
  276. package/dist/types/form/index.d.ts +9 -9
  277. package/dist/types/index.d.ts +25 -25
  278. package/dist/types/lifecycle/condition-selection.d.ts +3 -3
  279. package/dist/types/lifecycle/lifecycle.d.ts +2 -2
  280. package/dist/types/lifecycle/rules-logic.d.ts +2 -2
  281. package/dist/types/lifecycle/state-snapshot.d.ts +2 -2
  282. package/dist/types/picked.d.ts +74 -74
  283. package/dist/types/plugins/create-experience/create-experience.d.ts +8 -8
  284. package/dist/types/plugins/create-experience/index.d.ts +4 -4
  285. package/dist/types/plugins/create-experience/plugin.d.ts +2 -2
  286. package/dist/types/plugins/dom-observer/index.d.ts +1 -1
  287. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  288. package/dist/types/plugins/dynamic-experiences/index.d.ts +3 -3
  289. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +3 -3
  290. package/dist/types/plugins/experience-browser-storage/index.d.ts +1 -1
  291. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  292. package/dist/types/plugins/history-browser-storage/index.d.ts +1 -1
  293. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  294. package/dist/types/plugins/responses-browser-storage/index.d.ts +1 -1
  295. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  296. package/dist/types/plugins/responses-indexeddb/index.d.ts +1 -1
  297. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  298. package/dist/types/plugins/single-page-app/index.d.ts +2 -2
  299. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  300. package/dist/types/plugins/telemetry/index.d.ts +2 -2
  301. package/dist/types/plugins/telemetry/plugin.d.ts +1 -1
  302. package/dist/types/plugins/web-components/index.d.ts +1 -1
  303. package/dist/types/plugins/web-components/plugin.d.ts +1 -1
  304. package/dist/types/plugins/window-object/index.d.ts +1 -1
  305. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  306. package/dist/types/preview/index.d.ts +6 -6
  307. package/dist/types/preview-channel.d.ts +1 -1
  308. package/dist/types/preview-receiver/index.d.ts +1 -1
  309. package/dist/types/preview-receiver/protocol.d.ts +1 -1
  310. package/dist/types/schema-registry.d.ts +2 -2
  311. package/dist/types/server/hydrate.d.ts +2 -2
  312. package/dist/types/server/index.d.ts +9 -9
  313. package/dist/types/server/serialize.d.ts +1 -1
  314. package/dist/types/storage.d.ts +1 -1
  315. package/dist/types/typed-content.d.ts +2 -2
  316. package/dist/types/utils/client-telemetry.d.ts +1 -1
  317. package/dist/types/utils/dom.d.ts +1 -1
  318. package/dist/types/utils/events.d.ts +5 -5
  319. package/dist/types/utils/global-obj.d.ts +1 -1
  320. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +1 -1
  321. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +1 -1
  322. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  323. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  324. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +2 -2
  325. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +2 -2
  326. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +2 -2
  327. package/dist/types/utils/node-tree/node-adjacency.d.ts +1 -1
  328. package/dist/types/utils/node-tree/node-tree-index.d.ts +2 -2
  329. package/dist/types/utils/nodes.d.ts +1 -1
  330. package/dist/types/utils/picked-config.d.ts +1 -1
  331. package/dist/types/utils/rules-logic.d.ts +2 -2
  332. package/dist/types/utils/storage.d.ts +1 -1
  333. package/package.json +141 -56
@@ -0,0 +1,39 @@
1
+ /** @file Resolves the project id for a Picked client from options, window config, or script tag attributes. */
2
+ import type { CreateClientOptions } from '../client.js';
3
+ /** Subset of {@link CreateClientOptions} exposed on `window.pickedConfig`. */
4
+ interface WindowPickedConfig {
5
+ organizationId?: string;
6
+ projectId?: string;
7
+ previewToken?: string;
8
+ apiUrl?: string;
9
+ dashboardUrl?: string;
10
+ documentationSiteUrl?: string;
11
+ }
12
+ declare global {
13
+ interface Window {
14
+ pickedConfig?: WindowPickedConfig;
15
+ }
16
+ }
17
+ /**
18
+ * Reads `window.pickedConfig` when running in a browser.
19
+ *
20
+ * @template ExtendedPickedConfig - Additional keys consumers attach to the window config.
21
+ * @returns {Readonly<Partial<CreateClientOptions> & ExtendedPickedConfig> | undefined} The window config, if set.
22
+ * @example
23
+ * getPickedConfig<{ theme: string }>()?.theme
24
+ */
25
+ export declare function getPickedConfig<ExtendedPickedConfig extends Record<string, unknown> | undefined>(): Readonly<Partial<CreateClientOptions> & ExtendedPickedConfig> | undefined;
26
+ /**
27
+ * Resolves the Picked project id from the supplied options, falling back to
28
+ * `window.pickedConfig.projectId` and then to a `data-projectid` (or
29
+ * `project-id`) attribute on a `picked_script`/`picked`/`cvly` script tag.
30
+ *
31
+ * @param {CreateClientOptions} options - Options passed to `createClient`.
32
+ * @returns {string} The resolved project id.
33
+ * @throws {Error} If no project id can be resolved from any source.
34
+ * @example
35
+ * getCreateClientProjectId({ projectId: 'proj-abc' })
36
+ */
37
+ export declare function getCreateClientProjectId(options: CreateClientOptions): string;
38
+ export {};
39
+ //# sourceMappingURL=picked-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picked-config.d.ts","sourceRoot":"","sources":["../../../src/utils/picked-config.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAGpD,8EAA8E;AAC9E,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE,kBAAkB,CAAA;KAClC;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,oBAAoB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,+EAUjE;AAyCD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAqB7E"}
@@ -0,0 +1,12 @@
1
+ /** Search parameter the dashboard appends to the preview iframe's URL. */
2
+ export declare const PREVIEW_TOKEN_PARAM = "preview-token";
3
+ /**
4
+ * Whether this frame is running as a Picked live-preview session: inside an iframe, with a preview
5
+ * token on the URL.
6
+ *
7
+ * @returns {boolean} True when the frame is a preview session.
8
+ * @example
9
+ * if (isPreviewSession()) enableMorphingRender()
10
+ */
11
+ export declare function isPreviewSession(): boolean;
12
+ //# sourceMappingURL=preview-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-session.d.ts","sourceRoot":"","sources":["../../../src/utils/preview-session.ts"],"names":[],"mappings":"AAUA,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,kBAAkB,CAAA;AAElD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C"}
@@ -0,0 +1,50 @@
1
+ /** @file Re-executes Picked-tagged <script> elements that innerHTML left inert. */
2
+ /** Inert script type the Picked transform stamps on classic scripts it blesses for rehydration. */
3
+ export declare const PICKED_SCRIPT_TYPE = "application/picked-javascript";
4
+ /** Inert script type the Picked transform stamps on `type="module"` scripts it blesses for rehydration. */
5
+ export declare const PICKED_MODULE_SCRIPT_TYPE = "application/picked-module";
6
+ /** Marker set on resurrected scripts so rehydration is idempotent. */
7
+ export declare const PICKED_HYDRATED_ATTR = "data-picked-hydrated";
8
+ declare global {
9
+ /**
10
+ * Root node of the currently-executing rehydrated inline script. Published only for the duration of
11
+ * that script's synchronous run so shadow-scoped page scripts can locate their own root, since
12
+ * `document.currentScript` is `null` inside a shadow tree.
13
+ */
14
+ var __pickedEmbedScriptRoot: Node | null | undefined;
15
+ }
16
+ /**
17
+ * Re-creates every Picked-tagged (`type="application/picked-javascript"` or
18
+ * `type="application/picked-module"`) script under `root` as a fresh, executable element, so
19
+ * scripts inserted via `innerHTML` (which never run) execute — restored as `type="module"` for the
20
+ * latter. Untagged scripts, including data blocks such as `application/json` or `importmap`, are left
21
+ * untouched. In-place replacement preserves document order. Because `document.currentScript` is `null`
22
+ * inside a shadow tree, each inline script's own root is published on `globalThis.__pickedEmbedScriptRoot`
23
+ * while it runs, so shadow-scoped page scripts read `window.__pickedEmbedScriptRoot` to find their own root.
24
+ *
25
+ * Classic inline scripts are pre-parsed with the `Function` constructor and skipped only when that
26
+ * throws a `SyntaxError`, so a body that would blank the experience on insertion is logged and left
27
+ * inert. Any other failure says nothing about the body — a CSP omitting `'unsafe-eval'` throws an
28
+ * `EvalError` and Trusted Types throws a `TypeError` however well the body parses — so the script is
29
+ * injected unchanged and the page keeps working under those policies.
30
+ *
31
+ * This function intentionally references only globals and its own parameter, never the exported
32
+ * `PICKED_*` constants above, so {@link buildRehydrateBootstrap} can serialise it with `.toString()` for
33
+ * injection into a sandboxed iframe, where module imports are unavailable.
34
+ *
35
+ * @param {ParentNode} root - Element, ShadowRoot, or Document whose tagged scripts to rehydrate.
36
+ * @returns {Promise<void>} Resolves after external (`src`) scripts have settled (load or error).
37
+ * @example
38
+ * await rehydrateScripts(shadowRoot)
39
+ */
40
+ export declare function rehydrateScripts(root: ParentNode): Promise<void>;
41
+ /**
42
+ * Builds an inline `<script>` string that runs {@link rehydrateScripts} against the injected document.
43
+ * For splicing into an iframe `srcDoc` (or any HTML string) where module imports are unavailable.
44
+ *
45
+ * @returns {string} A self-contained `<script>…</script>` string.
46
+ * @example
47
+ * html.replace('</body>', buildRehydrateBootstrap() + '</body>')
48
+ */
49
+ export declare function buildRehydrateBootstrap(): string;
50
+ //# sourceMappingURL=rehydrate-scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rehydrate-scripts.d.ts","sourceRoot":"","sources":["../../../src/utils/rehydrate-scripts.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,kCAAkC,CAAA;AACjE,2GAA2G;AAC3G,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,yBAAyB,CAAA;AAE1D,OAAO,CAAC,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,uBAAuB,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoGtE;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
@@ -0,0 +1,24 @@
1
+ interface InterpolateContext {
2
+ responses?: Record<string, unknown>;
3
+ [key: string]: unknown;
4
+ }
5
+ /**
6
+ * Internal interpolation engine used by Picked.renderString().
7
+ * Renders a template containing {{ ... }} placeholders using the provided context.
8
+ *
9
+ * Notes:
10
+ * - Keys use dot-notation (e.g. user.profile.name).
11
+ * - Function values in context are invoked and their result is rendered.
12
+ * - Empty detection: null, undefined, empty string, and NaN render as empty; 0/false/true render as "0"/"false"/"true".
13
+ * - Modifiers: default, append, prepend, upper, lower, capitalize, list.
14
+ * - Objects/arrays are JSON-stringified; Maps/Sets stringify to {} unless using the list modifier.
15
+ *
16
+ * For consumer-facing usage and examples, see Picked.renderString() in the client.
17
+ *
18
+ * @param template Template with placeholders like {{ key | modifier: arg }}.
19
+ * @param context Data source for interpolation.
20
+ * @returns Interpolated string.
21
+ */
22
+ export declare function renderString(template: string, context: InterpolateContext): string;
23
+ export {};
24
+ //# sourceMappingURL=render-string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-string.d.ts","sourceRoot":"","sources":["../../../src/utils/render-string.ts"],"names":[],"mappings":"AAAA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AA4HD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,CA0BlF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @file Async wrapper around `client.evaluateRuleLogicFx` for callers that hold a `Picked`
3
+ * reference rather than the effect.
4
+ */
5
+ import type { LogicObject, LogicRule } from '../logic-engine.js';
6
+ import type { Picked } from '../picked.js';
7
+ /**
8
+ * Type guard that reads a value as a LogicRule unless it is `undefined`, `null` or an empty
9
+ * plain object.
10
+ *
11
+ * @param {unknown} rules - The value to check.
12
+ * @returns {boolean} True unless `rules` is `undefined`, `null` or `{}`.
13
+ * @example
14
+ * ```ts
15
+ * if (isRulesLogic(maybeRule)) {
16
+ * await evaluateRuleLogic(client, maybeRule)
17
+ * }
18
+ * ```
19
+ */
20
+ export declare function isRulesLogic(rules: unknown): rules is LogicRule;
21
+ /**
22
+ * Evaluates a json-logic condition against the current client state by delegating to `client.evaluateRuleLogicFx`.
23
+ *
24
+ * @param {Picked} client - The Picked client instance providing reactive state stores.
25
+ * @param {LogicRule} condition - The json-logic rule to evaluate.
26
+ * @param {LogicObject} [context] - Optional overrides merged on top of the default context (e.g., staged form values).
27
+ * @returns {Promise<unknown>} The result of applying the logic rule.
28
+ * @example
29
+ * ```ts
30
+ * const visible = await evaluateRuleLogic(client, field.condition, {
31
+ * responses: { ...committed, ...staged },
32
+ * })
33
+ * ```
34
+ */
35
+ export declare function evaluateRuleLogic(client: Picked, condition: LogicRule, context?: LogicObject): Promise<unknown>;
36
+ //# sourceMappingURL=rules-logic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules-logic.d.ts","sourceRoot":"","sources":["../../../src/utils/rules-logic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,OAAO,CAAC,CAElB"}
@@ -0,0 +1,26 @@
1
+ /** `picked-*` search params keyed by name without the prefix, each holding every value given. */
2
+ export interface PickedSearchParams {
3
+ feature?: string[];
4
+ [key: string]: string[] | undefined;
5
+ }
6
+ /**
7
+ * Reads the page's `picked-*` search params. A URL carrying any of them replaces the session
8
+ * record; a URL carrying none reads the record back, so the params persist for the tab.
9
+ *
10
+ * @returns {PickedSearchParams} The params, keyed without their `picked-` prefix.
11
+ * @example
12
+ * const token = getSearchParams()['preview-token']?.[0]
13
+ */
14
+ export declare function getSearchParams(): PickedSearchParams;
15
+ /**
16
+ * Removes one `picked-*` param from the given params and from the session record that carries
17
+ * it across page loads, so later loads in the tab no longer see it. The record goes once it
18
+ * holds nothing else.
19
+ *
20
+ * @param {PickedSearchParams} params - The params to remove the key from, such as `client.searchParams`.
21
+ * @param {string} key - The param name without its `picked-` prefix.
22
+ * @example
23
+ * forgetSearchParam(client.searchParams, 'preview-token')
24
+ */
25
+ export declare function forgetSearchParam(params: PickedSearchParams, key: string): void;
26
+ //# sourceMappingURL=search-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-params.d.ts","sourceRoot":"","sources":["../../../src/utils/search-params.ts"],"names":[],"mappings":"AAOA,iGAAiG;AACjG,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,kBAAkB,CAiCpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAgB/E"}
@@ -0,0 +1,385 @@
1
+ import type { ExperienceInstance } from '../entities/experience-instance/experience-instance.js';
2
+ /**
3
+ * Defines the scope of storage items.
4
+ * - 'global': Storage is shared across all experiences
5
+ * - 'experience': Storage is scoped to a specific experience instance
6
+ */
7
+ export type StorageScope = 'global' | 'experience';
8
+ /**
9
+ * Represents a storage item with methods to read, write, and subscribe to changes.
10
+ * Provides type-safe access to browser storage (localStorage or sessionStorage).
11
+ *
12
+ * @template T - The type of the stored value
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const key = createStorageKey('user-preferences')
17
+ * const item = sessionStore.get<UserPrefs>(key)
18
+ *
19
+ * // Check if value exists
20
+ * if (item.isSet()) {
21
+ * const prefs = item.json() // UserPrefs | null
22
+ * }
23
+ *
24
+ * // Set value with expiry
25
+ * item.set({ theme: 'dark' }, 3600000) // Expires in 1 hour
26
+ *
27
+ * // Subscribe to changes
28
+ * const unsubscribe = item.subscribe((updatedItem) => {
29
+ * console.log('Updated:', updatedItem.json())
30
+ * })
31
+ * ```
32
+ */
33
+ export interface StorageItem<T = unknown> {
34
+ /**
35
+ * Checks if a value is stored for this item.
36
+ *
37
+ * @returns `true` if a value exists, `false` otherwise
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * if (item.isSet()) {
42
+ * console.log('Value exists')
43
+ * }
44
+ * ```
45
+ */
46
+ isSet: () => boolean;
47
+ /**
48
+ * Gets the stored value as a string.
49
+ *
50
+ * @returns The stored string value, or `null` if not set
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * const name = item.text() // "John" or null
55
+ * ```
56
+ */
57
+ text: () => string | null;
58
+ /**
59
+ * Gets the stored value as a parsed JSON object.
60
+ *
61
+ * @returns The parsed value of type T, or `null` if not set
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const user = item.json<User>() // { name: "John", age: 30 } or null
66
+ * ```
67
+ */
68
+ json: () => T | null;
69
+ /**
70
+ * Gets the stored value as a boolean.
71
+ *
72
+ * @returns `true` if value is "true", `false` if value is any other string, or `null` if not set
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * const isEnabled = item.boolean() // true, false, or null
77
+ * ```
78
+ */
79
+ boolean: () => boolean | null;
80
+ /**
81
+ * Sets a value in storage with optional expiry time.
82
+ *
83
+ * @param value - The value to store (will be JSON stringified if not a string)
84
+ * @param expiresIn - Optional expiry time in milliseconds from now
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * // Set without expiry
89
+ * item.set({ theme: 'dark' })
90
+ *
91
+ * // Set with 1 hour expiry
92
+ * item.set({ theme: 'dark' }, 60 * 60 * 1000)
93
+ * ```
94
+ */
95
+ set: (value: T, expiresIn?: number) => void;
96
+ /**
97
+ * Removes the item from storage, including any expiry metadata.
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * item.remove()
102
+ * console.log(item.isSet()) // false
103
+ * ```
104
+ */
105
+ remove: () => void;
106
+ /**
107
+ * Subscribes to storage changes for this item, both in the same tab and across browser tabs/windows.
108
+ * Callbacks are invoked immediately when changes occur via set() or remove() in the same tab,
109
+ * and also when changes are made in other tabs/windows.
110
+ *
111
+ * @param callback - Function called when the storage value changes, receives the updated StorageItem
112
+ * @returns Unsubscribe function to stop listening to changes
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * const unsubscribe = item.subscribe((updatedItem) => {
117
+ * console.log('Value changed:', updatedItem.json())
118
+ * })
119
+ *
120
+ * // Changes in same tab will trigger the callback
121
+ * item.set({ theme: 'dark' }) // callback fires immediately
122
+ *
123
+ * // Changes in other tabs also trigger the callback
124
+ * // (when another tab calls item.set())
125
+ *
126
+ * // Later, stop listening
127
+ * unsubscribe()
128
+ * ```
129
+ */
130
+ subscribe: (callback: (value: StorageItem<T>) => void) => () => void;
131
+ }
132
+ /**
133
+ * Represents a storage key with encoded identifier and scope metadata.
134
+ */
135
+ export interface StorageKey {
136
+ /**
137
+ * The encoded storage key string used in browser storage
138
+ */
139
+ _: string;
140
+ /**
141
+ * The scope of the storage key ('global' or 'experience')
142
+ */
143
+ scope: StorageScope;
144
+ }
145
+ /**
146
+ * Creates a storage key with proper prefixing and encoding.
147
+ * Keys are prefixed with 'pckd' and optionally scoped to an experience instance.
148
+ *
149
+ * @param key - The raw key name (e.g., 'user-preferences')
150
+ * @param scope - The storage scope, defaults to 'global'
151
+ * @param experienceInstance - Required when scope is 'experience'
152
+ * @returns A StorageKey object with encoded identifier and scope
153
+ * @throws Error if scope is 'experience' but experienceInstance is not provided
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * // Global scope
158
+ * const globalKey = createStorageKey('theme')
159
+ * // Result: { _: 'pckd:encodedTheme', scope: 'global' }
160
+ *
161
+ * // Experience scope
162
+ * const expKey = createStorageKey('step', 'experience', experienceInstance)
163
+ * // Result: { _: 'pckd:exp123:encodedStep', scope: 'experience' }
164
+ * ```
165
+ */
166
+ export declare function createStorageKey(key: string, scope?: StorageScope, experienceInstance?: ExperienceInstance): StorageKey;
167
+ /**
168
+ * Subscribes to storage changes for a specific key in both the same tab and across browser tabs/windows.
169
+ * Uses a local subscription registry for same-tab changes and the browser's storage event for cross-tab changes.
170
+ *
171
+ * @template T - The type of the stored value
172
+ * @param key - The storage key to watch
173
+ * @param storage - The storage type ('local' or 'session')
174
+ * @param get - Function to retrieve the current StorageItem
175
+ * @param callback - Function called when storage changes, receives updated StorageItem
176
+ * @returns Unsubscribe function to stop listening to changes
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * const key = createStorageKey('theme')
181
+ * const unsubscribe = subscribe(
182
+ * key,
183
+ * 'local',
184
+ * (k) => localStore.get(k),
185
+ * (item) => console.log('Theme changed:', item.json())
186
+ * )
187
+ *
188
+ * // Later, stop listening
189
+ * unsubscribe()
190
+ * ```
191
+ */
192
+ export declare function subscribe<T = unknown>(key: StorageKey, storage: 'local' | 'session', get: (key: StorageKey) => StorageItem<T>, callback: (value: StorageItem<T>) => void): () => void;
193
+ /**
194
+ * Session storage wrapper with type-safe access and expiry support.
195
+ * Data persists only for the browser session and is cleared when the tab/window is closed.
196
+ *
197
+ * @example
198
+ * ```typescript
199
+ * // Create a key
200
+ * const key = createStorageKey('cart-items')
201
+ *
202
+ * // Get a storage item
203
+ * const cart = sessionStore.get<CartItem[]>(key)
204
+ *
205
+ * // Set value with 30-minute expiry
206
+ * sessionStore.set(key, [{ id: 1, name: 'Product' }], 30 * 60 * 1000)
207
+ *
208
+ * // Subscribe to changes
209
+ * const unsubscribe = sessionStore.subscribe(key, (item) => {
210
+ * console.log('Cart updated:', item.json())
211
+ * })
212
+ *
213
+ * // Remove value
214
+ * sessionStore.remove(key)
215
+ * ```
216
+ */
217
+ export declare const sessionStore: {
218
+ /**
219
+ * Retrieves a storage item from sessionStorage.
220
+ *
221
+ * @template T - The type of the stored value
222
+ * @param key - The storage key
223
+ * @returns A StorageItem with methods to interact with the value
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * const key = createStorageKey('user')
228
+ * const item = sessionStore.get<User>(key)
229
+ * const user = item.json() // User | null
230
+ * ```
231
+ */
232
+ get<T = unknown>(key: StorageKey): StorageItem<T>;
233
+ /**
234
+ * Sets a value in sessionStorage with optional expiry.
235
+ *
236
+ * @param key - The storage key
237
+ * @param value - The value to store
238
+ * @param expiresIn - Optional expiry time in milliseconds from now
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const key = createStorageKey('theme')
243
+ * // Set without expiry
244
+ * sessionStore.set(key, 'dark')
245
+ * // Set with 1 hour expiry
246
+ * sessionStore.set(key, 'dark', 60 * 60 * 1000)
247
+ * ```
248
+ */
249
+ set(key: StorageKey, value: unknown, expiresIn?: number): void;
250
+ /**
251
+ * Removes a value from sessionStorage, including expiry metadata.
252
+ *
253
+ * @param key - The storage key
254
+ *
255
+ * @example
256
+ * ```typescript
257
+ * const key = createStorageKey('temp-data')
258
+ * sessionStore.remove(key)
259
+ * ```
260
+ */
261
+ remove(key: StorageKey): void;
262
+ /**
263
+ * Subscribes to storage changes for a key, both in the same tab and across browser tabs/windows.
264
+ * Callbacks are invoked when changes occur via sessionStore.set() or sessionStore.remove() in the same tab,
265
+ * and also when changes are made in other tabs/windows.
266
+ *
267
+ * @template T - The type of the stored value
268
+ * @param key - The storage key to watch
269
+ * @param callback - Function called when storage changes
270
+ * @returns Unsubscribe function to stop listening
271
+ *
272
+ * @example
273
+ * ```typescript
274
+ * const key = createStorageKey('notifications')
275
+ * const unsubscribe = sessionStore.subscribe<Notification[]>(key, (item) => {
276
+ * const notifications = item.json()
277
+ * console.log('Notifications updated:', notifications)
278
+ * })
279
+ *
280
+ * // Changes in same tab trigger callback
281
+ * sessionStore.set(key, [{ id: 1, message: 'New notification' }])
282
+ *
283
+ * // Later, stop listening
284
+ * unsubscribe()
285
+ * ```
286
+ */
287
+ subscribe<T = unknown>(key: StorageKey, callback: (value: StorageItem<T>) => void): () => void;
288
+ };
289
+ /**
290
+ * Local storage wrapper with type-safe access and expiry support.
291
+ * Data persists across browser sessions until explicitly removed or expired.
292
+ *
293
+ * @example
294
+ * ```typescript
295
+ * // Create a key
296
+ * const key = createStorageKey('user-preferences')
297
+ *
298
+ * // Get a storage item
299
+ * const prefs = localStore.get<UserPrefs>(key)
300
+ *
301
+ * // Set value with 7-day expiry
302
+ * localStore.set(key, { theme: 'dark' }, 7 * 24 * 60 * 60 * 1000)
303
+ *
304
+ * // Subscribe to changes
305
+ * const unsubscribe = localStore.subscribe(key, (item) => {
306
+ * console.log('Preferences updated:', item.json())
307
+ * })
308
+ *
309
+ * // Remove value
310
+ * localStore.remove(key)
311
+ * ```
312
+ */
313
+ export declare const localStore: {
314
+ /**
315
+ * Retrieves a storage item from localStorage.
316
+ *
317
+ * @template T - The type of the stored value
318
+ * @param key - The storage key
319
+ * @returns A StorageItem with methods to interact with the value
320
+ *
321
+ * @example
322
+ * ```typescript
323
+ * const key = createStorageKey('settings')
324
+ * const item = localStore.get<Settings>(key)
325
+ * const settings = item.json() // Settings | null
326
+ * ```
327
+ */
328
+ get<T = unknown>(key: StorageKey): StorageItem<T>;
329
+ /**
330
+ * Sets a value in localStorage with optional expiry.
331
+ *
332
+ * @param key - The storage key
333
+ * @param value - The value to store
334
+ * @param expiresIn - Optional expiry time in milliseconds from now
335
+ *
336
+ * @example
337
+ * ```typescript
338
+ * const key = createStorageKey('auth-token')
339
+ * // Set without expiry
340
+ * localStore.set(key, 'token123')
341
+ * // Set with 24 hour expiry
342
+ * localStore.set(key, 'token123', 24 * 60 * 60 * 1000)
343
+ * ```
344
+ */
345
+ set(key: StorageKey, value: unknown, expiresIn?: number): void;
346
+ /**
347
+ * Removes a value from localStorage, including expiry metadata.
348
+ *
349
+ * @param key - The storage key
350
+ *
351
+ * @example
352
+ * ```typescript
353
+ * const key = createStorageKey('cached-data')
354
+ * localStore.remove(key)
355
+ * ```
356
+ */
357
+ remove(key: StorageKey): void;
358
+ /**
359
+ * Subscribes to storage changes for a key, both in the same tab and across browser tabs/windows.
360
+ * Callbacks are invoked when changes occur via localStore.set() or localStore.remove() in the same tab,
361
+ * and also when changes are made in other tabs/windows.
362
+ *
363
+ * @template T - The type of the stored value
364
+ * @param key - The storage key to watch
365
+ * @param callback - Function called when storage changes
366
+ * @returns Unsubscribe function to stop listening
367
+ *
368
+ * @example
369
+ * ```typescript
370
+ * const key = createStorageKey('user-status')
371
+ * const unsubscribe = localStore.subscribe<UserStatus>(key, (item) => {
372
+ * const status = item.json()
373
+ * console.log('User status changed:', status)
374
+ * })
375
+ *
376
+ * // Changes in same tab trigger callback
377
+ * localStore.set(key, { online: true })
378
+ *
379
+ * // Later, stop listening
380
+ * unsubscribe()
381
+ * ```
382
+ */
383
+ subscribe<T = unknown>(key: StorageKey, callback: (value: StorageItem<T>) => void): () => void;
384
+ };
385
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/utils/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAE7F;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,MAAM,OAAO,CAAA;IAEpB;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IAEzB;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;IAEpB;;;;;;;;;OASG;IACH,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;IAE7B;;;;;;;;;;;;;;OAcG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAE3C;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,IAAI,CAAA;IAElB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;CACrE;AAkBD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,YAAuB,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB,GACtC,UAAU,CAaZ;AAuFD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,EACnC,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,GAAG,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,EACxC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,cA4C1C;AA6ED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,YAAY;IACvB;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,OAAO,UAAU;IAIhC;;;;;;;;;;;;;;;OAeG;IACH,GAAG,MAAM,UAAU,SAAS,OAAO,cAAc,MAAM;IAIvD;;;;;;;;;;OAUG;IACH,MAAM,MAAM,UAAU;IAItB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SAAS,CAAC,CAAC,GAAG,OAAO,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI;CAGlF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU;IACrB;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,OAAO,UAAU;IAIhC;;;;;;;;;;;;;;;OAeG;IACH,GAAG,MAAM,UAAU,SAAS,OAAO,cAAc,MAAM;IAIvD;;;;;;;;;;OAUG;IACH,MAAM,MAAM,UAAU;IAItB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SAAS,CAAC,CAAC,GAAG,OAAO,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI;CAGlF,CAAA"}