@revturbine/sdk 0.2.21 → 0.2.22

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.
@@ -6,6 +6,7 @@ export * from './SurfaceTypes';
6
6
  export * from './PlacementDecisionInspector';
7
7
  export * from './UserProfile';
8
8
  export * from './useEntitlement';
9
+ export * from './useCan';
9
10
  export * from './useUsageSnapshot';
10
11
  export { useRevTurbineTheme } from '../theme/ThemeContext';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../react/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../react/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type UseEntitlementOptions, type UseEntitlementResult } from './useEntitlement';
2
+ /**
3
+ * Verb-parity alias of {@link useEntitlement} — the reactive counterpart to the
4
+ * imperative `rt.can(handle)`. Takes the entitlement handle positionally (matching
5
+ * `rt.can('handle')`), plus the same options {@link useEntitlement} accepts, and
6
+ * returns the identical reactive result (`allowed` / `denied` / `limited` /
7
+ * `result` / `recheck` / …).
8
+ *
9
+ * Use this when you want the hook name to read like the `can` verb; it is a thin
10
+ * wrapper with no behavioral difference from `useEntitlement({ handle })`.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function BrandKitSection() {
15
+ * const { allowed, denied, result } = useCan('brand_kit');
16
+ * if (denied) return <UpgradePrompt reason={result?.reason} />;
17
+ * return <BrandKitEditor />;
18
+ * }
19
+ * ```
20
+ */
21
+ export declare function useCan(handle: string, options?: Omit<UseEntitlementOptions, 'handle'>): UseEntitlementResult;
22
+ //# sourceMappingURL=useCan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCan.d.ts","sourceRoot":"","sources":["../../../../react/useCan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEzG;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,GAC9C,oBAAoB,CAEtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revturbine/sdk",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "description": "RevTurbine customer-facing SDK — placement decisioning, entitlement checks, and usage tracking.",
5
5
  "type": "module",
6
6
  "exports": {