import { Ref } from 'vue';

/**
 * @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<boolean>
 *
 * 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<boolean>` that updates
 * automatically whenever the cache mutates.
 *
 *   const isPro = useEntitlement("pro");
 *   // template: <span v-if="isPro">Pro</span>
 */
declare function useEntitlement(key: string): Ref<boolean>;
/**
 * Reactive list of active entitlement keys. Updates on every cache
 * mutation. Useful for rendering a "you have unlocked: ..." block.
 */
declare function useEntitlements(): Ref<readonly string[]>;

export { useEntitlement, useEntitlements };
