@sudeep7353/grantly-react-consent 0.1.5 → 0.1.6

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,92 +1,92 @@
1
- import React from 'react';
2
-
3
- export type DisplayMode =
4
- | 'plain'
5
- | 'inline'
6
- | 'no-agreement-title'
7
- | 'no-agreement-text'
8
- | 'no-change-summary'
9
- | 'no-consent-timestamps'
10
- | 'no-modify-button';
11
-
12
- export type ConsentStatus =
13
- | 'in-progress'
14
- | 'already-consented'
15
- | 'accepted'
16
- | 'declined'
17
- | 'error';
18
-
19
- export type RevokeStatus =
20
- | 'in-progress'
21
- | 'consents-loaded'
22
- | 'no-consents'
23
- | 'withdrawing'
24
- | 'withdrawn'
25
- | 'error';
26
-
27
- export interface ConsentStatusDetail {
28
- status: ConsentStatus;
29
- clientId: string;
30
- userId: string;
31
- acceptedPurposes?: string[];
32
- agreementVersionId?: string;
33
- expiresAt?: string | null;
34
- autoAccepted?: boolean;
35
- error?: string;
36
- }
37
-
38
- export interface ConsentWidgetProps {
39
- /** Client identifier for the consent request */
40
- clientId?: string;
41
- /** User identifier */
42
- xUserId?: string;
43
- /** Authentication token */
44
- xAuthToken?: string;
45
- /** Language preference for content */
46
- acceptLanguage?: string;
47
- /** Display mode(s) - can be space-separated for multiple modes */
48
- displayMode?: string;
49
- /** Enable consent modification mode. When enabled, the submit button is only enabled when consent has been modified */
50
- modifyConsent?: boolean;
51
- /** Callback function for status changes */
52
- onStatusChange?: (status: ConsentStatusDetail) => void;
53
- }
54
-
55
- export interface ConsentWidgetRef {
56
- /** Programmatically submit consent */
57
- submitConsent: () => Promise<ConsentStatusDetail>;
58
- }
59
-
60
- export interface RevokeStatusDetail {
61
- status: RevokeStatus;
62
- clientId: string;
63
- consents?: any[];
64
- totalCount?: number;
65
- withdrawnConsent?: any;
66
- error?: string;
67
- }
68
-
69
- export interface RevokeWidgetProps {
70
- /** Client identifier for the consent request */
71
- clientId: string;
72
- /** Authentication token */
73
- authToken: string;
74
- /** Display mode(s) - can be space-separated for multiple modes */
75
- displayMode?: string;
76
- /** Language preference for content */
77
- acceptLanguage?: string;
78
- /** Callback function for status changes */
79
- onStatusChange?: (status: RevokeStatusDetail) => void;
80
- /** Callback function when modify consent is clicked */
81
- onModifyConsent?: (consent: any) => void;
82
- }
83
-
84
- declare const ConsentWidget: React.ForwardRefExoticComponent<
85
- ConsentWidgetProps & React.RefAttributes<ConsentWidgetRef>
86
- >;
87
-
88
- declare const RevokeWidget: React.FC<RevokeWidgetProps>;
89
-
90
- export default ConsentWidget;
91
- export { ConsentWidget, RevokeWidget };
92
-
1
+ import React from 'react';
2
+
3
+ export type DisplayMode =
4
+ | 'plain'
5
+ | 'inline'
6
+ | 'no-agreement-title'
7
+ | 'no-agreement-text'
8
+ | 'no-change-summary'
9
+ | 'no-consent-timestamps'
10
+ | 'no-modify-button';
11
+
12
+ export type ConsentStatus =
13
+ | 'in-progress'
14
+ | 'already-consented'
15
+ | 'pending'
16
+ | 'accepted'
17
+ | 'declined'
18
+ | 'error';
19
+
20
+ export type WithdrawConsentStatus =
21
+ | 'in-progress'
22
+ | 'consents-loaded'
23
+ | 'no-consents'
24
+ | 'withdrawing'
25
+ | 'withdrawn'
26
+ | 'error';
27
+
28
+ export interface ConsentStatusDetail {
29
+ status: ConsentStatus;
30
+ clientId: string;
31
+ userId: string;
32
+ acceptedPurposes?: string[];
33
+ agreementVersionId?: string;
34
+ expiresAt?: string | null;
35
+ /** Backend consent state for the created consent (e.g. draft, active) */
36
+ consentState?: string;
37
+ error?: string;
38
+ }
39
+
40
+ export interface ConsentWidgetProps {
41
+ /** Client identifier for the consent request */
42
+ clientId?: string;
43
+ /** User identifier */
44
+ xUserId?: string;
45
+ /** Language preference for content */
46
+ acceptLanguage?: string;
47
+ /** Display mode(s) - can be space-separated for multiple modes */
48
+ displayMode?: string;
49
+ /** Enable consent modification mode. When enabled, the submit button is only enabled when consent has been modified */
50
+ modifyConsent?: boolean;
51
+ /** Callback function for status changes */
52
+ onStatusChange?: (status: ConsentStatusDetail) => void;
53
+ }
54
+
55
+ export interface ConsentWidgetRef {
56
+ /** Programmatically submit consent */
57
+ submitConsent: () => Promise<ConsentStatusDetail>;
58
+ }
59
+
60
+ export interface WithdrawConsentStatusDetail {
61
+ status: WithdrawConsentStatus;
62
+ clientId: string;
63
+ consents?: any[];
64
+ totalCount?: number;
65
+ withdrawnConsent?: any;
66
+ error?: string;
67
+ }
68
+
69
+ export interface WithdrawConsentWidgetProps {
70
+ /** Client identifier for the consent request */
71
+ clientId: string;
72
+ /** User identifier */
73
+ userId: string;
74
+ /** Display mode(s) - can be space-separated for multiple modes */
75
+ displayMode?: string;
76
+ /** Language preference for content */
77
+ acceptLanguage?: string;
78
+ /** Callback function for status changes */
79
+ onStatusChange?: (status: WithdrawConsentStatusDetail) => void;
80
+ /** Callback function when modify consent is clicked */
81
+ onModifyConsent?: (consent: any) => void;
82
+ }
83
+
84
+ declare const ConsentWidget: React.ForwardRefExoticComponent<
85
+ ConsentWidgetProps & React.RefAttributes<ConsentWidgetRef>
86
+ >;
87
+
88
+ declare const WithdrawConsentWidget: React.FC<WithdrawConsentWidgetProps>;
89
+
90
+ export default ConsentWidget;
91
+ export { ConsentWidget, WithdrawConsentWidget };
92
+