@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.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.
- package/README.md +8 -0
- package/dist/cjs/index.js +1 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +732 -1814
- package/dist/esm/plugins/create-experience/index.js +398 -490
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
- package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
- package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
- package/dist/esm/plugins/shopify/index.js +59 -0
- package/dist/esm/plugins/single-page-app/index.js +35 -31
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +89 -141
- package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
- package/dist/experience-instance-BA0EXYg5.js +712 -0
- package/dist/id-BKIWbSTy.cjs +1 -0
- package/dist/id-BW-g3y32.js +6 -0
- package/dist/logger-BsmHUUw1.cjs +1 -0
- package/dist/logger-C9a75KZn.js +5 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/object-JwZ58NOH.js +28 -0
- package/dist/storage-BPJwmlva.cjs +1 -0
- package/dist/storage-D87xFySf.js +85 -0
- package/dist/supports-BvrzQAVk.js +79 -0
- package/dist/supports-C0y3-V5V.cjs +1 -0
- package/dist/types/client.d.ts +23 -119
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -45
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +99 -160
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +8 -118
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +64 -96
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +7 -32
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +2 -41
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +7 -30
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +21 -57
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -22
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +11 -13
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +184 -381
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +10 -0
- package/dist/types/ping.d.ts.map +1 -0
- package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +2 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/shopify.d.ts +28 -0
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/server/index.d.ts +3 -18
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +6 -4
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +38 -83
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +2 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +1 -2
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -3
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +3 -33
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +16 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/storage.d.ts +11 -374
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +0 -87
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +49 -182
- package/dist/.tsbuildinfo +0 -1
- package/dist/api-C7q_7vxn.js +0 -22
- package/dist/api-Ctvh1qkk.cjs +0 -1
- package/dist/cjs/form/index.js +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
- package/dist/cjs/plugins/telemetry/index.js +0 -1
- package/dist/cjs/plugins/web-components/index.js +0 -1
- package/dist/cjs/preview/index.js +0 -1
- package/dist/docs/_root.css +0 -101
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
- package/dist/docs/explanation/content-references.md +0 -99
- package/dist/docs/explanation/feature-flag-allocation.md +0 -218
- package/dist/docs/explanation/how-picked-works.md +0 -124
- package/dist/docs/explanation/how-pickedql-works.md +0 -76
- package/dist/docs/explanation/pages-and-flows.md +0 -64
- package/dist/docs/explanation/the-content-model.md +0 -87
- package/dist/docs/explanation/the-two-apis.md +0 -68
- package/dist/docs/explanation/why-server-side-rendering.md +0 -76
- package/dist/docs/explanation/workspaces-and-versions.md +0 -71
- package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
- package/dist/docs/how-to/analytics/index.md +0 -316
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
- package/dist/docs/how-to/authenticate-the-cli.md +0 -97
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
- package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
- package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
- package/dist/docs/how-to/build-a-flow.md +0 -83
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
- package/dist/docs/how-to/create-a-content-entry.md +0 -48
- package/dist/docs/how-to/create-a-project.md +0 -29
- package/dist/docs/how-to/create-an-experience.md +0 -42
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
- package/dist/docs/how-to/define-a-page-layout.md +0 -46
- package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
- package/dist/docs/how-to/install-the-gtm-template.md +0 -84
- package/dist/docs/how-to/install-the-sdk.md +0 -93
- package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
- package/dist/docs/how-to/invite-and-remove-members.md +0 -35
- package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
- package/dist/docs/how-to/preview-a-workspace.md +0 -28
- package/dist/docs/how-to/publish-a-workspace.md +0 -30
- package/dist/docs/how-to/read-a-feature-flag.md +0 -113
- package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
- package/dist/docs/how-to/register-a-component.md +0 -55
- package/dist/docs/how-to/register-an-action-handler.md +0 -67
- package/dist/docs/how-to/render-a-step-form.md +0 -131
- package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
- package/dist/docs/how-to/reuse-a-section.md +0 -53
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
- package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
- package/dist/docs/how-to/run-an-ab-test.md +0 -49
- package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
- package/dist/docs/how-to/server-render-a-page.md +0 -81
- package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
- package/dist/docs/how-to/set-up-mfa.md +0 -69
- package/dist/docs/how-to/switch-workspaces.md +0 -122
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
- package/dist/docs/how-to/validate-a-field.md +0 -52
- package/dist/docs/how-to/write-a-condition.md +0 -45
- package/dist/docs/how-to/write-a-predicate.md +0 -60
- package/dist/docs/index.md +0 -59
- package/dist/docs/reference/dashboard/actions.mdx +0 -53
- package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
- package/dist/docs/reference/dashboard/conditions.mdx +0 -42
- package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
- package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
- package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
- package/dist/docs/reference/dashboard/content/models.mdx +0 -108
- package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
- package/dist/docs/reference/dashboard/experiences.mdx +0 -51
- package/dist/docs/reference/dashboard/features.mdx +0 -154
- package/dist/docs/reference/dashboard/fields.mdx +0 -106
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
- package/dist/docs/reference/dashboard/projects.mdx +0 -44
- package/dist/docs/reference/dashboard/reports.mdx +0 -43
- package/dist/docs/reference/dashboard/steps.mdx +0 -37
- package/dist/docs/reference/dashboard/team-management.md +0 -29
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
- package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
- package/dist/docs/reference/delivery-api/experience-content.md +0 -152
- package/dist/docs/reference/delivery-api/index.md +0 -45
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
- package/dist/docs/reference/delivery-api/project-config.md +0 -65
- package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
- package/dist/docs/reference/glossary.md +0 -181
- package/dist/docs/reference/management-api/authentication.md +0 -74
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
- package/dist/docs/reference/management-api/error-handling.md +0 -233
- package/dist/docs/reference/management-api/pagination.md +0 -192
- package/dist/docs/reference/pickedql/data-sources.md +0 -174
- package/dist/docs/reference/pickedql/dimensions.md +0 -103
- package/dist/docs/reference/pickedql/filtering.md +0 -64
- package/dist/docs/reference/pickedql/index.md +0 -18
- package/dist/docs/reference/pickedql/schema.md +0 -172
- package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
- package/dist/docs/reference/sdk/actions.md +0 -30
- package/dist/docs/reference/sdk/analytics-events.md +0 -445
- package/dist/docs/reference/sdk/conditions.md +0 -147
- package/dist/docs/reference/sdk/content-security-policy.md +0 -21
- package/dist/docs/reference/sdk/content.md +0 -213
- package/dist/docs/reference/sdk/experiences.md +0 -51
- package/dist/docs/reference/sdk/features.md +0 -256
- package/dist/docs/reference/sdk/fields.md +0 -255
- package/dist/docs/reference/sdk/index.md +0 -68
- package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
- package/dist/docs/reference/sdk/plugins/index.md +0 -29
- package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
- package/dist/docs/reference/sdk/predicates.md +0 -43
- package/dist/docs/reference/sdk/ssr/index.md +0 -33
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
- package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -196
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -146
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -90
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -228
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
- package/dist/docs/tutorials/first-experience.mdx +0 -254
- package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
- package/dist/dom-BqcToNL0.js +0 -82
- package/dist/dom-DlLH3FxV.cjs +0 -1
- package/dist/emit-D-tLiWL1.cjs +0 -1
- package/dist/emit-Ds2EG7CB.js +0 -14
- package/dist/esm/form/index.js +0 -565
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
- package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
- package/dist/esm/plugins/history-browser-storage/index.js +0 -26
- package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
- package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
- package/dist/esm/plugins/telemetry/index.js +0 -100
- package/dist/esm/plugins/web-components/index.js +0 -19
- package/dist/esm/preview/index.js +0 -2
- package/dist/experience-instance-B9S6Yf0N.js +0 -711
- package/dist/experience-instance-D8rOg6We.cjs +0 -1
- package/dist/id-Bo4RBeOs.js +0 -4
- package/dist/id-Js-62re-.cjs +0 -1
- package/dist/inert-script-report-B_bMPRzp.js +0 -18
- package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
- package/dist/logger-CSTvAyyB.cjs +0 -1
- package/dist/logger-DMN6TxJJ.js +0 -4
- package/dist/object-BUDGxEqy.js +0 -25
- package/dist/object-CIkt7Fkr.cjs +0 -1
- package/dist/plugin-ChafFq6S.js +0 -194
- package/dist/plugin-Dn25Gffy.cjs +0 -1
- package/dist/preview-channel-CSr96XAo.js +0 -98
- package/dist/preview-channel-Cx0e6fye.cjs +0 -1
- package/dist/protocol-Bb_vpLKE.cjs +0 -1
- package/dist/protocol-C5KkkiZc.js +0 -84
- package/dist/provider-B8wvmeC8.js +0 -98
- package/dist/provider-BBLlQOjV.cjs +0 -1
- package/dist/registry-C1t8l3t9.cjs +0 -1
- package/dist/registry-CXZv0uLg.js +0 -18
- package/dist/rules-logic-CGZIYgAI.cjs +0 -1
- package/dist/rules-logic-HesIUCu6.js +0 -13
- package/dist/storage-1MW3-_As.js +0 -103
- package/dist/storage-DUw9UJ2h.cjs +0 -1
- package/dist/supports-CO9bJGNl.js +0 -92
- package/dist/supports-DBzjGaWD.cjs +0 -1
- package/dist/types/data-source/api.d.ts +0 -60
- package/dist/types/data-source/api.d.ts.map +0 -1
- package/dist/types/data-source/provider.d.ts +0 -103
- package/dist/types/data-source/provider.d.ts.map +0 -1
- package/dist/types/data-source/registry.d.ts +0 -26
- package/dist/types/data-source/registry.d.ts.map +0 -1
- package/dist/types/data-source/request-observer.d.ts +0 -62
- package/dist/types/data-source/request-observer.d.ts.map +0 -1
- package/dist/types/data-source/virtual-data.d.ts +0 -19
- package/dist/types/data-source/virtual-data.d.ts.map +0 -1
- package/dist/types/entities/action/action.d.ts +0 -85
- package/dist/types/entities/action/action.d.ts.map +0 -1
- package/dist/types/entities/component/lazyComponent.d.ts +0 -11
- package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -29
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/content/content.d.ts +0 -53
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
- package/dist/types/entities/field/policies.d.ts +0 -35
- package/dist/types/entities/field/policies.d.ts.map +0 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -75
- package/dist/types/entities/response/response-validation.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -46
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -56
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/form/build-responses.d.ts +0 -18
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -28
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -60
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -153
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -116
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -19
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -11
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/lifecycle/condition-selection.d.ts +0 -146
- package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -48
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -25
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/emit.d.ts +0 -18
- package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/index.d.ts +0 -4
- package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
- package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
- package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
- package/dist/types/plugins/web-components/index.d.ts +0 -2
- package/dist/types/plugins/web-components/index.d.ts.map +0 -1
- package/dist/types/plugins/web-components/plugin.d.ts +0 -4
- package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
- package/dist/types/preview/index.d.ts +0 -18
- package/dist/types/preview/index.d.ts.map +0 -1
- package/dist/types/preview-bridge/index.d.ts +0 -14
- package/dist/types/preview-bridge/index.d.ts.map +0 -1
- package/dist/types/preview-channel.d.ts +0 -16
- package/dist/types/preview-channel.d.ts.map +0 -1
- package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
- package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
- package/dist/types/preview-receiver/index.d.ts +0 -32
- package/dist/types/preview-receiver/index.d.ts.map +0 -1
- package/dist/types/preview-receiver/protocol.d.ts +0 -69
- package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
- package/dist/types/schema-registry.d.ts +0 -206
- package/dist/types/schema-registry.d.ts.map +0 -1
- package/dist/types/server/serialize.d.ts +0 -87
- package/dist/types/server/serialize.d.ts.map +0 -1
- package/dist/types/typed-content.d.ts +0 -17
- package/dist/types/typed-content.d.ts.map +0 -1
- package/dist/types/utils/client-telemetry.d.ts +0 -25
- package/dist/types/utils/client-telemetry.d.ts.map +0 -1
- package/dist/types/utils/content-path.d.ts +0 -37
- package/dist/types/utils/content-path.d.ts.map +0 -1
- package/dist/types/utils/html-asset-value.d.ts +0 -20
- package/dist/types/utils/html-asset-value.d.ts.map +0 -1
- package/dist/types/utils/inert-script-report.d.ts +0 -40
- package/dist/types/utils/inert-script-report.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
- package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
- package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
- package/dist/types/utils/picked-config.d.ts +0 -39
- package/dist/types/utils/picked-config.d.ts.map +0 -1
- package/dist/types/utils/preview-session.d.ts +0 -12
- package/dist/types/utils/preview-session.d.ts.map +0 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
- package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
- package/dist/types/utils/render-string.d.ts +0 -24
- package/dist/types/utils/render-string.d.ts.map +0 -1
- package/dist/types/utils/user-timing.d.ts +0 -21
- package/dist/types/utils/user-timing.d.ts.map +0 -1
- package/dist/version-CLjPfmxk.cjs +0 -1
- package/dist/version-CPKulHMH.js +0 -256
- /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
|
@@ -1,385 +1,22 @@
|
|
|
1
|
-
import
|
|
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
|
-
*/
|
|
1
|
+
import { ExperienceInstance } from '../entities/experience-instance/experience-instance';
|
|
7
2
|
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
3
|
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
4
|
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
5
|
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
6
|
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
7
|
}
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
*/
|
|
8
|
+
export declare function createStorageKey(key: string, scope?: StorageScope, experienceInstance?: ExperienceInstance): string;
|
|
9
|
+
export declare function subscribe<T = unknown>(key: string, storage: 'local' | 'session', get: (key: string) => StorageItem<T>, callback: (value: StorageItem<T>) => void): () => void;
|
|
217
10
|
export declare const sessionStore: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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;
|
|
11
|
+
get<T = unknown>(key: string): StorageItem<T>;
|
|
12
|
+
set(key: string, value: unknown, expiresIn?: number): void;
|
|
13
|
+
remove(key: string): void;
|
|
14
|
+
subscribe<T = unknown>(key: string, callback: (value: StorageItem<T>) => void): () => void;
|
|
288
15
|
};
|
|
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
16
|
export declare const localStore: {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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;
|
|
17
|
+
get<T = unknown>(key: string): StorageItem<T>;
|
|
18
|
+
set(key: string, value: unknown, expiresIn?: number): void;
|
|
19
|
+
remove(key: string): void;
|
|
20
|
+
subscribe<T = unknown>(key: string, callback: (value: StorageItem<T>) => void): () => void;
|
|
384
21
|
};
|
|
385
22
|
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +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
|
|
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,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAA;AAGlD,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,CAAA;IACzB,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,YAAuB,EAC9B,kBAAkB,CAAC,EAAE,kBAAkB,UAaxC;AAqDD,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,EACnC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,EACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,cAc1C;AAED,eAAO,MAAM,YAAY;QACnB,CAAC,iBAAiB,MAAM;aAGnB,MAAM,SAAS,OAAO,cAAc,MAAM;gBAGvC,MAAM;cAGR,CAAC,iBAAiB,MAAM,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI;CAG9E,CAAA;AAED,eAAO,MAAM,UAAU;QACjB,CAAC,iBAAiB,MAAM;aAGnB,MAAM,SAAS,OAAO,cAAc,MAAM;gBAGvC,MAAM;cAGR,CAAC,iBAAiB,MAAM,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI;CAG9E,CAAA"}
|
|
@@ -1,97 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines whether the global `location` object is available.
|
|
3
|
-
*
|
|
4
|
-
* @returns {boolean} True when `location` is available.
|
|
5
|
-
* @example
|
|
6
|
-
* supportsLocation()
|
|
7
|
-
*/
|
|
8
1
|
export declare function supportsLocation(): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Determines whether the global `history` object is available.
|
|
11
|
-
*
|
|
12
|
-
* @returns {boolean} True when `history` is available.
|
|
13
|
-
* @example
|
|
14
|
-
* supportsHistory()
|
|
15
|
-
*/
|
|
16
2
|
export declare function supportsHistory(): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Determines whether `localStorage` is available.
|
|
19
|
-
*
|
|
20
|
-
* @returns {boolean} True when `localStorage` is available.
|
|
21
|
-
* @example
|
|
22
|
-
* supportsLocalStorage()
|
|
23
|
-
*/
|
|
24
3
|
export declare function supportsLocalStorage(): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Determines whether `sessionStorage` is available.
|
|
27
|
-
*
|
|
28
|
-
* @returns {boolean} True when `sessionStorage` is available.
|
|
29
|
-
* @example
|
|
30
|
-
* supportsSessionStorage()
|
|
31
|
-
*/
|
|
32
4
|
export declare function supportsSessionStorage(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Determines whether `document.cookie` is available.
|
|
35
|
-
*
|
|
36
|
-
* @returns {boolean} True when cookies are available.
|
|
37
|
-
* @example
|
|
38
|
-
* supportsCookies()
|
|
39
|
-
*/
|
|
40
5
|
export declare function supportsCookies(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Determines whether Shadow DOM (`attachShadow`) is available.
|
|
43
|
-
*
|
|
44
|
-
* @returns {boolean} True when Shadow DOM is available.
|
|
45
|
-
* @example
|
|
46
|
-
* supportsShadowRoot()
|
|
47
|
-
*/
|
|
48
6
|
export declare function supportsShadowRoot(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Determines whether the global `window` object is available.
|
|
51
|
-
*
|
|
52
|
-
* @returns {boolean} True when `window` is available.
|
|
53
|
-
* @example
|
|
54
|
-
* supportsWindow()
|
|
55
|
-
*/
|
|
56
7
|
export declare function supportsWindow(): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Determines whether the current context runs inside an iframe (its top window differs from itself).
|
|
59
|
-
*
|
|
60
|
-
* @returns {boolean} True when embedded in an iframe.
|
|
61
|
-
* @example
|
|
62
|
-
* isInsideIframe()
|
|
63
|
-
*/
|
|
64
|
-
export declare function isInsideIframe(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Determines whether the global `document` object is available.
|
|
67
|
-
*
|
|
68
|
-
* @returns {boolean} True when `document` is available.
|
|
69
|
-
* @example
|
|
70
|
-
* supportsDocument()
|
|
71
|
-
*/
|
|
72
8
|
export declare function supportsDocument(): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Determines whether `IntersectionObserver` is available.
|
|
75
|
-
*
|
|
76
|
-
* @returns {boolean} True when `IntersectionObserver` is available.
|
|
77
|
-
* @example
|
|
78
|
-
* supportsIntersectionObserver()
|
|
79
|
-
*/
|
|
80
9
|
export declare function supportsIntersectionObserver(): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Determines whether Custom Elements (`customElements`) are available.
|
|
83
|
-
*
|
|
84
|
-
* @returns {boolean} True when Custom Elements are available.
|
|
85
|
-
* @example
|
|
86
|
-
* supportsWebComponents()
|
|
87
|
-
*/
|
|
88
|
-
export declare function supportsWebComponents(): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Determines whether `crypto.randomUUID` is available.
|
|
91
|
-
*
|
|
92
|
-
* @returns {boolean} True when `crypto.randomUUID` is available.
|
|
93
|
-
* @example
|
|
94
|
-
* supportsCryptoRandomUUID()
|
|
95
|
-
*/
|
|
96
|
-
export declare function supportsCryptoRandomUUID(): boolean;
|
|
97
10
|
//# sourceMappingURL=supports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supports.d.ts","sourceRoot":"","sources":["../../../src/utils/supports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"supports.d.ts","sourceRoot":"","sources":["../../../src/utils/supports.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,IAAI,OAAO,CAM1C;AAED,wBAAgB,eAAe,IAAI,OAAO,CAMzC;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAM9C;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAMhD;AAED,wBAAgB,eAAe,IAAI,OAAO,CAMzC;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAU5C;AAED,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAM1C;AAED,wBAAgB,4BAA4B,IAAI,OAAO,CAMtD"}
|