import { Ref } from 'vue'; import { a as TrustTokenStatus } from './trust-sji5vuxH.js'; /** * @cross-deck/web/vue — Vue 3 composables for the Crossdeck SDK. * * Mirrors @cross-deck/web/react in spirit: ties the entitlement cache * to Vue's reactive system so components re-render the moment the * server-side cache populates. * * import { useEntitlement } from "@cross-deck/web/vue"; * const isPro = useEntitlement("pro"); // Ref * * Why a separate subpackage: Vue is an optional peer dependency. The * core SDK has zero runtime deps; pulling Vue in unconditionally would * make non-Vue consumers pay for code they don't use. Same pattern as * `@cross-deck/web/react`. * * SSR safety: `onMounted` / `onScopeDispose` only run on the client. * The initial Ref value is the cache's current state (`false` pre-init), * so server output never claims a non-existent entitlement. */ /** * Reactive entitlement check. Returns a `Ref` that updates * automatically whenever the cache mutates. * * const isPro = useEntitlement("pro"); * // template: Pro */ declare function useEntitlement(key: string): Ref; /** * Reactive list of active entitlement keys. Updates on every cache * mutation. Useful for rendering a "you have unlocked: ..." block. */ declare function useEntitlements(): Ref; /** * Crossdeck Trust — the human-proof panel as a Vue composable. * * Bind `el` to the element the panel mounts into; read `token` / `status` * reactively. Sits on `Crossdeck.trust.panel(...)`, takes the publishable key * from `init()`, and is fail-open (can't mint → status "unavailable", signup * still proceeds, server scores the absent token). Never throws. * * @example * * */ declare function useTrustToken(opts?: { /** Explicit publishable key (cd_pub_…) — no `init()` needed. Falls back to init's key. */ publicKey?: string; }): { /** Template ref — bind to the mount element: `
`. */ el: Ref; /** The minted token, or null until it mints (or if the panel failed open). */ token: Ref; /** Lifecycle: pending → ready (minted) or unavailable (failed open). */ status: Ref; }; export { TrustTokenStatus, useEntitlement, useEntitlements, useTrustToken };