@cross-deck/web 0.7.0 → 1.0.0

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/dist/vue.d.mts ADDED
@@ -0,0 +1,37 @@
1
+ import { Ref } from 'vue';
2
+
3
+ /**
4
+ * @cross-deck/web/vue — Vue 3 composables for the Crossdeck SDK.
5
+ *
6
+ * Mirrors @cross-deck/web/react in spirit: ties the entitlement cache
7
+ * to Vue's reactive system so components re-render the moment the
8
+ * server-side cache populates.
9
+ *
10
+ * import { useEntitlement } from "@cross-deck/web/vue";
11
+ * const isPro = useEntitlement("pro"); // Ref<boolean>
12
+ *
13
+ * Why a separate subpackage: Vue is an optional peer dependency. The
14
+ * core SDK has zero runtime deps; pulling Vue in unconditionally would
15
+ * make non-Vue consumers pay for code they don't use. Same pattern as
16
+ * `@cross-deck/web/react`.
17
+ *
18
+ * SSR safety: `onMounted` / `onScopeDispose` only run on the client.
19
+ * The initial Ref value is the cache's current state (`false` pre-init),
20
+ * so server output never claims a non-existent entitlement.
21
+ */
22
+
23
+ /**
24
+ * Reactive entitlement check. Returns a `Ref<boolean>` that updates
25
+ * automatically whenever the cache mutates.
26
+ *
27
+ * const isPro = useEntitlement("pro");
28
+ * // template: <span v-if="isPro">Pro</span>
29
+ */
30
+ declare function useEntitlement(key: string): Ref<boolean>;
31
+ /**
32
+ * Reactive list of active entitlement keys. Updates on every cache
33
+ * mutation. Useful for rendering a "you have unlocked: ..." block.
34
+ */
35
+ declare function useEntitlements(): Ref<readonly string[]>;
36
+
37
+ export { useEntitlement, useEntitlements };
package/dist/vue.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { Ref } from 'vue';
2
+
3
+ /**
4
+ * @cross-deck/web/vue — Vue 3 composables for the Crossdeck SDK.
5
+ *
6
+ * Mirrors @cross-deck/web/react in spirit: ties the entitlement cache
7
+ * to Vue's reactive system so components re-render the moment the
8
+ * server-side cache populates.
9
+ *
10
+ * import { useEntitlement } from "@cross-deck/web/vue";
11
+ * const isPro = useEntitlement("pro"); // Ref<boolean>
12
+ *
13
+ * Why a separate subpackage: Vue is an optional peer dependency. The
14
+ * core SDK has zero runtime deps; pulling Vue in unconditionally would
15
+ * make non-Vue consumers pay for code they don't use. Same pattern as
16
+ * `@cross-deck/web/react`.
17
+ *
18
+ * SSR safety: `onMounted` / `onScopeDispose` only run on the client.
19
+ * The initial Ref value is the cache's current state (`false` pre-init),
20
+ * so server output never claims a non-existent entitlement.
21
+ */
22
+
23
+ /**
24
+ * Reactive entitlement check. Returns a `Ref<boolean>` that updates
25
+ * automatically whenever the cache mutates.
26
+ *
27
+ * const isPro = useEntitlement("pro");
28
+ * // template: <span v-if="isPro">Pro</span>
29
+ */
30
+ declare function useEntitlement(key: string): Ref<boolean>;
31
+ /**
32
+ * Reactive list of active entitlement keys. Updates on every cache
33
+ * mutation. Useful for rendering a "you have unlocked: ..." block.
34
+ */
35
+ declare function useEntitlements(): Ref<readonly string[]>;
36
+
37
+ export { useEntitlement, useEntitlements };