@builder.io/sdk-react-nextjs 0.7.1-3 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/lib/browser/USE_CLIENT_BUNDLE-059d1502.cjs +23 -0
  2. package/lib/{node/USE_CLIENT_BUNDLE-3263fb05.mjs → browser/USE_CLIENT_BUNDLE-b256b942.js} +142 -142
  3. package/lib/{edge/USE_SERVER_BUNDLE-046e1bfb.mjs → browser/USE_SERVER_BUNDLE-1aa7d195.js} +1 -1
  4. package/lib/browser/USE_SERVER_BUNDLE-d96aeaff.cjs +1 -0
  5. package/lib/browser/{bundle-97bfd273.mjs → bundle-0a946b39.js} +953 -928
  6. package/lib/browser/bundle-3a5994f4.cjs +76 -0
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.d.cts +1 -0
  9. package/lib/browser/index.d.mts +1 -0
  10. package/lib/browser/index.mjs +3 -3
  11. package/lib/edge/USE_CLIENT_BUNDLE-210385b8.cjs +23 -0
  12. package/lib/{browser/USE_CLIENT_BUNDLE-a0cfd96e.mjs → edge/USE_CLIENT_BUNDLE-736c38f3.js} +142 -142
  13. package/lib/{node/USE_SERVER_BUNDLE-5a2dbc47.mjs → edge/USE_SERVER_BUNDLE-14516672.js} +1 -1
  14. package/lib/edge/USE_SERVER_BUNDLE-8c86a267.cjs +1 -0
  15. package/lib/edge/{bundle-4c987206.mjs → bundle-46eb4735.js} +1237 -1211
  16. package/lib/edge/{bundle-cb675da6.js → bundle-57428492.cjs} +30 -30
  17. package/lib/edge/index.cjs +1 -1
  18. package/lib/edge/index.d.cts +1 -0
  19. package/lib/edge/index.d.mts +1 -0
  20. package/lib/edge/index.mjs +3 -3
  21. package/lib/{edge/USE_CLIENT_BUNDLE-bcf2ccc8.mjs → node/USE_CLIENT_BUNDLE-2ae32ced.js} +142 -142
  22. package/lib/node/USE_CLIENT_BUNDLE-85a396bb.cjs +23 -0
  23. package/lib/{browser/USE_SERVER_BUNDLE-4b7a745a.mjs → node/USE_SERVER_BUNDLE-cd1f2a07.js} +1 -1
  24. package/lib/node/USE_SERVER_BUNDLE-e2ad5ce3.cjs +1 -0
  25. package/lib/node/bundle-3d88f873.cjs +116 -0
  26. package/lib/node/{bundle-e3f18037.mjs → bundle-d37c53b5.js} +794 -769
  27. package/lib/node/index.cjs +1 -1
  28. package/lib/node/index.d.cts +1 -0
  29. package/lib/node/index.d.mts +1 -0
  30. package/lib/node/index.mjs +3 -3
  31. package/package.json +8 -22
  32. package/types/{blocks → cjs/blocks}/button/button.d.ts +4 -3
  33. package/types/{blocks → cjs/blocks}/columns/columns.d.ts +2 -2
  34. package/types/{blocks → cjs/blocks}/custom-code/custom-code.d.ts +2 -2
  35. package/types/cjs/blocks/embed/embed.d.ts +6 -0
  36. package/types/{blocks → cjs/blocks}/fragment/fragment.d.ts +2 -2
  37. package/types/{blocks → cjs/blocks}/image/image.d.ts +2 -2
  38. package/types/{blocks → cjs/blocks}/img/img.d.ts +4 -3
  39. package/types/{blocks → cjs/blocks}/section/section.d.ts +4 -3
  40. package/types/{blocks → cjs/blocks}/symbol/symbol.d.ts +6 -4
  41. package/types/cjs/blocks/text/text.d.ts +6 -0
  42. package/types/{blocks → cjs/blocks}/video/video.d.ts +2 -2
  43. package/types/{components → cjs/components}/block/block.d.ts +2 -2
  44. package/types/{components → cjs/components}/block/components/block-styles.d.ts +2 -2
  45. package/types/{components → cjs/components}/block/components/block-wrapper.d.ts +6 -5
  46. package/types/cjs/components/block/components/component-ref/component-ref.d.ts +4 -0
  47. package/types/{components → cjs/components}/block/components/component-ref/component-ref.helpers.d.ts +1 -1
  48. package/types/{components → cjs/components}/block/components/interactive-element.d.ts +2 -2
  49. package/types/{components → cjs/components}/block/components/repeated-block.d.ts +2 -2
  50. package/types/{components → cjs/components}/blocks/blocks-wrapper.d.ts +2 -2
  51. package/types/{components → cjs/components}/blocks/blocks.d.ts +3 -3
  52. package/types/{components → cjs/components}/content/components/enable-editor.d.ts +2 -2
  53. package/types/{components → cjs/components}/content/components/styles.d.ts +2 -2
  54. package/types/cjs/components/content/content.d.ts +4 -0
  55. package/types/{components → cjs/components}/content-variants/content-variants.d.ts +2 -2
  56. package/types/cjs/components/inlined-script.d.ts +7 -0
  57. package/types/cjs/components/inlined-styles.d.ts +7 -0
  58. package/types/cjs/constants/sdk-version.d.ts +1 -0
  59. package/types/cjs/helpers/preview-lru-cache/get.d.ts +1 -0
  60. package/types/{helpers → cjs/helpers}/preview-lru-cache/set.d.ts +1 -1
  61. package/types/{helpers → cjs/helpers}/preview-lru-cache/types.d.ts +1 -1
  62. package/types/cjs/index-helpers/blocks-exports.d.ts +19 -0
  63. package/types/{server-index.d.ts → cjs/server-index.d.ts} +2 -2
  64. package/types/esm/blocks/button/button.d.ts +12 -0
  65. package/types/esm/blocks/button/component-info.d.ts +2 -0
  66. package/types/esm/blocks/columns/columns.d.ts +17 -0
  67. package/types/esm/blocks/columns/component-info.d.ts +2 -0
  68. package/types/esm/blocks/custom-code/component-info.d.ts +2 -0
  69. package/types/esm/blocks/custom-code/custom-code.d.ts +7 -0
  70. package/types/esm/blocks/embed/component-info.d.ts +2 -0
  71. package/types/esm/blocks/embed/embed.d.ts +6 -0
  72. package/types/esm/blocks/embed/helpers.d.ts +1 -0
  73. package/types/esm/blocks/fragment/component-info.d.ts +2 -0
  74. package/types/esm/blocks/fragment/fragment.d.ts +8 -0
  75. package/types/esm/blocks/helpers.d.ts +13 -0
  76. package/types/esm/blocks/image/component-info.d.ts +2 -0
  77. package/types/esm/blocks/image/image.d.ts +22 -0
  78. package/types/esm/blocks/image/image.helpers.d.ts +1 -0
  79. package/types/esm/blocks/img/component-info.d.ts +2 -0
  80. package/types/esm/blocks/img/img.d.ts +14 -0
  81. package/types/esm/blocks/section/component-info.d.ts +2 -0
  82. package/types/esm/blocks/section/section.d.ts +12 -0
  83. package/types/esm/blocks/symbol/component-info.d.ts +2 -0
  84. package/types/esm/blocks/symbol/symbol.d.ts +26 -0
  85. package/types/esm/blocks/symbol/symbol.helpers.d.ts +14 -0
  86. package/types/esm/blocks/text/component-info.d.ts +2 -0
  87. package/types/esm/blocks/text/text.d.ts +6 -0
  88. package/types/esm/blocks/video/component-info.d.ts +2 -0
  89. package/types/esm/blocks/video/video.d.ts +20 -0
  90. package/types/esm/components/block/block.d.ts +10 -0
  91. package/types/esm/components/block/block.helpers.d.ts +13 -0
  92. package/types/esm/components/block/components/block-styles.d.ts +9 -0
  93. package/types/esm/components/block/components/block-wrapper.d.ts +18 -0
  94. package/types/esm/components/block/components/component-ref/component-ref.d.ts +4 -0
  95. package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +28 -0
  96. package/types/esm/components/block/components/interactive-element.d.ts +12 -0
  97. package/types/esm/components/block/components/repeated-block.d.ts +10 -0
  98. package/types/esm/components/block/types.d.ts +6 -0
  99. package/types/esm/components/blocks/blocks-wrapper.d.ts +11 -0
  100. package/types/esm/components/blocks/blocks.d.ts +9 -0
  101. package/types/esm/components/content/components/enable-editor.d.ts +10 -0
  102. package/types/esm/components/content/components/styles.d.ts +9 -0
  103. package/types/esm/components/content/components/styles.helpers.d.ts +15 -0
  104. package/types/esm/components/content/content.d.ts +4 -0
  105. package/types/esm/components/content/content.helpers.d.ts +7 -0
  106. package/types/esm/components/content/content.types.d.ts +24 -0
  107. package/types/esm/components/content/wrap-component-ref.d.ts +6 -0
  108. package/types/esm/components/content-variants/content-variants.d.ts +10 -0
  109. package/types/esm/components/content-variants/content-variants.types.d.ts +20 -0
  110. package/types/esm/components/content-variants/helpers.d.ts +41 -0
  111. package/types/esm/components/inlined-script.d.ts +7 -0
  112. package/types/esm/components/inlined-styles.d.ts +7 -0
  113. package/types/esm/constants/builder-registered-components.d.ts +6 -0
  114. package/types/esm/constants/device-sizes.d.ts +13 -0
  115. package/types/esm/constants/sdk-version.d.ts +1 -0
  116. package/types/esm/constants/target.d.ts +2 -0
  117. package/types/esm/context/builder.context.d.ts +3 -0
  118. package/types/esm/context/components.context.d.ts +3 -0
  119. package/types/esm/context/types.d.ts +35 -0
  120. package/types/esm/functions/camel-to-kebab-case.d.ts +1 -0
  121. package/types/esm/functions/deopt.d.ts +4 -0
  122. package/types/esm/functions/evaluate/browser-runtime/browser.d.ts +4 -0
  123. package/types/esm/functions/evaluate/browser-runtime/index.d.ts +1 -0
  124. package/types/esm/functions/evaluate/choose-eval.d.ts +6 -0
  125. package/types/esm/functions/evaluate/evaluate.d.ts +2 -0
  126. package/types/esm/functions/evaluate/helpers.d.ts +24 -0
  127. package/types/esm/functions/evaluate/index.d.ts +1 -0
  128. package/types/esm/functions/event-handler-name.d.ts +1 -0
  129. package/types/esm/functions/extract-text-styles.d.ts +4 -0
  130. package/types/esm/functions/fast-clone.d.ts +4 -0
  131. package/types/esm/functions/fetch-builder-props.d.ts +53 -0
  132. package/types/esm/functions/get-block-actions-handler.d.ts +8 -0
  133. package/types/esm/functions/get-block-actions.d.ts +10 -0
  134. package/types/esm/functions/get-block-component-options.d.ts +2 -0
  135. package/types/esm/functions/get-block-properties.d.ts +6 -0
  136. package/types/esm/functions/get-builder-search-params/index.d.ts +12 -0
  137. package/types/esm/functions/get-content/generate-content-url.d.ts +2 -0
  138. package/types/esm/functions/get-content/index.d.ts +28 -0
  139. package/types/esm/functions/get-content/types.d.ts +142 -0
  140. package/types/esm/functions/get-fetch.d.ts +1 -0
  141. package/types/esm/functions/get-global-this.d.ts +4 -0
  142. package/types/esm/functions/get-processed-block.d.ts +10 -0
  143. package/types/esm/functions/get-react-native-block-styles.d.ts +7 -0
  144. package/types/esm/functions/is-browser.d.ts +1 -0
  145. package/types/esm/functions/is-editing.d.ts +1 -0
  146. package/types/esm/functions/is-iframe.d.ts +1 -0
  147. package/types/esm/functions/is-previewing.d.ts +1 -0
  148. package/types/esm/functions/register-component.d.ts +15 -0
  149. package/types/esm/functions/register.d.ts +16 -0
  150. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
  151. package/types/esm/functions/set-editor-settings.d.ts +4 -0
  152. package/types/esm/functions/set.d.ts +7 -0
  153. package/types/esm/functions/track/helpers.d.ts +5 -0
  154. package/types/esm/functions/track/index.d.ts +51 -0
  155. package/types/esm/functions/track/interaction.d.ts +13 -0
  156. package/types/esm/functions/transform-block-properties.d.ts +1 -0
  157. package/types/esm/functions/transform-block.d.ts +2 -0
  158. package/types/esm/helpers/ab-tests.d.ts +9 -0
  159. package/types/esm/helpers/canTrack.d.ts +1 -0
  160. package/types/esm/helpers/cookie.d.ts +19 -0
  161. package/types/esm/helpers/css.d.ts +7 -0
  162. package/types/esm/helpers/flatten.d.ts +6 -0
  163. package/types/esm/helpers/localStorage.d.ts +9 -0
  164. package/types/esm/helpers/logger.d.ts +6 -0
  165. package/types/esm/helpers/nullable.d.ts +2 -0
  166. package/types/esm/helpers/preview-lru-cache/get.d.ts +1 -0
  167. package/types/esm/helpers/preview-lru-cache/helpers.d.ts +1 -0
  168. package/types/esm/helpers/preview-lru-cache/init.d.ts +6 -0
  169. package/types/esm/helpers/preview-lru-cache/set.d.ts +7 -0
  170. package/types/esm/helpers/preview-lru-cache/types.d.ts +12 -0
  171. package/types/esm/helpers/sessionId.d.ts +6 -0
  172. package/types/esm/helpers/url.d.ts +6 -0
  173. package/types/esm/helpers/uuid.d.ts +8 -0
  174. package/types/esm/helpers/visitorId.d.ts +6 -0
  175. package/types/esm/index-helpers/blocks-exports.d.ts +19 -0
  176. package/types/esm/index-helpers/top-of-file.d.ts +1 -0
  177. package/types/esm/index.d.ts +7 -0
  178. package/types/esm/scripts/init-editing.d.ts +6 -0
  179. package/types/esm/server-index.d.ts +15 -0
  180. package/types/esm/types/api-version.d.ts +2 -0
  181. package/types/esm/types/builder-block.d.ts +66 -0
  182. package/types/esm/types/builder-content.d.ts +44 -0
  183. package/types/esm/types/builder-props.d.ts +9 -0
  184. package/types/esm/types/can-track.d.ts +3 -0
  185. package/types/esm/types/components.d.ts +110 -0
  186. package/types/esm/types/deep-partial.d.ts +3 -0
  187. package/types/esm/types/element.d.ts +59 -0
  188. package/types/esm/types/enforced-partials.d.ts +21 -0
  189. package/types/esm/types/input.d.ts +121 -0
  190. package/types/esm/types/targets.d.ts +1 -0
  191. package/types/esm/types/typescript.d.ts +11 -0
  192. package/lib/browser/USE_CLIENT_BUNDLE-36991304.js +0 -23
  193. package/lib/browser/USE_SERVER_BUNDLE-2ca6fbdb.js +0 -1
  194. package/lib/browser/bundle-55af31a8.js +0 -76
  195. package/lib/edge/USE_CLIENT_BUNDLE-66349ab4.js +0 -23
  196. package/lib/edge/USE_SERVER_BUNDLE-02f64ca7.js +0 -1
  197. package/lib/node/USE_CLIENT_BUNDLE-9a315fd7.js +0 -23
  198. package/lib/node/USE_SERVER_BUNDLE-ddf14d3b.js +0 -1
  199. package/lib/node/bundle-b8de5bb9.js +0 -116
  200. package/types/blocks/embed/embed.d.ts +0 -6
  201. package/types/blocks/text/text.d.ts +0 -6
  202. package/types/components/block/components/component-ref/component-ref.d.ts +0 -4
  203. package/types/components/content/content.d.ts +0 -4
  204. package/types/components/inlined-script.d.ts +0 -7
  205. package/types/components/inlined-styles.d.ts +0 -7
  206. package/types/constants/sdk-version.d.ts +0 -1
  207. package/types/helpers/preview-lru-cache/get.d.ts +0 -1
  208. package/types/index-helpers/blocks-exports.d.ts +0 -19
  209. package/types/{blocks → cjs/blocks}/button/component-info.d.ts +0 -0
  210. package/types/{blocks → cjs/blocks}/columns/component-info.d.ts +0 -0
  211. package/types/{blocks → cjs/blocks}/custom-code/component-info.d.ts +0 -0
  212. package/types/{blocks → cjs/blocks}/embed/component-info.d.ts +0 -0
  213. package/types/{blocks → cjs/blocks}/embed/helpers.d.ts +0 -0
  214. package/types/{blocks → cjs/blocks}/fragment/component-info.d.ts +0 -0
  215. package/types/{blocks → cjs/blocks}/helpers.d.ts +0 -0
  216. package/types/{blocks → cjs/blocks}/image/component-info.d.ts +0 -0
  217. package/types/{blocks → cjs/blocks}/image/image.helpers.d.ts +0 -0
  218. package/types/{blocks → cjs/blocks}/img/component-info.d.ts +0 -0
  219. package/types/{blocks → cjs/blocks}/section/component-info.d.ts +0 -0
  220. package/types/{blocks → cjs/blocks}/symbol/component-info.d.ts +0 -0
  221. package/types/{blocks → cjs/blocks}/symbol/symbol.helpers.d.ts +0 -0
  222. package/types/{blocks → cjs/blocks}/text/component-info.d.ts +0 -0
  223. package/types/{blocks → cjs/blocks}/video/component-info.d.ts +0 -0
  224. package/types/{components → cjs/components}/block/block.helpers.d.ts +0 -0
  225. package/types/{components → cjs/components}/block/types.d.ts +0 -0
  226. package/types/{components → cjs/components}/content/components/styles.helpers.d.ts +0 -0
  227. package/types/{components → cjs/components}/content/content.helpers.d.ts +0 -0
  228. package/types/{components → cjs/components}/content/content.types.d.ts +0 -0
  229. package/types/{components → cjs/components}/content/wrap-component-ref.d.ts +0 -0
  230. package/types/{components → cjs/components}/content-variants/content-variants.types.d.ts +0 -0
  231. package/types/{components → cjs/components}/content-variants/helpers.d.ts +0 -0
  232. package/types/{constants → cjs/constants}/builder-registered-components.d.ts +0 -0
  233. package/types/{constants → cjs/constants}/device-sizes.d.ts +0 -0
  234. package/types/{constants → cjs/constants}/target.d.ts +0 -0
  235. package/types/{context → cjs/context}/builder.context.d.ts +0 -0
  236. package/types/{context → cjs/context}/components.context.d.ts +0 -0
  237. package/types/{context → cjs/context}/types.d.ts +1 -1
  238. package/types/{functions → cjs/functions}/camel-to-kebab-case.d.ts +0 -0
  239. package/types/{functions → cjs/functions}/deopt.d.ts +0 -0
  240. package/types/{functions → cjs/functions}/evaluate/browser-runtime/browser.d.ts +0 -0
  241. package/types/{functions → cjs/functions}/evaluate/browser-runtime/index.d.ts +0 -0
  242. package/types/{functions → cjs/functions}/evaluate/choose-eval.d.ts +0 -0
  243. package/types/{functions → cjs/functions}/evaluate/evaluate.d.ts +0 -0
  244. package/types/{functions → cjs/functions}/evaluate/helpers.d.ts +0 -0
  245. package/types/{functions → cjs/functions}/evaluate/index.d.ts +0 -0
  246. package/types/{functions → cjs/functions}/event-handler-name.d.ts +0 -0
  247. package/types/{functions → cjs/functions}/extract-text-styles.d.ts +0 -0
  248. package/types/{functions → cjs/functions}/fast-clone.d.ts +0 -0
  249. package/types/{functions → cjs/functions}/fetch-builder-props.d.ts +0 -0
  250. package/types/{functions → cjs/functions}/get-block-actions-handler.d.ts +0 -0
  251. package/types/{functions → cjs/functions}/get-block-actions.d.ts +0 -0
  252. package/types/{functions → cjs/functions}/get-block-component-options.d.ts +0 -0
  253. package/types/{functions → cjs/functions}/get-block-properties.d.ts +0 -0
  254. package/types/{functions → cjs/functions}/get-builder-search-params/index.d.ts +0 -0
  255. package/types/{functions → cjs/functions}/get-content/generate-content-url.d.ts +0 -0
  256. package/types/{functions → cjs/functions}/get-content/index.d.ts +0 -0
  257. package/types/{functions → cjs/functions}/get-content/types.d.ts +0 -0
  258. package/types/{functions → cjs/functions}/get-fetch.d.ts +0 -0
  259. package/types/{functions → cjs/functions}/get-global-this.d.ts +0 -0
  260. package/types/{functions → cjs/functions}/get-processed-block.d.ts +0 -0
  261. package/types/{functions → cjs/functions}/get-react-native-block-styles.d.ts +0 -0
  262. package/types/{functions → cjs/functions}/is-browser.d.ts +0 -0
  263. package/types/{functions → cjs/functions}/is-editing.d.ts +0 -0
  264. package/types/{functions → cjs/functions}/is-iframe.d.ts +0 -0
  265. package/types/{functions → cjs/functions}/is-previewing.d.ts +0 -0
  266. package/types/{functions → cjs/functions}/register-component.d.ts +0 -0
  267. package/types/{functions → cjs/functions}/register.d.ts +0 -0
  268. package/types/{functions → cjs/functions}/sanitize-react-native-block-styles.d.ts +0 -0
  269. package/types/{functions → cjs/functions}/set-editor-settings.d.ts +0 -0
  270. package/types/{functions → cjs/functions}/set.d.ts +0 -0
  271. package/types/{functions → cjs/functions}/track/helpers.d.ts +0 -0
  272. package/types/{functions → cjs/functions}/track/index.d.ts +0 -0
  273. package/types/{functions → cjs/functions}/track/interaction.d.ts +0 -0
  274. package/types/{functions → cjs/functions}/transform-block-properties.d.ts +0 -0
  275. package/types/{functions → cjs/functions}/transform-block.d.ts +0 -0
  276. package/types/{helpers → cjs/helpers}/ab-tests.d.ts +1 -1
  277. /package/types/{helpers → cjs/helpers}/canTrack.d.ts +0 -0
  278. /package/types/{helpers → cjs/helpers}/cookie.d.ts +0 -0
  279. /package/types/{helpers → cjs/helpers}/css.d.ts +0 -0
  280. /package/types/{helpers → cjs/helpers}/flatten.d.ts +0 -0
  281. /package/types/{helpers → cjs/helpers}/localStorage.d.ts +0 -0
  282. /package/types/{helpers → cjs/helpers}/logger.d.ts +0 -0
  283. /package/types/{helpers → cjs/helpers}/nullable.d.ts +0 -0
  284. /package/types/{helpers → cjs/helpers}/preview-lru-cache/helpers.d.ts +0 -0
  285. /package/types/{helpers → cjs/helpers}/preview-lru-cache/init.d.ts +0 -0
  286. /package/types/{helpers → cjs/helpers}/sessionId.d.ts +0 -0
  287. /package/types/{helpers → cjs/helpers}/url.d.ts +0 -0
  288. /package/types/{helpers → cjs/helpers}/uuid.d.ts +0 -0
  289. /package/types/{helpers → cjs/helpers}/visitorId.d.ts +0 -0
  290. /package/types/{index-helpers → cjs/index-helpers}/top-of-file.d.ts +0 -0
  291. /package/types/{index.d.ts → cjs/index.d.ts} +0 -0
  292. /package/types/{scripts → cjs/scripts}/init-editing.d.ts +0 -0
  293. /package/types/{types → cjs/types}/api-version.d.ts +0 -0
  294. /package/types/{types → cjs/types}/builder-block.d.ts +0 -0
  295. /package/types/{types → cjs/types}/builder-content.d.ts +0 -0
  296. /package/types/{types → cjs/types}/builder-props.d.ts +0 -0
  297. /package/types/{types → cjs/types}/can-track.d.ts +0 -0
  298. /package/types/{types → cjs/types}/components.d.ts +0 -0
  299. /package/types/{types → cjs/types}/deep-partial.d.ts +0 -0
  300. /package/types/{types → cjs/types}/element.d.ts +0 -0
  301. /package/types/{types → cjs/types}/enforced-partials.d.ts +0 -0
  302. /package/types/{types → cjs/types}/input.d.ts +0 -0
  303. /package/types/{types → cjs/types}/targets.d.ts +0 -0
  304. /package/types/{types → cjs/types}/typescript.d.ts +0 -0
@@ -0,0 +1,24 @@
1
+ import type { BuilderContextInterface, BuilderRenderState } from '../../context/types.js';
2
+ import { getUserAttributes } from '../track/helpers.js';
3
+ export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
4
+ event?: Event;
5
+ isExpression?: boolean;
6
+ };
7
+ export type BuilderGlobals = {
8
+ isEditing: boolean | undefined;
9
+ isBrowser: boolean | undefined;
10
+ isServer: boolean | undefined;
11
+ getUserAttributes: typeof getUserAttributes;
12
+ };
13
+ export type ExecutorArgs = Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'> & {
14
+ code: string;
15
+ builder: BuilderGlobals;
16
+ event: Event | undefined;
17
+ };
18
+ export type Executor = (args: ExecutorArgs) => any;
19
+ export type FunctionArguments = ReturnType<typeof getFunctionArguments>;
20
+ export declare const getFunctionArguments: ({ builder, context, event, state }: Pick<ExecutorArgs, "context" | "builder" | "event"> & {
21
+ state: BuilderRenderState;
22
+ }) => [string, Event | BuilderRenderState | import("../../context/types.js").BuilderRenderContext | BuilderGlobals][];
23
+ export declare const getBuilderGlobals: () => BuilderGlobals;
24
+ export declare const parseCode: (code: string, { isExpression }: Pick<EvaluatorArgs, 'isExpression'>) => string;
@@ -0,0 +1 @@
1
+ export { evaluate } from './evaluate.js';
@@ -0,0 +1 @@
1
+ export declare const getEventHandlerName: (key: string) => string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Extract styles that apply to text from a style object.
3
+ */
4
+ export declare const extractTextStyles: (styles: Partial<CSSStyleDeclaration>) => Partial<CSSStyleDeclaration>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * We need to serialize values to a string in case there are Proxy values, as is the case with SolidJS etc.
3
+ */
4
+ export declare const fastClone: <T extends object>(obj: T) => T;
@@ -0,0 +1,53 @@
1
+ import type { ContentVariantsPrps } from '../components/content-variants/content-variants.types.js';
2
+ import type { Dictionary } from '../types/typescript.js';
3
+ import type { GetContentOptions } from './get-content/types.js';
4
+ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
5
+ model?: string;
6
+ }) & ({
7
+ /**
8
+ * The current URL path. Used to determine the `urlPath` for targeting content.
9
+ *
10
+ * Cannot be used with `url`.
11
+ */
12
+ path: string;
13
+ /**
14
+ * The current URL search params. Used to parse the `searchParams` for targeting content.
15
+ *
16
+ * Cannot be used with `url`.
17
+ */
18
+ searchParams?: URLSearchParams | Dictionary<string | string[]>;
19
+ url?: undefined;
20
+ } | {
21
+ /**
22
+ * The current URL. Used to determine the `urlPath` for targeting content and
23
+ * to parse the `searchParams` for targeting content.
24
+ *
25
+ * Cannot be used with `path` or `searchParams`.
26
+ */
27
+ url: URL;
28
+ path?: undefined;
29
+ searchParams?: undefined;
30
+ } | {
31
+ url?: undefined;
32
+ path?: undefined;
33
+ searchParams?: undefined;
34
+ });
35
+ /**
36
+ * Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
37
+ *
38
+ * @example
39
+ * ```jsx
40
+ * const builderProps = await fetchBuilderProps({
41
+ * apiKey: 'API_KEY',
42
+ * // provide `url`
43
+ * url: yourPageUrl,
44
+ * // OR provide `path` + `searchParams`
45
+ * path: yourPath,
46
+ * searchParams: yourSearchParams,
47
+ * });
48
+ *
49
+ * return <Content {...builderProps} />;
50
+ * ```
51
+ */
52
+ export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
53
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ type Options = {
4
+ block: BuilderBlock;
5
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
6
+ type EventHandler = (event: Event) => any;
7
+ export declare const createEventHandler: (value: string, options: Options) => EventHandler;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ type Actions = {
4
+ [index: string]: (event: Event) => any;
5
+ };
6
+ export declare function getBlockActions(options: {
7
+ block: BuilderBlock;
8
+ stripPrefix?: boolean;
9
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): Actions;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { BuilderBlock } from '../types/builder-block.js';
2
+ export declare function getBlockComponentOptions(block: BuilderBlock): any;
@@ -0,0 +1,6 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ export declare function getBlockProperties({ block, context }: {
4
+ block: BuilderBlock;
5
+ context: BuilderContextInterface;
6
+ }): any;
@@ -0,0 +1,12 @@
1
+ type QueryObject = Record<string, string | string[]>;
2
+ export declare const convertSearchParamsToQueryObject: (searchParams: URLSearchParams) => QueryObject;
3
+ /**
4
+ * Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
5
+ * relevant to the Builder SDK.
6
+ *
7
+ * @returns
8
+ */
9
+ export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
10
+ export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
11
+ export declare const normalizeSearchParams: (searchParams: QueryObject | URLSearchParams) => QueryObject;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { GetContentOptions } from './types.js';
2
+ export declare const generateContentUrl: (options: GetContentOptions) => URL;
@@ -0,0 +1,28 @@
1
+ import type { BuilderContent } from '../../types/builder-content.js';
2
+ import type { GetContentOptions } from './types.js';
3
+ /**
4
+ * Returns a the first entry that matches the given options.
5
+ */
6
+ export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
7
+ /**
8
+ * @deprecated `getContent` was renamed to `fetchOneEntry`. This is a temporary alias to avoid breaking changes.
9
+ *
10
+ * NOTE: consider using `fetchBuilderProps` instead for easier setup.
11
+ */
12
+ export declare const getContent: typeof fetchOneEntry;
13
+ type ContentResults = {
14
+ results: BuilderContent[];
15
+ };
16
+ /**
17
+ * @internal Exported only for testing purposes. Do not use.
18
+ */
19
+ export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<ContentResults>;
20
+ /**
21
+ * Returns a paginated array of entries that match the given options.
22
+ */
23
+ export declare function fetchEntries(options: GetContentOptions): Promise<ContentResults>;
24
+ /**
25
+ * @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
26
+ */
27
+ export declare const getAllContent: typeof fetchEntries;
28
+ export {};
@@ -0,0 +1,142 @@
1
+ export interface GetContentOptions {
2
+ /** The model to get content for */
3
+ model: string;
4
+ /** Your public API key */
5
+ apiKey: string;
6
+ /** Number of items to fetch. Default is 1 */
7
+ limit?: number;
8
+ /**
9
+ * Use to specify an offset for pagination of results. The default is 0.
10
+ */
11
+ offset?: number;
12
+ /**
13
+ * User attribute key value pairs to be used for targeting
14
+ * https://www.builder.io/c/docs/custom-targeting-attributes
15
+ *
16
+ * e.g.
17
+ * ```js
18
+ * userAttributes: {
19
+ * urlPath: '/',
20
+ * returnVisitor: true,
21
+ * device: 'mobile'
22
+ * }
23
+ * ```
24
+ */
25
+ userAttributes?: (Record<string, string> & {
26
+ urlPath?: string;
27
+ }) | null;
28
+ /**
29
+ * Mongodb style query of your data. E.g.:
30
+ *
31
+ * ```js
32
+ * query: {
33
+ * id: 'abc123',
34
+ * data: {
35
+ * myCustomField: { $gt: 20 },
36
+ * }
37
+ * }
38
+ * ```
39
+ *
40
+ * See more info on MongoDB's query operators and format.
41
+ *
42
+ * @see {@link https://docs.mongodb.com/manual/reference/operator/query/}
43
+ */
44
+ query?: Record<string, any>;
45
+ /**
46
+ * Any other API options.
47
+ * Accepts both a key/value object or a `URLSearchParams` instance
48
+ * */
49
+ options?: Record<string, any> | URLSearchParams;
50
+ /**
51
+ * If set to `true`, it will lazy load symbols/references.
52
+ * If set to `false`, it will render the entire content tree eagerly.
53
+ * @deprecated use `enrich` instead
54
+ */
55
+ noTraverse?: boolean;
56
+ /**
57
+ * If set to `false`, it will not use cookies to target content. Therefore, A/B Testing will be disabled and
58
+ * only the default variation will be returned to every user.
59
+ *
60
+ * Defaults to `true`.
61
+ */
62
+ canTrack?: boolean;
63
+ /**
64
+ * Include content of references in the response. Defaults to `true`.
65
+ * @deprecated use `enrich` instead
66
+ */
67
+ includeRefs?: boolean;
68
+ /**
69
+ * Include multilevel references in the response.
70
+ */
71
+ enrich?: boolean;
72
+ /**
73
+ * If provided, the API will auto-resolve localized objects to the value of this `locale` key.
74
+ */
75
+ locale?: string;
76
+ /**
77
+ * If provided, sets the Builder API version used to fetch content.
78
+ *
79
+ * Defaults to `v3`.
80
+ */
81
+ apiVersion?: 'v2' | 'v3';
82
+ /**
83
+ * Only include these fields.
84
+ * Note: 'omit' takes precedence over 'fields'
85
+ *
86
+ * @example
87
+ * ```
88
+ * fields: 'id, name, data.customField'
89
+ * ```
90
+ */
91
+ fields?: string;
92
+ /**
93
+ * Omit only these fields.
94
+ * Note: 'omit' takes precedence over 'fields'
95
+ *
96
+ * @example
97
+ * ```
98
+ * omit: 'data.bigField,data.blocks'
99
+ * ```
100
+ */
101
+ omit?: string;
102
+ /**
103
+ * Seconds to cache content. Sets the max-age of the cache-control header
104
+ * response header.
105
+ *
106
+ * Use a higher value for better performance, lower for content that will change more frequently
107
+ *
108
+ * @see {@link https://www.builder.io/c/docs/query-api#__next:~:text=%26includeRefs%3Dtrue-,cacheSeconds,-No}
109
+ */
110
+ cacheSeconds?: number;
111
+ /**
112
+ * Builder.io uses stale-while-revalidate caching at the CDN level. This means we always serve
113
+ * from edge cache and update caches in the background for maximum possible performance. This also
114
+ * means that the more frequently content is requested, the more fresh it will be. The longest we
115
+ * will ever hold something in stale cache is 1 day by default, and you can set this to be shorter
116
+ * yourself as well. We suggest keeping this high unless you have content that must change rapidly
117
+ * and gets very little traffic.
118
+ *
119
+ * @see {@link https://www.fastly.com/blog/prevent-application-network-instability-serve-stale-content}
120
+ */
121
+ staleCacheSeconds?: number;
122
+ /**
123
+ * Property to order results by.
124
+ * Use 1 for ascending and -1 for descending.
125
+ *
126
+ * The key is what you're sorting on, so the following example sorts by createdDate
127
+ * and because the value is 1, the sort is ascending.
128
+ *
129
+ * @example
130
+ * ```
131
+ * createdDate: 1
132
+ * ```
133
+ */
134
+ sort?: {
135
+ [key: string]: 1 | -1;
136
+ };
137
+ /**
138
+ * Include content entries in a response that are still in
139
+ * draft mode and un-archived. Default is false.
140
+ */
141
+ includeUnpublished?: boolean;
142
+ }
@@ -0,0 +1 @@
1
+ export declare const fetch: typeof globalThis.fetch;
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ type Global = typeof global | typeof window | typeof self | typeof globalThis;
3
+ export declare function getGlobalThis(): Global;
4
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ export declare function getProcessedBlock({ block, context, shouldEvaluateBindings, localState, rootState, rootSetState }: {
4
+ block: BuilderBlock;
5
+ /**
6
+ * In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
7
+ * also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
8
+ */
9
+ shouldEvaluateBindings: boolean;
10
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
@@ -0,0 +1,7 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
2
+ import type { BuilderBlock } from '../types/builder-block.js';
3
+ export declare function getReactNativeBlockStyles({ block, context, blockStyles }: {
4
+ block: BuilderBlock;
5
+ context: BuilderContextInterface;
6
+ blockStyles: any;
7
+ }): CSSStyleDeclaration | Record<string, string | undefined>;
@@ -0,0 +1 @@
1
+ export declare function isBrowser(): boolean;
@@ -0,0 +1 @@
1
+ export declare function isEditing(): boolean;
@@ -0,0 +1 @@
1
+ export declare function isIframe(): boolean;
@@ -0,0 +1 @@
1
+ export declare function isPreviewing(): boolean;
@@ -0,0 +1,15 @@
1
+ import type { RegisteredComponent } from '../context/types.js';
2
+ import type { ComponentInfo } from '../types/components.js';
3
+ /**
4
+ * @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
5
+ */
6
+ export declare const components: RegisteredComponent[];
7
+ /**
8
+ * @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
9
+ */
10
+ export declare function registerComponent(component: any, info: ComponentInfo): void;
11
+ export declare const createRegisterComponentMessage: (info: ComponentInfo) => {
12
+ type: string;
13
+ data: ComponentInfo;
14
+ };
15
+ export declare const serializeComponentInfo: ({ inputs, ...info }: ComponentInfo) => ComponentInfo;
@@ -0,0 +1,16 @@
1
+ import type { BuilderBlock } from '../types/builder-block.js';
2
+ import type { DeepPartial } from '../types/deep-partial.js';
3
+ export interface InsertMenuItem {
4
+ name: string;
5
+ icon?: string;
6
+ item: DeepPartial<BuilderBlock>;
7
+ }
8
+ export interface InsertMenuConfig {
9
+ name: string;
10
+ priority?: number;
11
+ persist?: boolean;
12
+ advanced?: boolean;
13
+ items: InsertMenuItem[];
14
+ }
15
+ export declare function register(type: 'insertMenu', info: InsertMenuConfig): void;
16
+ export declare function register(type: string, info: any): void;
@@ -0,0 +1,3 @@
1
+ type Styles = Record<string, string | number>;
2
+ export declare const sanitizeReactNativeBlockStyles: (styles: Styles) => Styles;
3
+ export {};
@@ -0,0 +1,4 @@
1
+ export type Settings = {
2
+ customInsertMenu?: boolean;
3
+ };
4
+ export declare function setEditorSettings(newSettings: Settings): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Minimal implementation of lodash's _.set
3
+ * https://lodash.com/docs/4.17.15#set
4
+ *
5
+ * See ./set.test.ts for usage examples
6
+ */
7
+ export declare const set: (obj: any, _path: string | string[], value: any) => any;
@@ -0,0 +1,5 @@
1
+ export declare const getUserAttributes: () => {
2
+ urlPath: string;
3
+ host: string;
4
+ device: string;
5
+ };
@@ -0,0 +1,51 @@
1
+ import type { CanTrack } from '../../types/can-track.js';
2
+ import type { Dictionary } from '../../types/typescript.js';
3
+ interface Event {
4
+ /**
5
+ * The type of your event.
6
+ *
7
+ * Examples: `click`, `conversion`, `pageview`, `impression`
8
+ */
9
+ type: string;
10
+ data: {
11
+ /**
12
+ * (Optional) The content's ID. Useful if this event pertains to a specific piece of content.
13
+ */
14
+ contentId?: string;
15
+ /**
16
+ * This is the ID of the space that the content belongs to.
17
+ */
18
+ ownerId: string;
19
+ /**
20
+ * (Optional) metadata that you want to provide with your event.
21
+ */
22
+ metadata?: Dictionary<any>;
23
+ /**
24
+ * Session ID of the user. This is provided by the SDK by checking session storage.
25
+ */
26
+ sessionId: string | undefined;
27
+ /**
28
+ * Visitor ID of the user. This is provided by the SDK by checking cookies.
29
+ */
30
+ visitorId: string | undefined;
31
+ /**
32
+ * (Optional) If running an A/B test, the ID of the variation that the user is in.
33
+ */
34
+ variationId?: string;
35
+ [index: string]: any;
36
+ };
37
+ }
38
+ type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId' | 'metadata'> & {
39
+ /**
40
+ * Your organization's API key.
41
+ */
42
+ apiKey: Event['data']['ownerId'];
43
+ /**
44
+ * (Optional) Any additional (non-metadata) properties to add to the event.
45
+ */
46
+ [index: string]: any;
47
+ };
48
+ export type EventProps = EventProperties & CanTrack;
49
+ export declare function _track(eventProps: EventProps): Promise<void | Response>;
50
+ export declare const track: (args: EventProperties) => Promise<void | Response>;
51
+ export {};
@@ -0,0 +1,13 @@
1
+ type Offset = {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ export declare const getInteractionPropertiesForEvent: (event: MouseEvent) => {
6
+ targetBuilderElement: string;
7
+ metadata: {
8
+ targetOffset: Offset;
9
+ builderTargetOffset: Offset;
10
+ builderElementIndex: any;
11
+ };
12
+ };
13
+ export {};
@@ -0,0 +1 @@
1
+ export declare function transformBlockProperties(properties: any): any;
@@ -0,0 +1,2 @@
1
+ import type { BuilderBlock } from '../types/builder-block.js';
2
+ export declare function transformBlock(block: BuilderBlock): BuilderBlock;
@@ -0,0 +1,9 @@
1
+ import type { BuilderContent } from '../types/builder-content.js';
2
+ import type { CanTrack } from '../types/can-track.js';
3
+ import type { Nullable } from '../types/typescript.js';
4
+ export declare const handleABTestingSync: ({ item, canTrack }: {
5
+ item: Nullable<BuilderContent>;
6
+ } & CanTrack) => Nullable<BuilderContent>;
7
+ export declare const handleABTesting: ({ item, canTrack }: {
8
+ item: BuilderContent;
9
+ } & CanTrack) => Promise<BuilderContent>;
@@ -0,0 +1 @@
1
+ export declare const getDefaultCanTrack: (canTrack?: boolean) => boolean;
@@ -0,0 +1,19 @@
1
+ import type { CanTrack } from '../types/can-track.js';
2
+ type GetCookieArgs = {
3
+ name: string;
4
+ } & CanTrack;
5
+ export declare const getCookieSync: ({ name, canTrack }: GetCookieArgs) => string | undefined;
6
+ /**
7
+ * NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
8
+ * The sync version is only safe to use in code blocks that `react-native` is guaranteed not to not run.
9
+ */
10
+ export declare const getCookie: (args: GetCookieArgs) => Promise<string>;
11
+ /**
12
+ * NOTE: This function is `async` because its react-native override is async. Do not remove the `async` keyword!
13
+ */
14
+ export declare const setCookie: ({ name, value, expires, canTrack }: {
15
+ name: string;
16
+ value: string;
17
+ expires?: Date;
18
+ } & CanTrack) => Promise<void>;
19
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const convertStyleMapToCSSArray: (style: Partial<CSSStyleDeclaration>) => string[];
2
+ export declare const convertStyleMapToCSS: (style: Partial<CSSStyleDeclaration>) => string;
3
+ export declare const createCssClass: ({ mediaQuery, className, styles }: {
4
+ mediaQuery?: string;
5
+ className: string;
6
+ styles: Partial<CSSStyleDeclaration>;
7
+ }) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert deep object to a flat object with dots
3
+ *
4
+ * { foo: { bar: 'baz' }} -> { 'foo.bar': 'baz' }
5
+ */
6
+ export declare function flatten<T extends Record<string, any>>(object: T, path?: string | null, separator?: string): T;
@@ -0,0 +1,9 @@
1
+ import type { CanTrack } from '../types/can-track.js';
2
+ import type { Nullable } from './nullable.js';
3
+ export declare const getLocalStorageItem: ({ key, canTrack }: {
4
+ key: string;
5
+ } & CanTrack) => Nullable<string>;
6
+ export declare const setLocalStorageItem: ({ key, canTrack, value }: {
7
+ key: string;
8
+ value: string;
9
+ } & CanTrack) => void;
@@ -0,0 +1,6 @@
1
+ export declare const logger: {
2
+ log: (...message: any[]) => void;
3
+ error: (...message: any[]) => void;
4
+ warn: (...message: any[]) => void;
5
+ debug: (...message: any[]) => void;
6
+ };
@@ -0,0 +1,2 @@
1
+ export type Nullable<T> = T | null | undefined;
2
+ export declare const checkIsDefined: <T>(maybeT: T) => maybeT is T;
@@ -0,0 +1 @@
1
+ export declare function getPreviewContent(searchParams: URLSearchParams): import("../../types/builder-content.js").BuilderContent;
@@ -0,0 +1 @@
1
+ export declare const getIdFromSearchParams: (searchParams: URLSearchParams) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This is an LRU cache to hold preview content on the server-side.
3
+ *
4
+ * Note: This logic is only used by the NextJS SDK.
5
+ */
6
+ export declare function init(): void;
@@ -0,0 +1,7 @@
1
+ import type { BuilderContent } from '../../types/builder-content.js';
2
+ export declare function postPreviewContent({ key, value, }: {
3
+ key: string;
4
+ value: BuilderContent;
5
+ }): Promise<{
6
+ [x: string]: BuilderContent;
7
+ }>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This is an LRU cache to hold preview content on the server-side.
3
+ *
4
+ * Note: This logic is only used by the NextJS SDK.
5
+ */
6
+ import type { LRUCache } from 'lru-cache';
7
+ import type { BuilderContent } from '../../types/builder-content.js';
8
+ type BuilderLRUCache = LRUCache<string, BuilderContent>;
9
+ export type GlobalWCache = typeof globalThis & {
10
+ _BUILDER_PREVIEW_LRU_CACHE: BuilderLRUCache;
11
+ };
12
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { CanTrack } from '../types/can-track.js';
2
+ export declare const getSessionId: ({ canTrack }: CanTrack) => Promise<string | undefined>;
3
+ export declare const createSessionId: () => string;
4
+ export declare const setSessionId: ({ id, canTrack }: {
5
+ id: string;
6
+ } & CanTrack) => Promise<void>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Only gets one level up from hostname
3
+ * wwww.example.com -> example.com
4
+ * www.example.co.uk -> example.co.uk
5
+ */
6
+ export declare const getTopLevelDomain: (host: string) => string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @credit https://stackoverflow.com/a/2117523
3
+ */
4
+ export declare function uuidv4(): string;
5
+ /**
6
+ * Slightly cleaner and smaller UUIDs
7
+ */
8
+ export declare function uuid(): string;
@@ -0,0 +1,6 @@
1
+ import type { CanTrack } from '../types/can-track.js';
2
+ export declare const getVisitorId: ({ canTrack }: CanTrack) => string | undefined;
3
+ export declare const createVisitorId: () => string;
4
+ export declare const setVisitorId: ({ id, canTrack }: {
5
+ id: string;
6
+ } & CanTrack) => void;