@consentify/react 1.0.0 → 2.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/index.d.ts CHANGED
@@ -1,11 +1,3 @@
1
- import type { ConsentState } from "@consentify/core";
2
- interface ConsentifyClient<T extends string> {
3
- subscribe: (callback: () => void) => () => void;
4
- get: () => ConsentState<T>;
5
- getServerSnapshot: () => ConsentState<T>;
6
- }
7
- interface ConsentifyInstance<T extends string> {
8
- client: ConsentifyClient<T>;
9
- }
10
- export declare function useConsentify<T extends string>(instance: ConsentifyInstance<T>): ConsentState<T>;
1
+ import type { ConsentifySubscribable } from "@consentify/core";
2
+ export declare function useConsentify<T extends string>(instance: ConsentifySubscribable<T>): ReturnType<typeof instance.get>;
11
3
  export * from "@consentify/core";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useSyncExternalStore } from "react";
3
3
  export function useConsentify(instance) {
4
- return useSyncExternalStore(instance.client.subscribe, instance.client.get, instance.client.getServerSnapshot);
4
+ return useSyncExternalStore(instance.subscribe, instance.get, instance.getServerSnapshot);
5
5
  }
6
6
  export * from "@consentify/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consentify/react",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "React hook for @consentify/core",
5
5
  "author": {
6
6
  "name": "Roman Denysov",
@@ -66,7 +66,7 @@
66
66
  "react": "^18.0.0 || ^19.0.0"
67
67
  },
68
68
  "dependencies": {
69
- "@consentify/core": "^1.1.0"
69
+ "@consentify/core": "^2.0.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/react": "^19.0.0",