@tantainnovative/ndpr-toolkit 3.4.1 → 3.5.1

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.
Files changed (177) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/adapters.d.mts +34 -25
  3. package/dist/adapters.d.ts +34 -25
  4. package/dist/breach.d.mts +803 -44
  5. package/dist/breach.d.ts +803 -44
  6. package/dist/breach.js +1 -1
  7. package/dist/breach.mjs +1 -1
  8. package/dist/{chunk-ASLMPY54.js → chunk-3EGQWLJ6.js} +3 -3
  9. package/dist/chunk-B4Z5MBUC.mjs +2 -0
  10. package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
  11. package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
  12. package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
  13. package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
  14. package/dist/{chunk-MLOWRZXO.mjs → chunk-F5TXUA4O.mjs} +3 -3
  15. package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
  16. package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
  17. package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
  18. package/dist/{chunk-NFJ4CB63.mjs → chunk-ID2NYIVE.mjs} +3 -3
  19. package/dist/chunk-J5WCPZLW.js +2 -0
  20. package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
  21. package/dist/chunk-LU7PKE7Y.mjs +2 -0
  22. package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
  23. package/dist/{chunk-4BOEFDDE.js → chunk-ORFC66EA.js} +3 -3
  24. package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
  25. package/dist/chunk-SCWNM4PC.mjs +2 -0
  26. package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
  27. package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
  28. package/dist/chunk-TV4U6AIS.js +2 -0
  29. package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
  30. package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
  31. package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
  32. package/dist/consent.d.mts +648 -84
  33. package/dist/consent.d.ts +648 -84
  34. package/dist/consent.js +1 -1
  35. package/dist/consent.mjs +1 -1
  36. package/dist/core.d.mts +2049 -23
  37. package/dist/core.d.ts +2049 -23
  38. package/dist/core.js +1 -1
  39. package/dist/core.mjs +1 -1
  40. package/dist/cross-border.d.mts +470 -99
  41. package/dist/cross-border.d.ts +470 -99
  42. package/dist/dpia.d.mts +591 -37
  43. package/dist/dpia.d.ts +591 -37
  44. package/dist/dsr.d.mts +654 -37
  45. package/dist/dsr.d.ts +654 -37
  46. package/dist/dsr.js +1 -1
  47. package/dist/dsr.mjs +1 -1
  48. package/dist/hooks.d.mts +2174 -30
  49. package/dist/hooks.d.ts +2174 -30
  50. package/dist/hooks.js +1 -1
  51. package/dist/hooks.mjs +1 -1
  52. package/dist/index.d.mts +4428 -43
  53. package/dist/index.d.ts +4428 -43
  54. package/dist/index.js +1 -1
  55. package/dist/index.mjs +1 -1
  56. package/dist/lawful-basis.d.mts +368 -32
  57. package/dist/lawful-basis.d.ts +368 -32
  58. package/dist/policy.d.mts +1178 -83
  59. package/dist/policy.d.ts +1178 -83
  60. package/dist/policy.js +1 -1
  61. package/dist/policy.mjs +1 -1
  62. package/dist/presets.d.mts +1020 -114
  63. package/dist/presets.d.ts +1020 -114
  64. package/dist/presets.js +1 -1
  65. package/dist/presets.mjs +1 -1
  66. package/dist/ropa.d.mts +396 -31
  67. package/dist/ropa.d.ts +396 -31
  68. package/dist/ropa.js +1 -1
  69. package/dist/ropa.mjs +1 -1
  70. package/dist/server.d.mts +2133 -24
  71. package/dist/server.d.ts +2133 -24
  72. package/dist/server.js +1 -1
  73. package/dist/server.mjs +1 -1
  74. package/dist/unstyled.d.mts +523 -55
  75. package/dist/unstyled.d.ts +523 -55
  76. package/dist/unstyled.js +1 -1
  77. package/dist/unstyled.mjs +1 -1
  78. package/package.json +3 -3
  79. package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
  80. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
  81. package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
  82. package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
  83. package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
  84. package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
  85. package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
  86. package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
  87. package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
  88. package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
  89. package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
  90. package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
  91. package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
  92. package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
  93. package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
  94. package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
  95. package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
  96. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
  97. package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
  98. package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
  99. package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
  100. package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
  101. package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
  102. package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
  103. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
  104. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
  105. package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
  106. package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
  107. package/dist/breach-B_-6lDqS.d.mts +0 -17
  108. package/dist/breach-CzXqSsaY.d.ts +0 -17
  109. package/dist/breach-Eu9byel8.d.mts +0 -185
  110. package/dist/breach-Eu9byel8.d.ts +0 -185
  111. package/dist/chunk-2L7BSG7G.mjs +0 -2
  112. package/dist/chunk-5X32J5IA.mjs +0 -2
  113. package/dist/chunk-7D2OIPHH.mjs +0 -2
  114. package/dist/chunk-JKKRPS4P.js +0 -2
  115. package/dist/chunk-UHTJ6UFW.js +0 -2
  116. package/dist/compliance-score-racQe_E_.d.mts +0 -115
  117. package/dist/compliance-score-racQe_E_.d.ts +0 -115
  118. package/dist/consent-CmVzqZUk.d.mts +0 -99
  119. package/dist/consent-CmVzqZUk.d.ts +0 -99
  120. package/dist/consent-audit-BdByjYlM.d.mts +0 -65
  121. package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
  122. package/dist/cross-border-BBi9rZyO.d.mts +0 -54
  123. package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
  124. package/dist/cross-border-UyT00llA.d.mts +0 -141
  125. package/dist/cross-border-UyT00llA.d.ts +0 -141
  126. package/dist/docx-4n8g4zul.d.mts +0 -64
  127. package/dist/docx-VvcTLYZM.d.ts +0 -64
  128. package/dist/dpia-D82hUrJe.d.ts +0 -15
  129. package/dist/dpia-DQDFw2_l.d.mts +0 -15
  130. package/dist/dpia-c9GiiOq0.d.mts +0 -137
  131. package/dist/dpia-c9GiiOq0.d.ts +0 -137
  132. package/dist/dsr-CIx5sd7e.d.ts +0 -14
  133. package/dist/dsr-XZ_HqTlA.d.mts +0 -14
  134. package/dist/dsr-yKbqX531.d.mts +0 -128
  135. package/dist/dsr-yKbqX531.d.ts +0 -128
  136. package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
  137. package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
  138. package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
  139. package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
  140. package/dist/locale-CxJx2tzn.d.mts +0 -25
  141. package/dist/locale-DSkrtf-c.d.ts +0 -25
  142. package/dist/policy-engine-5qTfp2z4.d.mts +0 -174
  143. package/dist/policy-engine-DzPxskOK.d.ts +0 -174
  144. package/dist/policy-sections-9tCb7VU7.d.ts +0 -56
  145. package/dist/policy-sections-CBWcJv-R.d.mts +0 -56
  146. package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
  147. package/dist/policy-templates-DwYl2329.d.mts +0 -43
  148. package/dist/privacy-Ca6te9Ir.d.mts +0 -138
  149. package/dist/privacy-Ca6te9Ir.d.ts +0 -138
  150. package/dist/ropa-BDTM06tr.d.ts +0 -152
  151. package/dist/ropa-CFHuT7jE.d.mts +0 -152
  152. package/dist/ropa-CyynscU6.d.ts +0 -51
  153. package/dist/ropa-NIgxd8uP.d.mts +0 -51
  154. package/dist/sanitize-CxxwKxAx.d.mts +0 -94
  155. package/dist/sanitize-CxxwKxAx.d.ts +0 -94
  156. package/dist/styling-BMDGQDgS.d.mts +0 -64
  157. package/dist/styling-BaoQtV06.d.ts +0 -64
  158. package/dist/types-DK2CoKOC.d.mts +0 -10
  159. package/dist/types-DK2CoKOC.d.ts +0 -10
  160. package/dist/useAdaptivePolicyWizard-BSLyltzZ.d.mts +0 -52
  161. package/dist/useAdaptivePolicyWizard-CL7C7MTZ.d.ts +0 -52
  162. package/dist/useBreach-CPr86Yan.d.mts +0 -115
  163. package/dist/useBreach-DkVXvtJK.d.ts +0 -115
  164. package/dist/useConsent-DCNkIJHR.d.mts +0 -75
  165. package/dist/useConsent-dOcELSfX.d.ts +0 -75
  166. package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
  167. package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
  168. package/dist/useDPIA-B6180UQn.d.mts +0 -109
  169. package/dist/useDPIA-CTqbNbww.d.ts +0 -109
  170. package/dist/useDSR-WvHk8_iu.d.mts +0 -85
  171. package/dist/useDSR-wH4H6hSM.d.ts +0 -85
  172. package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
  173. package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
  174. package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
  175. package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
  176. package/dist/useROPA-BSSU1rfx.d.ts +0 -76
  177. package/dist/useROPA-C2hjaBTz.d.mts +0 -76
package/dist/hooks.d.mts CHANGED
@@ -1,30 +1,2174 @@
1
- export { C as ConsentOption, a as ConsentSettings, b as ConsentStorageOptions, L as LawfulBasisType } from './consent-CmVzqZUk.mjs';
2
- export { D as DSRRequest, a as DSRStatus, b as DSRType } from './dsr-yKbqX531.mjs';
3
- export { a as DPIAResult, b as DPIARisk } from './dpia-c9GiiOq0.mjs';
4
- export { a as BreachReport, N as NotificationRequirement, b as RiskAssessment } from './breach-Eu9byel8.mjs';
5
- export { O as OrganizationInfo, P as PolicySection, c as PrivacyPolicy } from './privacy-Ca6te9Ir.mjs';
6
- export { L as LawfulBasis, a as LawfulBasisSummary, P as ProcessingActivity } from './lawful-basis-Cv1VmDLn.mjs';
7
- export { C as CrossBorderSummary, a as CrossBorderTransfer } from './cross-border-UyT00llA.mjs';
8
- export { P as ProcessingRecord, R as ROPASummary, a as RecordOfProcessingActivities } from './ropa-CFHuT7jE.mjs';
9
- export { u as useConsent } from './useConsent-DCNkIJHR.mjs';
10
- export { u as useDSR } from './useDSR-WvHk8_iu.mjs';
11
- export { u as useDPIA } from './useDPIA-B6180UQn.mjs';
12
- export { u as useBreach } from './useBreach-CPr86Yan.mjs';
13
- export { u as useDefaultPrivacyPolicy, a as usePrivacyPolicy } from './useDefaultPrivacyPolicy-Cs2WQSYQ.mjs';
14
- export { u as useLawfulBasis } from './useLawfulBasis-CKJ-kw84.mjs';
15
- export { u as useCrossBorderTransfer } from './useCrossBorderTransfer-DixjLjN1.mjs';
16
- export { U as UseROPAOptions, a as UseROPAReturn, u as useROPA } from './useROPA-C2hjaBTz.mjs';
17
- import { C as ComplianceInput, b as ComplianceReport } from './compliance-score-racQe_E_.mjs';
18
- export { U as UseAdaptivePolicyWizardOptions, a as UseAdaptivePolicyWizardReturn, u as useAdaptivePolicyWizard } from './useAdaptivePolicyWizard-BSLyltzZ.mjs';
19
- import './types-DK2CoKOC.mjs';
20
- import './lawful-basis-C2eGaoHM.mjs';
21
- import './cross-border-BBi9rZyO.mjs';
22
- import './ropa-NIgxd8uP.mjs';
23
- import './policy-engine-5qTfp2z4.mjs';
24
-
25
- interface UseComplianceScoreOptions {
26
- input: ComplianceInput;
27
- }
28
- declare function useComplianceScore({ input }: UseComplianceScoreOptions): ComplianceReport;
29
-
30
- export { ComplianceInput, ComplianceReport, useComplianceScore };
1
+ /**
2
+ * Adequacy status of a destination country
3
+ */
4
+ declare type AdequacyStatus = 'adequate' | 'inadequate' | 'pending_review' | 'unknown';
5
+
6
+ /**
7
+ * Breach notification types aligned with NDPA 2023 Section 40
8
+ * Data controllers must notify the NDPC within 72 hours of becoming aware of a breach
9
+ * Data subjects must be notified without undue delay when breach is likely to result in high risk
10
+ */
11
+ /**
12
+ * Represents a data breach category
13
+ */
14
+ declare interface BreachCategory {
15
+ /** Unique identifier for the category */
16
+ id: string;
17
+ /** Display name for the category */
18
+ name: string;
19
+ /** Description of this breach category */
20
+ description: string;
21
+ /** Default severity level for this category */
22
+ defaultSeverity: 'low' | 'medium' | 'high' | 'critical';
23
+ }
24
+
25
+ declare type BreachCompositeState = {
26
+ reports: BreachReport[];
27
+ assessments: RiskAssessment[];
28
+ notifications: RegulatoryNotification[];
29
+ };
30
+
31
+ /**
32
+ * Represents a data breach report
33
+ */
34
+ export declare interface BreachReport {
35
+ /** Unique identifier for the breach report */
36
+ id: string;
37
+ /** Title/summary of the breach */
38
+ title: string;
39
+ /** Detailed description of the breach */
40
+ description: string;
41
+ /** Category of the breach */
42
+ category: string;
43
+ /** Timestamp when the breach was discovered */
44
+ discoveredAt: number;
45
+ /** Timestamp when the breach occurred (if known) */
46
+ occurredAt?: number;
47
+ /** Timestamp when the breach was reported internally */
48
+ reportedAt: number;
49
+ /** Person who reported the breach */
50
+ reporter: {
51
+ name: string;
52
+ email: string;
53
+ department: string;
54
+ phone?: string;
55
+ };
56
+ /** Systems or data affected by the breach */
57
+ affectedSystems: string[];
58
+ /** Types of data involved in the breach */
59
+ dataTypes: string[];
60
+ /** Whether sensitive personal data is involved (NDPA Section 27) */
61
+ involvesSensitiveData?: boolean;
62
+ /** Estimated number of data subjects affected */
63
+ estimatedAffectedSubjects?: number;
64
+ /** Whether the breach is ongoing or contained */
65
+ status: 'ongoing' | 'contained' | 'resolved';
66
+ /** Initial actions taken to address the breach */
67
+ initialActions?: string;
68
+ /** Attachments related to the breach */
69
+ attachments?: Array<{
70
+ id: string;
71
+ name: string;
72
+ type: string;
73
+ url: string;
74
+ addedAt: number;
75
+ }>;
76
+ }
77
+
78
+ /** A single gap found during NDPA compliance evaluation. */
79
+ declare interface ComplianceGap {
80
+ /** Machine-readable requirement identifier. */
81
+ requirementId: string;
82
+ /** Human-readable name of the requirement. */
83
+ requirement: string;
84
+ /** Reference to the relevant NDPA section. */
85
+ ndpaSection: string;
86
+ /** How severe the gap is. */
87
+ severity: 'critical' | 'important' | 'recommended';
88
+ /** Explanation of what is missing. */
89
+ message: string;
90
+ /** Suggested fix type for the UI. */
91
+ fixType: 'add_section' | 'add_content' | 'fill_field';
92
+ /** Label for the fix action button. */
93
+ fixLabel: string;
94
+ /** Pre-written content the user can insert to close the gap. */
95
+ suggestedContent?: string;
96
+ }
97
+
98
+ export declare interface ComplianceInput {
99
+ consent: {
100
+ hasConsentMechanism: boolean;
101
+ hasPurposeSpecification: boolean;
102
+ hasWithdrawalMechanism: boolean;
103
+ hasMinorProtection: boolean;
104
+ consentRecordsRetained: boolean;
105
+ };
106
+ dsr: {
107
+ hasRequestMechanism: boolean;
108
+ supportsAccess: boolean;
109
+ supportsRectification: boolean;
110
+ supportsErasure: boolean;
111
+ supportsPortability: boolean;
112
+ supportsObjection: boolean;
113
+ /** Expected max response time in days (>30 counts as a gap) */
114
+ responseTimelineDays: number;
115
+ };
116
+ dpia: {
117
+ conductedForHighRisk: boolean;
118
+ documentedRisks: boolean;
119
+ mitigationMeasures: boolean;
120
+ };
121
+ breach: {
122
+ hasNotificationProcess: boolean;
123
+ notifiesWithin72Hours: boolean;
124
+ hasRiskAssessment: boolean;
125
+ hasRecordKeeping: boolean;
126
+ };
127
+ policy: {
128
+ hasPrivacyPolicy: boolean;
129
+ isPubliclyAccessible: boolean;
130
+ /** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
131
+ lastUpdated: string;
132
+ coversAllSections: boolean;
133
+ };
134
+ lawfulBasis: {
135
+ documentedForAllProcessing: boolean;
136
+ hasLegitimateInterestAssessment: boolean;
137
+ };
138
+ crossBorder: {
139
+ hasTransferMechanisms: boolean;
140
+ adequacyAssessed: boolean;
141
+ ndpcApprovalObtained: boolean;
142
+ };
143
+ ropa: {
144
+ maintained: boolean;
145
+ includesAllProcessing: boolean;
146
+ /** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
147
+ lastReviewed: string;
148
+ };
149
+ }
150
+
151
+ /**
152
+ * Compliance Score Engine
153
+ *
154
+ * Evaluates an organisation's NDPA compliance posture across eight modules and
155
+ * returns a scored, rated report with per-module breakdowns and sorted
156
+ * recommendations.
157
+ *
158
+ * Pure utility — zero React dependency.
159
+ */
160
+ declare type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
161
+
162
+ export declare interface ComplianceReport {
163
+ /** Overall compliance score, 0–100 */
164
+ score: number;
165
+ /** Rating bucket */
166
+ rating: ComplianceRating;
167
+ /** Per-module breakdown keyed by module name */
168
+ modules: Record<string, ModuleScore>;
169
+ /** Recommendations sorted by priority (critical first) */
170
+ recommendations: Recommendation[];
171
+ /** Top-level regulatory references */
172
+ regulatoryReferences: RegulatoryReference[];
173
+ /** ISO date of when the report was generated */
174
+ generatedAt: string;
175
+ }
176
+
177
+ /** Result of evaluating a policy against NDPA requirements. */
178
+ declare interface ComplianceResult {
179
+ /** Points earned. */
180
+ score: number;
181
+ /** Maximum achievable points (115). */
182
+ maxScore: number;
183
+ /** Percentage score (0-100). */
184
+ percentage: number;
185
+ /** Overall compliance rating. */
186
+ rating: 'compliant' | 'nearly_compliant' | 'not_compliant';
187
+ /** List of identified compliance gaps. */
188
+ gaps: ComplianceGap[];
189
+ /** List of requirement ids that passed. */
190
+ passed: string[];
191
+ }
192
+
193
+ /**
194
+ * Consent types aligned with NDPA 2023 Section 25-26
195
+ * Consent must be freely given, specific, informed, and unambiguous
196
+ */
197
+ /**
198
+ * Represents a consent option that can be presented to users
199
+ */
200
+ export declare interface ConsentOption {
201
+ /** Unique identifier for the consent option */
202
+ id: string;
203
+ /** Display label for the consent option */
204
+ label: string;
205
+ /** Detailed description of what this consent option covers */
206
+ description: string;
207
+ /** Whether this consent option is required (cannot be declined) */
208
+ required: boolean;
209
+ /**
210
+ * The specific purpose for which data will be processed
211
+ * NDPA Section 25(2) requires consent to be specific to each purpose
212
+ */
213
+ purpose: string;
214
+ /**
215
+ * Default state of the consent option
216
+ * @default false
217
+ */
218
+ defaultValue?: boolean;
219
+ /**
220
+ * Categories of personal data covered by this consent option
221
+ */
222
+ dataCategories?: string[];
223
+ }
224
+
225
+ /**
226
+ * Represents the user's consent settings
227
+ */
228
+ export declare interface ConsentSettings {
229
+ /** Map of consent option IDs to boolean values indicating consent status */
230
+ consents: Record<string, boolean>;
231
+ /** Timestamp when consent was last updated */
232
+ timestamp: number;
233
+ /** Version of the consent form that was accepted */
234
+ version: string;
235
+ /** Method used to collect consent (e.g., "banner", "settings", "api") */
236
+ method: string;
237
+ /** Whether the user has actively made a choice (as opposed to default settings) */
238
+ hasInteracted: boolean;
239
+ /**
240
+ * The lawful basis under which processing is conducted
241
+ * Required by NDPA Section 25(1)
242
+ */
243
+ lawfulBasis?: LawfulBasisType;
244
+ }
245
+
246
+ /**
247
+ * Represents the storage mechanism for consent settings
248
+ */
249
+ export declare interface ConsentStorageOptions {
250
+ /**
251
+ * Storage key for consent settings
252
+ * @default "ndpr_consent"
253
+ */
254
+ storageKey?: string;
255
+ /**
256
+ * Storage type to use
257
+ * @default "localStorage"
258
+ */
259
+ storageType?: 'localStorage' | 'sessionStorage' | 'cookie';
260
+ /**
261
+ * Cookie options (only used when storageType is "cookie")
262
+ */
263
+ cookieOptions?: {
264
+ /** Domain for the cookie */
265
+ domain?: string;
266
+ /**
267
+ * Path for the cookie
268
+ * @default "/"
269
+ */
270
+ path?: string;
271
+ /**
272
+ * Expiration days for the cookie
273
+ * @default 365
274
+ */
275
+ expires?: number;
276
+ /**
277
+ * Whether the cookie should be secure
278
+ * @default true
279
+ */
280
+ secure?: boolean;
281
+ /**
282
+ * SameSite attribute for the cookie
283
+ * @default "Lax"
284
+ */
285
+ sameSite?: 'Strict' | 'Lax' | 'None';
286
+ };
287
+ }
288
+
289
+ /**
290
+ * Summary of cross-border transfer compliance
291
+ */
292
+ export declare interface CrossBorderSummary {
293
+ /** Total number of active transfers */
294
+ totalActiveTransfers: number;
295
+ /** Breakdown by transfer mechanism */
296
+ byMechanism: Record<TransferMechanism, number>;
297
+ /** Breakdown by adequacy status */
298
+ byAdequacy: Record<AdequacyStatus, number>;
299
+ /** Transfers pending NDPC approval */
300
+ pendingApproval: CrossBorderTransfer[];
301
+ /** Transfers due for review */
302
+ dueForReview: CrossBorderTransfer[];
303
+ /** Transfers missing TIA */
304
+ missingTIA: CrossBorderTransfer[];
305
+ /** High-risk transfers */
306
+ highRiskTransfers: CrossBorderTransfer[];
307
+ /** Last updated timestamp */
308
+ lastUpdated: number;
309
+ }
310
+
311
+ /**
312
+ * Represents a cross-border data transfer record
313
+ */
314
+ export declare interface CrossBorderTransfer {
315
+ /** Unique identifier */
316
+ id: string;
317
+ /** Destination country or territory */
318
+ destinationCountry: string;
319
+ /** ISO country code */
320
+ destinationCountryCode?: string;
321
+ /** Adequacy status of the destination */
322
+ adequacyStatus: AdequacyStatus;
323
+ /** The transfer mechanism being relied upon */
324
+ transferMechanism: TransferMechanism;
325
+ /** Categories of personal data being transferred */
326
+ dataCategories: string[];
327
+ /** Whether sensitive personal data is included */
328
+ includesSensitiveData: boolean;
329
+ /** Estimated number of data subjects whose data is transferred */
330
+ estimatedDataSubjects?: number;
331
+ /** Name of the recipient organization */
332
+ recipientOrganization: string;
333
+ /** Contact details of the recipient */
334
+ recipientContact: {
335
+ name: string;
336
+ email: string;
337
+ phone?: string;
338
+ address?: string;
339
+ };
340
+ /** Purpose of the data transfer */
341
+ purpose: string;
342
+ /** Safeguards in place to protect the data */
343
+ safeguards: string[];
344
+ /** Risk assessment summary */
345
+ riskAssessment: string;
346
+ /** Risk level of the transfer */
347
+ riskLevel: 'low' | 'medium' | 'high';
348
+ /** NDPC approval details (required for some transfer mechanisms) */
349
+ ndpcApproval?: {
350
+ required: boolean;
351
+ applied: boolean;
352
+ approved?: boolean;
353
+ referenceNumber?: string;
354
+ appliedAt?: number;
355
+ approvedAt?: number;
356
+ };
357
+ /** Whether a Transfer Impact Assessment has been conducted */
358
+ tiaCompleted: boolean;
359
+ /** Reference to the TIA document */
360
+ tiaReference?: string;
361
+ /** Frequency of the transfer */
362
+ frequency: 'one_time' | 'periodic' | 'continuous';
363
+ /** Start date of the transfer */
364
+ startDate: number;
365
+ /** End date of the transfer (if applicable) */
366
+ endDate?: number;
367
+ /** Status of the transfer */
368
+ status: 'active' | 'suspended' | 'terminated' | 'pending_approval';
369
+ /** Timestamp when the record was created */
370
+ createdAt: number;
371
+ /** Timestamp when the record was last updated */
372
+ updatedAt: number;
373
+ /** Next review date */
374
+ reviewDate?: number;
375
+ }
376
+
377
+ /** A user-defined section added to the policy outside the generated ones. */
378
+ declare interface CustomSection {
379
+ id: string;
380
+ title: string;
381
+ content: string;
382
+ order: number;
383
+ required: false;
384
+ }
385
+
386
+ /** A logical category of personal data the organisation may collect. */
387
+ declare interface DataCategory {
388
+ /** Machine-readable identifier. */
389
+ id: string;
390
+ /** Human-readable label shown in the wizard. */
391
+ label: string;
392
+ /** Grouping for display and compliance checks. */
393
+ group: 'identity' | 'financial' | 'behavioral' | 'sensitive' | 'children';
394
+ /** Specific data points within this category. */
395
+ dataPoints: string[];
396
+ /** Whether this category is currently selected by the user. */
397
+ selected: boolean;
398
+ }
399
+
400
+ /** Options for DOCX export of the finalised policy. */
401
+ declare interface DOCXExportOptions {
402
+ includeTOC?: boolean;
403
+ filename?: string;
404
+ }
405
+
406
+ /** A map of question IDs to their answer values */
407
+ declare type DPIAAnswerMap = Record<string, DPIAAnswerValue>;
408
+
409
+ /** Possible value types for a DPIA answer */
410
+ declare type DPIAAnswerValue = string | number | boolean | string[];
411
+
412
+ /**
413
+ * Data Protection Impact Assessment types aligned with NDPA 2023 Sections 38-39
414
+ * A DPIA is required when processing is likely to result in high risk to data subjects
415
+ */
416
+ /**
417
+ * Represents a question in the DPIA questionnaire
418
+ */
419
+ declare interface DPIAQuestion {
420
+ /** Unique identifier for the question */
421
+ id: string;
422
+ /** The text of the question */
423
+ text: string;
424
+ /** Additional guidance for answering the question */
425
+ guidance?: string;
426
+ /** Type of input required for the answer */
427
+ type: 'text' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'scale';
428
+ /** Options for select, radio, or checkbox questions */
429
+ options?: Array<{
430
+ value: string;
431
+ label: string;
432
+ riskLevel?: 'low' | 'medium' | 'high';
433
+ }>;
434
+ /** For scale questions, the minimum value */
435
+ minValue?: number;
436
+ /** For scale questions, the maximum value */
437
+ maxValue?: number;
438
+ /** For scale questions, labels for the scale points */
439
+ scaleLabels?: Record<number, string>;
440
+ /** Whether the question is required */
441
+ required: boolean;
442
+ /** Risk level associated with this question */
443
+ riskLevel?: 'low' | 'medium' | 'high';
444
+ /** Whether this question triggers additional questions based on the answer */
445
+ hasDependentQuestions?: boolean;
446
+ /** Conditions that determine when this question should be shown */
447
+ showWhen?: Array<{
448
+ questionId: string;
449
+ operator: 'equals' | 'contains' | 'greaterThan' | 'lessThan';
450
+ value: string | number | boolean;
451
+ }>;
452
+ }
453
+
454
+ /**
455
+ * Represents the result of a completed DPIA
456
+ */
457
+ export declare interface DPIAResult {
458
+ /** Unique identifier for the DPIA */
459
+ id: string;
460
+ /** Title of the DPIA */
461
+ title: string;
462
+ /** Description of the processing activity being assessed */
463
+ processingDescription: string;
464
+ /** Timestamp when the DPIA was started */
465
+ startedAt: number;
466
+ /** Timestamp when the DPIA was completed */
467
+ completedAt?: number;
468
+ /** Person responsible for conducting the DPIA */
469
+ assessor: {
470
+ name: string;
471
+ role: string;
472
+ email: string;
473
+ };
474
+ /** Answers to all questions in the DPIA */
475
+ answers: Record<string, string | number | boolean | string[]>;
476
+ /** Risks identified in the DPIA */
477
+ risks: DPIARisk[];
478
+ /** Overall risk level of the processing activity */
479
+ overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
480
+ /** Whether the DPIA concluded that the processing can proceed */
481
+ canProceed: boolean;
482
+ /** Reasons why the processing can or cannot proceed */
483
+ conclusion: string;
484
+ /** Recommendations for the processing activity */
485
+ recommendations?: string[];
486
+ /** Next review date for the DPIA */
487
+ reviewDate?: number;
488
+ /** Version of the DPIA questionnaire used */
489
+ version: string;
490
+ /**
491
+ * Whether prior consultation with NDPC is required
492
+ * Per NDPA Section 39, consultation is required when DPIA indicates high residual risk
493
+ */
494
+ ndpcConsultationRequired?: boolean;
495
+ /** Date when NDPC consultation was initiated */
496
+ ndpcConsultationDate?: number;
497
+ /** Reference number from NDPC consultation */
498
+ ndpcConsultationReference?: string;
499
+ /**
500
+ * The lawful basis for the processing activity being assessed
501
+ */
502
+ lawfulBasis?: string;
503
+ /**
504
+ * Whether this DPIA involves cross-border data transfers
505
+ */
506
+ involvesCrossBorderTransfer?: boolean;
507
+ }
508
+
509
+ /**
510
+ * Represents a risk identified in the DPIA
511
+ */
512
+ export declare interface DPIARisk {
513
+ /** Unique identifier for the risk */
514
+ id: string;
515
+ /** Description of the risk */
516
+ description: string;
517
+ /** Likelihood of the risk occurring (1-5) */
518
+ likelihood: number;
519
+ /** Impact if the risk occurs (1-5) */
520
+ impact: number;
521
+ /** Overall risk score (likelihood * impact) */
522
+ score: number;
523
+ /** Risk level based on the score */
524
+ level: 'low' | 'medium' | 'high' | 'critical';
525
+ /** Measures to mitigate the risk */
526
+ mitigationMeasures?: string[];
527
+ /** Whether the risk has been mitigated */
528
+ mitigated: boolean;
529
+ /** Residual risk score after mitigation */
530
+ residualScore?: number;
531
+ /** Questions that identified this risk */
532
+ relatedQuestionIds: string[];
533
+ }
534
+
535
+ /**
536
+ * Represents a section in the DPIA questionnaire
537
+ */
538
+ declare interface DPIASection {
539
+ /** Unique identifier for the section */
540
+ id: string;
541
+ /** Title of the section */
542
+ title: string;
543
+ /** Description of the section */
544
+ description?: string;
545
+ /** Questions in this section */
546
+ questions: DPIAQuestion[];
547
+ /** Order of the section in the questionnaire */
548
+ order: number;
549
+ }
550
+
551
+ /**
552
+ * Represents a data subject request
553
+ */
554
+ export declare interface DSRRequest {
555
+ /** Unique identifier for the request */
556
+ id: string;
557
+ /** Type of request */
558
+ type: DSRType;
559
+ /** Current status of the request */
560
+ status: DSRStatus;
561
+ /** Timestamp when the request was submitted */
562
+ createdAt: number;
563
+ /** Timestamp when the request was last updated */
564
+ updatedAt: number;
565
+ /** Timestamp when the request was completed (if applicable) */
566
+ completedAt?: number;
567
+ /** Timestamp when the identity was verified (if applicable) */
568
+ verifiedAt?: number;
569
+ /**
570
+ * Due date for responding to the request (timestamp)
571
+ * NDPA requires response within 30 days of receipt
572
+ */
573
+ dueDate?: number;
574
+ /** Description or details of the request */
575
+ description?: string;
576
+ /**
577
+ * The lawful basis under which the data was originally processed
578
+ * Relevant for evaluating objection and erasure requests
579
+ */
580
+ lawfulBasis?: string;
581
+ /** Data subject information */
582
+ subject: {
583
+ name: string;
584
+ email: string;
585
+ phone?: string;
586
+ identifierValue?: string;
587
+ identifierType?: string;
588
+ };
589
+ /** Additional information provided by the data subject */
590
+ additionalInfo?: Record<string, string | number | boolean | null>;
591
+ /** Notes added by staff processing the request */
592
+ internalNotes?: Array<{
593
+ timestamp: number;
594
+ author: string;
595
+ note: string;
596
+ }>;
597
+ /** Verification status */
598
+ verification?: {
599
+ verified: boolean;
600
+ method?: string;
601
+ verifiedAt?: number;
602
+ verifiedBy?: string;
603
+ };
604
+ /** Reason for rejection (if status is 'rejected') */
605
+ rejectionReason?: string;
606
+ /** Files attached to the request */
607
+ attachments?: Array<{
608
+ id: string;
609
+ name: string;
610
+ type: string;
611
+ url: string;
612
+ addedAt: number;
613
+ }>;
614
+ /**
615
+ * Whether an extension was requested for this DSR
616
+ * NDPA allows a one-time extension of 30 days with justification
617
+ */
618
+ extensionRequested?: boolean;
619
+ /** Reason for the extension, if requested */
620
+ extensionReason?: string;
621
+ }
622
+
623
+ /**
624
+ * Status of a data subject request
625
+ */
626
+ export declare type DSRStatus = 'pending' | 'awaitingVerification' | 'inProgress' | 'completed' | 'rejected';
627
+
628
+ /**
629
+ * Data Subject Rights types aligned with NDPA 2023 Part IV (Sections 29-36)
630
+ */
631
+ /**
632
+ * Types of data subject requests per NDPA Part IV
633
+ * - 'information': Right to be informed (Section 29)
634
+ * - 'access': Right of access (Section 30)
635
+ * - 'rectification': Right to rectification (Section 31)
636
+ * - 'erasure': Right to erasure (Section 32)
637
+ * - 'restriction': Right to restrict processing (Section 33)
638
+ * - 'portability': Right to data portability (Section 34)
639
+ * - 'objection': Right to object (Section 35)
640
+ * - 'automated_decision_making': Rights related to automated decision-making (Section 36)
641
+ */
642
+ export declare type DSRType = 'information' | 'access' | 'rectification' | 'erasure' | 'restriction' | 'portability' | 'objection' | 'automated_decision_making';
643
+
644
+ declare type EffortLevel = 'low' | 'medium' | 'high';
645
+
646
+ /** Options for HTML export of the finalised policy. */
647
+ declare interface HTMLExportOptions {
648
+ includeStyles?: boolean;
649
+ includePrintCSS?: boolean;
650
+ customCSS?: string;
651
+ /**
652
+ * Theme controlling the embedded design tokens.
653
+ *
654
+ * - `'light'` (default): emits the light token palette only. No
655
+ * `prefers-color-scheme: dark` block is included, so a visitor's OS
656
+ * dark-mode setting will NOT recolour the policy. This is the right
657
+ * default for an embedded compliance widget — most consumer host sites
658
+ * are single-theme and Shadow DOM does not isolate `prefers-color-scheme`.
659
+ * - `'dark'`: emits the dark token palette as the primary style.
660
+ * - `'auto'`: emits light tokens plus a `@media (prefers-color-scheme: dark)`
661
+ * block that swaps to dark on the user's OS preference. Use this when
662
+ * your host site genuinely follows OS dark mode and you want the policy
663
+ * to match.
664
+ *
665
+ * Pre-3.4.1 the export effectively behaved like `'auto'` unconditionally,
666
+ * which leaked dark colours into light-only host sites via Shadow DOM.
667
+ *
668
+ * @default 'light'
669
+ */
670
+ theme?: 'light' | 'dark' | 'auto';
671
+ }
672
+
673
+ /**
674
+ * Policy engine types for the adaptive privacy policy generator.
675
+ * These types power the wizard-driven policy builder, compliance checker,
676
+ * and export functionality — all aligned with the NDPA 2023.
677
+ */
678
+
679
+ /** Industry verticals with sector-specific compliance requirements. */
680
+ declare type Industry = 'fintech' | 'healthcare' | 'ecommerce' | 'saas' | 'education' | 'government' | 'other';
681
+
682
+ /**
683
+ * Lawful Basis types aligned with NDPA 2023 Part III (Sections 24-28)
684
+ * Every processing activity must have a documented lawful basis
685
+ */
686
+ /**
687
+ * The six lawful bases for processing personal data per NDPA Section 25(1)
688
+ */
689
+ export declare type LawfulBasis = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
690
+
691
+ /**
692
+ * Summary of all lawful basis documentation for compliance reporting
693
+ */
694
+ export declare interface LawfulBasisSummary {
695
+ /** Total number of processing activities */
696
+ totalActivities: number;
697
+ /** Breakdown by lawful basis */
698
+ byBasis: Record<LawfulBasis, number>;
699
+ /** Number of activities involving sensitive data */
700
+ sensitiveDataActivities: number;
701
+ /** Number of activities involving cross-border transfers */
702
+ crossBorderActivities: number;
703
+ /** Activities due for review */
704
+ activitiesDueForReview: ProcessingActivity[];
705
+ /** Activities without DPO approval */
706
+ activitiesWithoutApproval: ProcessingActivity[];
707
+ /** Last updated timestamp */
708
+ lastUpdated: number;
709
+ }
710
+
711
+ /**
712
+ * Lawful basis for processing personal data per NDPA Section 25(1)
713
+ */
714
+ export declare type LawfulBasisType = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
715
+
716
+ /**
717
+ * Validation result for a processing activity
718
+ */
719
+ declare interface LawfulBasisValidationResult {
720
+ isValid: boolean;
721
+ errors: string[];
722
+ warnings: string[];
723
+ }
724
+
725
+ declare interface ModuleScore {
726
+ /** Module name (e.g. "consent") */
727
+ name: string;
728
+ /** Raw module score 0-100 */
729
+ score: number;
730
+ /** Maximum possible score for this module (always 100) */
731
+ maxScore: number;
732
+ /** Weighted contribution to the overall score */
733
+ weightedScore: number;
734
+ /** NDPA sections this module maps to */
735
+ ndpaSections: string[];
736
+ /** Gaps found — list of human-readable gap descriptions */
737
+ gaps: string[];
738
+ }
739
+
740
+ /**
741
+ * Represents notification requirements for a data breach per NDPA Section 40
742
+ */
743
+ export declare interface NotificationRequirement {
744
+ /**
745
+ * Whether NDPC notification is required
746
+ * Per NDPA Section 40, notification to NDPC is required for all breaches
747
+ * that pose a risk to data subjects' rights and freedoms
748
+ */
749
+ ndpcNotificationRequired: boolean;
750
+ /**
751
+ * Deadline for NDPC notification (72 hours from discovery)
752
+ * NDPA Section 40(1)
753
+ */
754
+ ndpcNotificationDeadline: number;
755
+ /**
756
+ * Whether data subject notification is required
757
+ * Per NDPA Section 40(4), required when breach is likely to result in
758
+ * high risk to rights and freedoms of data subjects
759
+ */
760
+ dataSubjectNotificationRequired: boolean;
761
+ /** Justification for the notification decision */
762
+ justification: string;
763
+ /**
764
+ * @deprecated Use ndpcNotificationRequired instead. Kept for backward compatibility.
765
+ */
766
+ nitdaNotificationRequired?: boolean;
767
+ /**
768
+ * @deprecated Use ndpcNotificationDeadline instead. Kept for backward compatibility.
769
+ */
770
+ nitdaNotificationDeadline?: number;
771
+ }
772
+
773
+ /**
774
+ * Represents organization information for a privacy policy
775
+ */
776
+ export declare interface OrganizationInfo {
777
+ /** Name of the organization */
778
+ name: string;
779
+ /** Website URL of the organization */
780
+ website: string;
781
+ /** Contact email for privacy inquiries */
782
+ privacyEmail: string;
783
+ /** Physical address of the organization */
784
+ address?: string;
785
+ /** Phone number for privacy inquiries */
786
+ privacyPhone?: string;
787
+ /** Name of the Data Protection Officer */
788
+ dpoName?: string;
789
+ /** Email of the Data Protection Officer */
790
+ dpoEmail?: string;
791
+ /** Industry or sector of the organization */
792
+ industry?: string;
793
+ /** NDPC registration number (if registered) */
794
+ ndpcRegistrationNumber?: string;
795
+ }
796
+
797
+ /** Organisation size tiers — affects complexity of generated language. */
798
+ declare type OrgSize = 'startup' | 'midsize' | 'enterprise';
799
+
800
+ /** Options for PDF export of the finalised policy. */
801
+ declare interface PDFExportOptions {
802
+ includeCoverPage?: boolean;
803
+ includeTOC?: boolean;
804
+ includeComplianceBadge?: boolean;
805
+ logoUrl?: string;
806
+ filename?: string;
807
+ }
808
+
809
+ /** Represents an in-progress policy being built in the wizard. */
810
+ declare interface PolicyDraft {
811
+ /** Unique identifier for the draft. */
812
+ id: string;
813
+ /** The template context driving section generation. */
814
+ templateContext: TemplateContext;
815
+ /** Custom sections added by the user. */
816
+ customSections: CustomSection[];
817
+ /** Per-section content overrides keyed by section id. */
818
+ sectionOverrides: Record<string, string>;
819
+ /** Ordered list of section ids defining the final order. */
820
+ sectionOrder: string[];
821
+ /** Current wizard step (0-indexed). */
822
+ currentStep: number;
823
+ /** Timestamp of the last save. */
824
+ lastSavedAt: number;
825
+ /** The draft is always in "draft" status until finalised. */
826
+ status: 'draft';
827
+ }
828
+
829
+ /**
830
+ * Privacy policy types aligned with NDPA 2023
831
+ * Privacy policies must clearly inform data subjects of their rights under the NDPA
832
+ */
833
+ /**
834
+ * Represents a section in a privacy policy
835
+ */
836
+ export declare interface PolicySection {
837
+ /** Unique identifier for the section */
838
+ id: string;
839
+ /** Title of the section */
840
+ title: string;
841
+ /** Description of the section */
842
+ description?: string;
843
+ /** Order of the section in the policy */
844
+ order?: number;
845
+ /** Whether the section is required by NDPA */
846
+ required: boolean;
847
+ /** Template text for the section */
848
+ template: string;
849
+ /**
850
+ * Default content for the section (legacy field)
851
+ * @deprecated Use template instead
852
+ */
853
+ defaultContent?: string;
854
+ /**
855
+ * Custom content for the section (overrides default content)
856
+ * @deprecated Use template instead
857
+ */
858
+ customContent?: string;
859
+ /** Whether the section is included in the policy */
860
+ included: boolean;
861
+ /** Variables that can be used in the section content */
862
+ variables?: string[];
863
+ }
864
+
865
+ /**
866
+ * Represents a privacy policy template
867
+ */
868
+ declare interface PolicyTemplate {
869
+ /** Unique identifier for the template */
870
+ id: string;
871
+ /** Name of the template */
872
+ name: string;
873
+ /** Description of the template */
874
+ description: string;
875
+ /** Type of organization the template is designed for */
876
+ organizationType: 'business' | 'nonprofit' | 'government' | 'educational';
877
+ /** Sections included in the template */
878
+ sections: PolicySection[];
879
+ /** Variables used across the template */
880
+ variables: Record<string, {
881
+ name: string;
882
+ description: string;
883
+ required: boolean;
884
+ defaultValue?: string;
885
+ }>;
886
+ /** Version of the template */
887
+ version: string;
888
+ /** Last updated date of the template */
889
+ lastUpdated: number;
890
+ /**
891
+ * Whether this template is NDPA 2023 compliant
892
+ */
893
+ ndpaCompliant: boolean;
894
+ }
895
+
896
+ /**
897
+ * Represents a generated privacy policy
898
+ */
899
+ export declare interface PrivacyPolicy {
900
+ /** Unique identifier for the policy */
901
+ id: string;
902
+ /** Title of the policy */
903
+ title: string;
904
+ /** Template used to generate the policy */
905
+ templateId: string;
906
+ /** Organization information */
907
+ organizationInfo: OrganizationInfo;
908
+ /** Sections of the policy */
909
+ sections: PolicySection[];
910
+ /** Values for the variables used in the policy */
911
+ variableValues: Record<string, string>;
912
+ /** Effective date of the policy */
913
+ effectiveDate: number;
914
+ /** Last updated date of the policy */
915
+ lastUpdated: number;
916
+ /** Version of the policy */
917
+ version: string;
918
+ /**
919
+ * Applicable legal frameworks
920
+ */
921
+ applicableFrameworks?: ('ndpa' | 'ndpr' | 'gdpr' | 'ccpa')[];
922
+ }
923
+
924
+ /**
925
+ * Represents a processing activity and its lawful basis
926
+ */
927
+ export declare interface ProcessingActivity {
928
+ /** Unique identifier */
929
+ id: string;
930
+ /** Name of the processing activity */
931
+ name: string;
932
+ /** Description of what processing is performed */
933
+ description: string;
934
+ /** The lawful basis for this processing activity */
935
+ lawfulBasis: LawfulBasis;
936
+ /** Justification for why this lawful basis applies */
937
+ lawfulBasisJustification: string;
938
+ /** Categories of personal data being processed */
939
+ dataCategories: string[];
940
+ /** Whether sensitive personal data is involved */
941
+ involvesSensitiveData: boolean;
942
+ /** Condition for processing sensitive data (required if involvesSensitiveData is true) */
943
+ sensitiveDataCondition?: SensitiveDataCondition;
944
+ /** Categories of data subjects */
945
+ dataSubjectCategories: string[];
946
+ /** Purposes of the processing */
947
+ purposes: string[];
948
+ /** Data retention period */
949
+ retentionPeriod: string;
950
+ /** Justification for the retention period */
951
+ retentionJustification?: string;
952
+ /** Recipients or categories of recipients */
953
+ recipients?: string[];
954
+ /** Whether data is transferred outside Nigeria */
955
+ crossBorderTransfer: boolean;
956
+ /** Timestamp when the record was created */
957
+ createdAt: number;
958
+ /** Timestamp when the record was last updated */
959
+ updatedAt: number;
960
+ /** Next review date */
961
+ reviewDate?: number;
962
+ /** Status of the processing activity */
963
+ status: 'active' | 'inactive' | 'under_review' | 'archived';
964
+ /** DPO approval details */
965
+ dpoApproval?: {
966
+ approved: boolean;
967
+ approvedBy: string;
968
+ approvedAt: number;
969
+ notes?: string;
970
+ };
971
+ }
972
+
973
+ /** Lawful processing purposes recognised under the NDPA. */
974
+ declare type ProcessingPurpose = 'service_delivery' | 'marketing' | 'analytics' | 'research' | 'legal_compliance' | 'fraud_prevention';
975
+
976
+ /**
977
+ * Record of Processing Activities (ROPA) types aligned with NDPA 2023
978
+ * Data controllers must maintain comprehensive records of all processing activities
979
+ */
980
+
981
+ /**
982
+ * Represents a single processing record in the ROPA
983
+ */
984
+ export declare interface ProcessingRecord {
985
+ /** Unique identifier */
986
+ id: string;
987
+ /** Name of the processing activity */
988
+ name: string;
989
+ /** Detailed description of the processing */
990
+ description: string;
991
+ /** Data controller details */
992
+ controllerDetails: {
993
+ name: string;
994
+ contact: string;
995
+ address: string;
996
+ registrationNumber?: string;
997
+ dpoContact?: string;
998
+ };
999
+ /** Joint controller details (if applicable) */
1000
+ jointControllerDetails?: {
1001
+ name: string;
1002
+ contact: string;
1003
+ address: string;
1004
+ responsibilities: string;
1005
+ };
1006
+ /** Data processor details (if processing is outsourced) */
1007
+ processorDetails?: {
1008
+ name: string;
1009
+ contact: string;
1010
+ address: string;
1011
+ contractReference?: string;
1012
+ };
1013
+ /** Lawful basis for the processing */
1014
+ lawfulBasis: LawfulBasis;
1015
+ /** Justification for the chosen lawful basis */
1016
+ lawfulBasisJustification: string;
1017
+ /** Purposes of the processing */
1018
+ purposes: string[];
1019
+ /** Categories of personal data processed */
1020
+ dataCategories: string[];
1021
+ /** Categories of sensitive personal data (if any) */
1022
+ sensitiveDataCategories?: string[];
1023
+ /** Categories of data subjects */
1024
+ dataSubjectCategories: string[];
1025
+ /** Recipients or categories of recipients */
1026
+ recipients: string[];
1027
+ /** Cross-border transfer details */
1028
+ crossBorderTransfers?: Array<{
1029
+ destinationCountry: string;
1030
+ countryCode?: string;
1031
+ safeguards: string;
1032
+ transferMechanism: string;
1033
+ }>;
1034
+ /** Data retention period */
1035
+ retentionPeriod: string;
1036
+ /** Justification for the retention period */
1037
+ retentionJustification?: string;
1038
+ /** Technical and organizational security measures */
1039
+ securityMeasures: string[];
1040
+ /** Data source (directly from data subject or from third party) */
1041
+ dataSource: 'data_subject' | 'third_party' | 'public_source' | 'other';
1042
+ /** Third-party source details (if dataSource is 'third_party') */
1043
+ thirdPartySourceDetails?: string;
1044
+ /** Whether a DPIA is required for this processing */
1045
+ dpiaRequired: boolean;
1046
+ /** Reference to the DPIA (if conducted) */
1047
+ dpiaReference?: string;
1048
+ /** Whether automated decision-making is involved */
1049
+ automatedDecisionMaking: boolean;
1050
+ /** Details of automated decision-making (if applicable) */
1051
+ automatedDecisionMakingDetails?: string;
1052
+ /** Status of the processing record */
1053
+ status: 'active' | 'inactive' | 'archived';
1054
+ /** Department or business unit responsible */
1055
+ department?: string;
1056
+ /** System or application used for processing */
1057
+ systemsUsed?: string[];
1058
+ /** Timestamp when the record was created */
1059
+ createdAt: number;
1060
+ /** Timestamp when the record was last updated */
1061
+ updatedAt: number;
1062
+ /** Timestamp when the record was last reviewed */
1063
+ lastReviewedAt?: number;
1064
+ /** Next review date */
1065
+ nextReviewDate?: number;
1066
+ }
1067
+
1068
+ declare interface Recommendation {
1069
+ module: string;
1070
+ key: string;
1071
+ label: string;
1072
+ priority: RecommendationPriority;
1073
+ effort: EffortLevel;
1074
+ recommendation: string;
1075
+ ndpaSection: string;
1076
+ }
1077
+
1078
+ declare type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
1079
+
1080
+ /**
1081
+ * Represents a complete Record of Processing Activities
1082
+ */
1083
+ export declare interface RecordOfProcessingActivities {
1084
+ /** Unique identifier */
1085
+ id: string;
1086
+ /** Organization name */
1087
+ organizationName: string;
1088
+ /** Organization contact information */
1089
+ organizationContact: string;
1090
+ /** Organization address */
1091
+ organizationAddress: string;
1092
+ /** Data Protection Officer details */
1093
+ dpoDetails?: {
1094
+ name: string;
1095
+ email: string;
1096
+ phone?: string;
1097
+ };
1098
+ /** NDPC registration number */
1099
+ ndpcRegistrationNumber?: string;
1100
+ /** All processing records */
1101
+ records: ProcessingRecord[];
1102
+ /** Timestamp when the ROPA was last updated */
1103
+ lastUpdated: number;
1104
+ /** Version of the ROPA */
1105
+ version: string;
1106
+ /** Export format options */
1107
+ exportFormats?: ('pdf' | 'csv' | 'json' | 'xlsx')[];
1108
+ }
1109
+
1110
+ /**
1111
+ * Represents a notification sent to the NDPC (Nigeria Data Protection Commission)
1112
+ */
1113
+ declare interface RegulatoryNotification {
1114
+ /** Unique identifier for the notification */
1115
+ id: string;
1116
+ /** ID of the breach this notification is for */
1117
+ breachId: string;
1118
+ /** Timestamp when the notification was sent */
1119
+ sentAt: number;
1120
+ /** Method used to send the notification */
1121
+ method: 'email' | 'portal' | 'letter' | 'other';
1122
+ /** Reference number assigned by the NDPC (if available) */
1123
+ referenceNumber?: string;
1124
+ /** Contact person at the NDPC */
1125
+ ndpcContact?: {
1126
+ name: string;
1127
+ email: string;
1128
+ phone?: string;
1129
+ };
1130
+ /** Content of the notification */
1131
+ content: string;
1132
+ /** Attachments included with the notification */
1133
+ attachments?: Array<{
1134
+ id: string;
1135
+ name: string;
1136
+ type: string;
1137
+ url: string;
1138
+ }>;
1139
+ /** Follow-up communications with the NDPC */
1140
+ followUps?: Array<{
1141
+ timestamp: number;
1142
+ direction: 'sent' | 'received';
1143
+ content: string;
1144
+ attachments?: Array<{
1145
+ id: string;
1146
+ name: string;
1147
+ type: string;
1148
+ url: string;
1149
+ }>;
1150
+ }>;
1151
+ /**
1152
+ * @deprecated Use ndpcContact instead. Kept for backward compatibility.
1153
+ */
1154
+ nitdaContact?: {
1155
+ name: string;
1156
+ email: string;
1157
+ phone?: string;
1158
+ };
1159
+ }
1160
+
1161
+ declare interface RegulatoryReference {
1162
+ section: string;
1163
+ title: string;
1164
+ url?: string;
1165
+ }
1166
+
1167
+ /**
1168
+ * Legacy status of a data subject request
1169
+ * @deprecated Use DSRStatus instead
1170
+ */
1171
+ declare type RequestStatus = 'pending' | 'verifying' | 'processing' | 'completed' | 'rejected';
1172
+
1173
+ /**
1174
+ * Represents a type of data subject request (detailed configuration)
1175
+ */
1176
+ declare interface RequestType {
1177
+ /** Unique identifier for the request type */
1178
+ id: string;
1179
+ /** Display name for the request type */
1180
+ name: string;
1181
+ /** Description of what this request type entails */
1182
+ description: string;
1183
+ /**
1184
+ * NDPA section reference (e.g., "Section 30" for access requests)
1185
+ */
1186
+ ndpaSection?: string;
1187
+ /**
1188
+ * Estimated time to fulfill this type of request (in days)
1189
+ * NDPA requires response within 30 days
1190
+ */
1191
+ estimatedCompletionTime: number;
1192
+ /** Whether additional information is required for this request type */
1193
+ requiresAdditionalInfo: boolean;
1194
+ /** Custom fields required for this request type */
1195
+ additionalFields?: Array<{
1196
+ id: string;
1197
+ label: string;
1198
+ type: 'text' | 'textarea' | 'select' | 'checkbox' | 'file';
1199
+ options?: string[];
1200
+ required: boolean;
1201
+ placeholder?: string;
1202
+ }>;
1203
+ }
1204
+
1205
+ /**
1206
+ * Represents a risk assessment for a data breach
1207
+ */
1208
+ export declare interface RiskAssessment {
1209
+ /** Unique identifier for the risk assessment */
1210
+ id: string;
1211
+ /** ID of the breach this assessment is for */
1212
+ breachId: string;
1213
+ /** Timestamp when the assessment was conducted */
1214
+ assessedAt: number;
1215
+ /** Person who conducted the assessment */
1216
+ assessor: {
1217
+ name: string;
1218
+ role: string;
1219
+ email: string;
1220
+ };
1221
+ /** Confidentiality impact (1-5) */
1222
+ confidentialityImpact: number;
1223
+ /** Integrity impact (1-5) */
1224
+ integrityImpact: number;
1225
+ /** Availability impact (1-5) */
1226
+ availabilityImpact: number;
1227
+ /** Likelihood of harm to data subjects (1-5) */
1228
+ harmLikelihood: number;
1229
+ /** Severity of potential harm to data subjects (1-5) */
1230
+ harmSeverity: number;
1231
+ /** Overall risk score */
1232
+ overallRiskScore: number;
1233
+ /** Risk level based on the overall score */
1234
+ riskLevel: 'low' | 'medium' | 'high' | 'critical';
1235
+ /** Whether the breach is likely to result in a risk to rights and freedoms */
1236
+ risksToRightsAndFreedoms: boolean;
1237
+ /** Whether the breach is likely to result in a high risk to rights and freedoms */
1238
+ highRisksToRightsAndFreedoms: boolean;
1239
+ /** Justification for the risk assessment */
1240
+ justification: string;
1241
+ }
1242
+
1243
+ /**
1244
+ * Compliance gap found in a processing record
1245
+ */
1246
+ declare interface ROPAComplianceGap {
1247
+ recordId: string;
1248
+ recordName: string;
1249
+ gaps: string[];
1250
+ }
1251
+
1252
+ /**
1253
+ * Summary statistics for the ROPA
1254
+ */
1255
+ export declare interface ROPASummary {
1256
+ /** Total number of processing records */
1257
+ totalRecords: number;
1258
+ /** Active processing records */
1259
+ activeRecords: number;
1260
+ /** Records by lawful basis */
1261
+ byLawfulBasis: Record<LawfulBasis, number>;
1262
+ /** Records involving sensitive data */
1263
+ sensitiveDataRecords: number;
1264
+ /** Records involving cross-border transfers */
1265
+ crossBorderRecords: number;
1266
+ /** Records requiring DPIA */
1267
+ dpiaRequiredRecords: number;
1268
+ /** Records involving automated decision-making */
1269
+ automatedDecisionRecords: number;
1270
+ /** Records due for review */
1271
+ recordsDueForReview: ProcessingRecord[];
1272
+ /** Departments with most processing activities */
1273
+ topDepartments: Array<{
1274
+ department: string;
1275
+ count: number;
1276
+ }>;
1277
+ /** Last updated timestamp */
1278
+ lastUpdated: number;
1279
+ }
1280
+
1281
+ /**
1282
+ * Additional conditions required for processing sensitive personal data
1283
+ * per NDPA Section 27
1284
+ */
1285
+ declare type SensitiveDataCondition = 'explicit_consent' | 'employment_law' | 'vital_interests_incapable' | 'nonprofit_legitimate' | 'publicly_available' | 'legal_claims' | 'substantial_public_interest' | 'health_purposes' | 'public_health' | 'archiving_research';
1286
+
1287
+ declare interface StorageAdapter<T = unknown> {
1288
+ /** Load persisted data. Called once on hook mount. */
1289
+ load(): T | null | Promise<T | null>;
1290
+ /** Persist data. Called on every state change. */
1291
+ save(data: T): void | Promise<void>;
1292
+ /** Clear persisted data. Called on reset. */
1293
+ remove(): void | Promise<void>;
1294
+ }
1295
+
1296
+ /** Full context used to generate an adaptive privacy policy. */
1297
+ declare interface TemplateContext {
1298
+ /** Organisation details, extended with industry and size. */
1299
+ org: OrganizationInfo & {
1300
+ industry: Industry;
1301
+ orgSize: OrgSize;
1302
+ country: string;
1303
+ };
1304
+ /** Data categories the organisation collects. */
1305
+ dataCategories: DataCategory[];
1306
+ /** Processing purposes relevant to the organisation. */
1307
+ purposes: ProcessingPurpose[];
1308
+ /** Whether the organisation processes children's data. */
1309
+ hasChildrenData: boolean;
1310
+ /** Whether the organisation processes sensitive/special-category data. */
1311
+ hasSensitiveData: boolean;
1312
+ /** Whether the organisation processes financial data. */
1313
+ hasFinancialData: boolean;
1314
+ /** Whether data is transferred outside Nigeria. */
1315
+ hasCrossBorderTransfer: boolean;
1316
+ /** Whether automated decision-making or profiling is used. */
1317
+ hasAutomatedDecisions: boolean;
1318
+ /** Third-party processors that receive personal data. */
1319
+ thirdPartyProcessors: ThirdPartyProcessor[];
1320
+ }
1321
+
1322
+ /** A third-party entity that processes data on behalf of the organisation. */
1323
+ declare interface ThirdPartyProcessor {
1324
+ /** Name of the third party. */
1325
+ name: string;
1326
+ /** Purpose of sharing data with this processor. */
1327
+ purpose: string;
1328
+ /** Country where the processor is located. */
1329
+ country: string;
1330
+ }
1331
+
1332
+ /**
1333
+ * Cross-Border Data Transfer types aligned with NDPA 2023 Part VI (Sections 41-45)
1334
+ * Personal data may only be transferred outside Nigeria under specific conditions
1335
+ */
1336
+ /**
1337
+ * Transfer mechanisms recognized under the NDPA
1338
+ */
1339
+ declare type TransferMechanism = 'adequacy_decision' | 'standard_clauses' | 'binding_corporate_rules' | 'ndpc_authorization' | 'explicit_consent' | 'contract_performance' | 'public_interest' | 'legal_claims' | 'vital_interests';
1340
+
1341
+ /**
1342
+ * Validation result for a cross-border transfer
1343
+ */
1344
+ declare interface TransferValidationResult {
1345
+ isValid: boolean;
1346
+ errors: string[];
1347
+ warnings: string[];
1348
+ }
1349
+
1350
+ export declare function useAdaptivePolicyWizard(options?: UseAdaptivePolicyWizardOptions): UseAdaptivePolicyWizardReturn;
1351
+
1352
+ export declare interface UseAdaptivePolicyWizardOptions {
1353
+ adapter?: StorageAdapter<PolicyDraft>;
1354
+ onComplete?: (policy: PrivacyPolicy) => void;
1355
+ onComplianceChange?: (score: number, gaps: ComplianceGap[]) => void;
1356
+ }
1357
+
1358
+ export declare interface UseAdaptivePolicyWizardReturn {
1359
+ currentStep: number;
1360
+ goToStep: (step: number) => void;
1361
+ nextStep: () => void;
1362
+ prevStep: () => void;
1363
+ canProceed: boolean;
1364
+ context: TemplateContext;
1365
+ updateContext: (updates: Partial<TemplateContext>) => void;
1366
+ updateOrg: (updates: Partial<TemplateContext['org']>) => void;
1367
+ toggleDataCategory: (categoryId: string) => void;
1368
+ togglePurpose: (purpose: string) => void;
1369
+ addProcessor: (processor: {
1370
+ name: string;
1371
+ purpose: string;
1372
+ country: string;
1373
+ }) => void;
1374
+ removeProcessor: (index: number) => void;
1375
+ policy: PrivacyPolicy | null;
1376
+ sections: PolicySection[];
1377
+ customSections: CustomSection[];
1378
+ addCustomSection: (section: Omit<CustomSection, 'id' | 'required'>) => void;
1379
+ updateCustomSection: (id: string, updates: Partial<CustomSection>) => void;
1380
+ removeCustomSection: (id: string) => void;
1381
+ reorderSections: (sectionId: string, direction: 'up' | 'down') => void;
1382
+ editSectionContent: (sectionId: string, content: string) => void;
1383
+ sectionOverrides: Record<string, string>;
1384
+ complianceScore: number;
1385
+ complianceResult: ComplianceResult;
1386
+ complianceGaps: ComplianceGap[];
1387
+ applyFix: (gapId: string) => void;
1388
+ handleExportPDF: (options?: PDFExportOptions) => Promise<Blob>;
1389
+ handleExportDOCX: (options?: DOCXExportOptions) => Promise<Blob>;
1390
+ handleExportHTML: (options?: HTMLExportOptions) => string;
1391
+ handleExportMarkdown: () => string;
1392
+ isDraftSaved: boolean;
1393
+ lastSavedAt: number | null;
1394
+ saveDraft: () => Promise<void>;
1395
+ discardDraft: () => void;
1396
+ isLoading: boolean;
1397
+ }
1398
+
1399
+ /**
1400
+ * Hook for managing data breach notifications in compliance with the NDPA (Section 40)
1401
+ */
1402
+ export declare function useBreach({ categories, initialReports, adapter, storageKey, useLocalStorage, onReport, onAssessment, onNotification, }: UseBreachOptions): UseBreachReturn;
1403
+
1404
+ declare interface UseBreachOptions {
1405
+ /**
1406
+ * Available breach categories
1407
+ */
1408
+ categories: BreachCategory[];
1409
+ /**
1410
+ * Initial breach reports
1411
+ */
1412
+ initialReports?: BreachReport[];
1413
+ /**
1414
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
1415
+ */
1416
+ adapter?: StorageAdapter<BreachCompositeState>;
1417
+ /**
1418
+ * Storage key for breach data
1419
+ * @default "ndpr_breach_data"
1420
+ * @deprecated Use adapter instead
1421
+ */
1422
+ storageKey?: string;
1423
+ /**
1424
+ * Whether to use local storage to persist breach data
1425
+ * @default true
1426
+ * @deprecated Use adapter instead
1427
+ */
1428
+ useLocalStorage?: boolean;
1429
+ /**
1430
+ * Callback function called when a breach is reported
1431
+ */
1432
+ onReport?: (report: BreachReport) => void;
1433
+ /**
1434
+ * Callback function called when a risk assessment is completed
1435
+ */
1436
+ onAssessment?: (assessment: RiskAssessment) => void;
1437
+ /**
1438
+ * Callback function called when a notification is sent
1439
+ */
1440
+ onNotification?: (notification: RegulatoryNotification) => void;
1441
+ }
1442
+
1443
+ declare interface UseBreachReturn {
1444
+ /**
1445
+ * All breach reports
1446
+ */
1447
+ reports: BreachReport[];
1448
+ /**
1449
+ * All risk assessments
1450
+ */
1451
+ assessments: RiskAssessment[];
1452
+ /**
1453
+ * All regulatory notifications
1454
+ */
1455
+ notifications: RegulatoryNotification[];
1456
+ /**
1457
+ * Submit a new breach report
1458
+ */
1459
+ reportBreach: (reportData: Omit<BreachReport, 'id' | 'reportedAt'>) => BreachReport;
1460
+ /**
1461
+ * Update an existing breach report
1462
+ */
1463
+ updateReport: (id: string, updates: Partial<BreachReport>) => BreachReport | null;
1464
+ /**
1465
+ * Get a breach report by ID
1466
+ */
1467
+ getReport: (id: string) => BreachReport | null;
1468
+ /**
1469
+ * Conduct a risk assessment for a breach
1470
+ */
1471
+ assessRisk: (breachId: string, assessmentData: Omit<RiskAssessment, 'id' | 'breachId' | 'assessedAt'>) => RiskAssessment;
1472
+ /**
1473
+ * Get a risk assessment for a breach
1474
+ */
1475
+ getAssessment: (breachId: string) => RiskAssessment | null;
1476
+ /**
1477
+ * Calculate notification requirements based on a risk assessment
1478
+ */
1479
+ calculateNotificationRequirements: (breachId: string) => NotificationRequirement | null;
1480
+ /**
1481
+ * Send a regulatory notification
1482
+ */
1483
+ sendNotification: (breachId: string, notificationData: Omit<RegulatoryNotification, 'id' | 'breachId' | 'sentAt'>) => RegulatoryNotification;
1484
+ /**
1485
+ * Get a regulatory notification for a breach
1486
+ */
1487
+ getNotification: (breachId: string) => RegulatoryNotification | null;
1488
+ /**
1489
+ * Get breaches that require notification within the next X hours
1490
+ */
1491
+ getBreachesRequiringNotification: (hoursThreshold?: number) => Array<{
1492
+ report: BreachReport;
1493
+ assessment: RiskAssessment;
1494
+ requirements: NotificationRequirement;
1495
+ hoursRemaining: number;
1496
+ }>;
1497
+ /**
1498
+ * Clear all breach data
1499
+ */
1500
+ clearBreachData: () => void;
1501
+ /**
1502
+ * Whether the adapter is still loading data (relevant for async adapters)
1503
+ */
1504
+ isLoading: boolean;
1505
+ }
1506
+
1507
+ export declare function useComplianceScore({ input }: UseComplianceScoreOptions): ComplianceReport;
1508
+
1509
+ declare interface UseComplianceScoreOptions {
1510
+ input: ComplianceInput;
1511
+ }
1512
+
1513
+ /**
1514
+ * Hook for managing user consent in compliance with NDPA
1515
+ */
1516
+ export declare function useConsent({ options, adapter, storageOptions, version, onChange, }: UseConsentOptions): UseConsentReturn;
1517
+
1518
+ declare interface UseConsentOptions {
1519
+ /**
1520
+ * Consent options to present to the user
1521
+ */
1522
+ options: ConsentOption[];
1523
+ /**
1524
+ * Pluggable storage adapter. When provided, takes precedence over storageOptions.
1525
+ */
1526
+ adapter?: StorageAdapter<ConsentSettings>;
1527
+ /**
1528
+ * Storage options for consent settings
1529
+ * @deprecated Use adapter instead
1530
+ */
1531
+ storageOptions?: ConsentStorageOptions;
1532
+ /**
1533
+ * Version of the consent form
1534
+ * @default "1.0"
1535
+ */
1536
+ version?: string;
1537
+ /**
1538
+ * Callback function called when consent settings change
1539
+ */
1540
+ onChange?: (settings: ConsentSettings) => void;
1541
+ }
1542
+
1543
+ declare interface UseConsentReturn {
1544
+ /**
1545
+ * Current consent settings
1546
+ */
1547
+ settings: ConsentSettings | null;
1548
+ /**
1549
+ * Whether consent has been given for a specific option
1550
+ */
1551
+ hasConsent: (optionId: string) => boolean;
1552
+ /**
1553
+ * Update consent settings
1554
+ */
1555
+ updateConsent: (consents: Record<string, boolean>) => void;
1556
+ /**
1557
+ * Accept all consent options
1558
+ */
1559
+ acceptAll: () => void;
1560
+ /**
1561
+ * Reject all non-required consent options
1562
+ */
1563
+ rejectAll: () => void;
1564
+ /**
1565
+ * Whether the consent banner should be shown
1566
+ */
1567
+ shouldShowBanner: boolean;
1568
+ /**
1569
+ * Whether consent settings are valid
1570
+ */
1571
+ isValid: boolean;
1572
+ /**
1573
+ * Validation errors (if any)
1574
+ */
1575
+ validationErrors: string[];
1576
+ /**
1577
+ * Reset consent settings (clear from storage)
1578
+ */
1579
+ resetConsent: () => void;
1580
+ /**
1581
+ * Whether the adapter is still loading data (relevant for async adapters)
1582
+ */
1583
+ isLoading: boolean;
1584
+ }
1585
+
1586
+ /**
1587
+ * Hook for managing cross-border data transfers in compliance with NDPA Part VI (Sections 41-45)
1588
+ */
1589
+ export declare function useCrossBorderTransfer({ initialTransfers, adapter, storageKey, useLocalStorage, onAdd, onUpdate, onRemove, }?: UseCrossBorderTransferOptions): UseCrossBorderTransferReturn;
1590
+
1591
+ declare interface UseCrossBorderTransferOptions {
1592
+ /**
1593
+ * Initial transfers to load
1594
+ */
1595
+ initialTransfers?: CrossBorderTransfer[];
1596
+ /**
1597
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
1598
+ */
1599
+ adapter?: StorageAdapter<CrossBorderTransfer[]>;
1600
+ /**
1601
+ * Storage key for transfer data
1602
+ * @default "ndpr_cross_border_transfers"
1603
+ * @deprecated Use adapter instead
1604
+ */
1605
+ storageKey?: string;
1606
+ /**
1607
+ * Whether to use local storage to persist transfers
1608
+ * @default true
1609
+ * @deprecated Use adapter instead
1610
+ */
1611
+ useLocalStorage?: boolean;
1612
+ /**
1613
+ * Callback function called when a transfer is added
1614
+ */
1615
+ onAdd?: (transfer: CrossBorderTransfer) => void;
1616
+ /**
1617
+ * Callback function called when a transfer is updated
1618
+ */
1619
+ onUpdate?: (transfer: CrossBorderTransfer) => void;
1620
+ /**
1621
+ * Callback function called when a transfer is removed
1622
+ */
1623
+ onRemove?: (id: string) => void;
1624
+ }
1625
+
1626
+ declare interface UseCrossBorderTransferReturn {
1627
+ /**
1628
+ * All cross-border transfers
1629
+ */
1630
+ transfers: CrossBorderTransfer[];
1631
+ /**
1632
+ * Add a new cross-border transfer
1633
+ */
1634
+ addTransfer: (transfer: Omit<CrossBorderTransfer, 'id' | 'createdAt' | 'updatedAt'>) => CrossBorderTransfer;
1635
+ /**
1636
+ * Update an existing cross-border transfer
1637
+ */
1638
+ updateTransfer: (id: string, updates: Partial<CrossBorderTransfer>) => CrossBorderTransfer | null;
1639
+ /**
1640
+ * Remove a cross-border transfer
1641
+ */
1642
+ removeTransfer: (id: string) => void;
1643
+ /**
1644
+ * Get a cross-border transfer by ID
1645
+ */
1646
+ getTransfer: (id: string) => CrossBorderTransfer | null;
1647
+ /**
1648
+ * Get a compliance summary of all cross-border transfers
1649
+ */
1650
+ getSummary: () => CrossBorderSummary;
1651
+ /**
1652
+ * Validate a cross-border transfer
1653
+ */
1654
+ validateTransfer: (transfer: CrossBorderTransfer) => TransferValidationResult;
1655
+ /**
1656
+ * Whether the adapter is still loading data (relevant for async adapters)
1657
+ */
1658
+ isLoading: boolean;
1659
+ }
1660
+
1661
+ /**
1662
+ * Convenience wrapper around `usePrivacyPolicy`. With `orgInfo` provided
1663
+ * and `autoGenerate` enabled (default), `policy` is non-null on the first
1664
+ * post-load render — no manual `selectTemplate` / `generatePolicy` chaining
1665
+ * required.
1666
+ *
1667
+ * @example
1668
+ * ```tsx
1669
+ * const { policy } = useDefaultPrivacyPolicy({
1670
+ * orgInfo: { name: 'Acme Ltd', email: 'privacy@acme.ng' }
1671
+ * });
1672
+ * return policy ? <PolicyPage policy={policy} /> : <Spinner />;
1673
+ * ```
1674
+ */
1675
+ export declare function useDefaultPrivacyPolicy(options?: UseDefaultPrivacyPolicyOptions): UsePrivacyPolicyReturn;
1676
+
1677
+ declare interface UseDefaultPrivacyPolicyOptions {
1678
+ /**
1679
+ * Organisation information to pre-fill into the policy. When provided and
1680
+ * `autoGenerate` is true (the default), the hook will auto-select the
1681
+ * default template and generate a renderable policy on first commit, so
1682
+ * `policy` is non-null on the first useful render.
1683
+ */
1684
+ orgInfo?: {
1685
+ /** Organisation name (maps to `organizationInfo.name` and `orgName` variable) */
1686
+ name?: string;
1687
+ /** Privacy contact email (maps to `privacyEmail`) */
1688
+ email?: string;
1689
+ /** Organisation website URL */
1690
+ website?: string;
1691
+ /** Physical address */
1692
+ address?: string;
1693
+ /** Industry / sector descriptor */
1694
+ industry?: string;
1695
+ /** Data Protection Officer name */
1696
+ dpoName?: string;
1697
+ /** DPO email address */
1698
+ dpoEmail?: string;
1699
+ };
1700
+ /**
1701
+ * Whether the hook should auto-select the default template and generate
1702
+ * the policy as soon as it's mounted with `orgInfo`. Set to false to
1703
+ * retain manual control via `selectTemplate` / `generatePolicy`.
1704
+ * @default true
1705
+ */
1706
+ autoGenerate?: boolean;
1707
+ /**
1708
+ * Storage key for policy data.
1709
+ * @default "ndpr_privacy_policy"
1710
+ */
1711
+ storageKey?: string;
1712
+ /**
1713
+ * Whether to persist policy data in storage. When `false`, the hook
1714
+ * uses an in-memory no-op adapter and nothing survives a page reload.
1715
+ * @default true
1716
+ */
1717
+ persist?: boolean;
1718
+ /**
1719
+ * @deprecated Renamed to `persist` in v3.5.0 — `useLocalStorage` is
1720
+ * still accepted for backward compatibility and will be removed in
1721
+ * v4.0. Use `persist` (or pass an explicit `adapter`) instead.
1722
+ * @default true
1723
+ */
1724
+ useLocalStorage?: boolean;
1725
+ /**
1726
+ * Pluggable storage adapter. When provided, takes precedence over
1727
+ * storageKey/persist/useLocalStorage.
1728
+ */
1729
+ adapter?: StorageAdapter<PrivacyPolicy>;
1730
+ }
1731
+
1732
+ /**
1733
+ * Hook for conducting Data Protection Impact Assessments in compliance with the NDPA 2023
1734
+ */
1735
+ export declare function useDPIA({ sections, initialAnswers, adapter, storageKey, useLocalStorage, onComplete, }: UseDPIAOptions): UseDPIAReturn;
1736
+
1737
+ declare interface UseDPIAOptions {
1738
+ /**
1739
+ * Sections of the DPIA questionnaire
1740
+ */
1741
+ sections: DPIASection[];
1742
+ /**
1743
+ * Initial answers (if resuming a DPIA)
1744
+ */
1745
+ initialAnswers?: DPIAAnswerMap;
1746
+ /**
1747
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
1748
+ */
1749
+ adapter?: StorageAdapter<DPIAAnswerMap>;
1750
+ /**
1751
+ * Storage key for DPIA data
1752
+ * @default "ndpr_dpia_data"
1753
+ * @deprecated Use adapter instead
1754
+ */
1755
+ storageKey?: string;
1756
+ /**
1757
+ * Whether to use local storage to persist DPIA data
1758
+ * @default true
1759
+ * @deprecated Use adapter instead
1760
+ */
1761
+ useLocalStorage?: boolean;
1762
+ /**
1763
+ * Callback function called when the DPIA is completed
1764
+ */
1765
+ onComplete?: (result: DPIAResult) => void;
1766
+ }
1767
+
1768
+ declare interface UseDPIAReturn {
1769
+ /**
1770
+ * Current section index
1771
+ */
1772
+ currentSectionIndex: number;
1773
+ /**
1774
+ * Current section
1775
+ */
1776
+ currentSection: DPIASection | null;
1777
+ /**
1778
+ * All answers
1779
+ */
1780
+ answers: DPIAAnswerMap;
1781
+ /**
1782
+ * Update an answer
1783
+ */
1784
+ updateAnswer: (questionId: string, value: DPIAAnswerValue) => void;
1785
+ /**
1786
+ * Go to the next section
1787
+ */
1788
+ nextSection: () => boolean;
1789
+ /**
1790
+ * Go to the previous section
1791
+ */
1792
+ prevSection: () => boolean;
1793
+ /**
1794
+ * Go to a specific section
1795
+ */
1796
+ goToSection: (index: number) => boolean;
1797
+ /**
1798
+ * Check if the current section is valid
1799
+ */
1800
+ isCurrentSectionValid: () => boolean;
1801
+ /**
1802
+ * Get validation errors for the current section
1803
+ */
1804
+ getCurrentSectionErrors: () => Record<string, string>;
1805
+ /**
1806
+ * Check if the DPIA is complete
1807
+ */
1808
+ isComplete: () => boolean;
1809
+ /**
1810
+ * Complete the DPIA and generate a result
1811
+ */
1812
+ completeDPIA: (assessorInfo: {
1813
+ name: string;
1814
+ role: string;
1815
+ email: string;
1816
+ }, title: string, processingDescription: string) => DPIAResult;
1817
+ /**
1818
+ * Get the visible questions for the current section
1819
+ */
1820
+ getVisibleQuestions: () => DPIAQuestion[];
1821
+ /**
1822
+ * Reset the DPIA
1823
+ */
1824
+ resetDPIA: () => void;
1825
+ /**
1826
+ * Progress percentage
1827
+ */
1828
+ progress: number;
1829
+ /**
1830
+ * Whether the adapter is still loading data (relevant for async adapters)
1831
+ */
1832
+ isLoading: boolean;
1833
+ }
1834
+
1835
+ /**
1836
+ * Hook for managing Data Subject Requests in compliance with the NDPA
1837
+ */
1838
+ export declare function useDSR({ initialRequests, requestTypes, adapter, storageKey, useLocalStorage, onSubmit, onUpdate, }: UseDSROptions): UseDSRReturn;
1839
+
1840
+ declare interface UseDSROptions {
1841
+ /**
1842
+ * Initial requests to load
1843
+ */
1844
+ initialRequests?: DSRRequest[];
1845
+ /**
1846
+ * Available request types
1847
+ */
1848
+ requestTypes: RequestType[];
1849
+ /**
1850
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
1851
+ */
1852
+ adapter?: StorageAdapter<DSRRequest[]>;
1853
+ /**
1854
+ * Storage key for requests
1855
+ * @default "ndpr_dsr_requests"
1856
+ * @deprecated Use adapter instead
1857
+ */
1858
+ storageKey?: string;
1859
+ /**
1860
+ * Whether to use local storage to persist requests
1861
+ * @default true
1862
+ * @deprecated Use adapter instead
1863
+ */
1864
+ useLocalStorage?: boolean;
1865
+ /**
1866
+ * Callback function called when a request is submitted
1867
+ */
1868
+ onSubmit?: (request: DSRRequest) => void;
1869
+ /**
1870
+ * Callback function called when a request is updated
1871
+ */
1872
+ onUpdate?: (request: DSRRequest) => void;
1873
+ }
1874
+
1875
+ declare interface UseDSRReturn {
1876
+ /**
1877
+ * All requests
1878
+ */
1879
+ requests: DSRRequest[];
1880
+ /**
1881
+ * Submit a new request
1882
+ */
1883
+ submitRequest: (requestData: Omit<DSRRequest, 'id' | 'status' | 'submittedAt' | 'updatedAt' | 'estimatedCompletionDate'>) => DSRRequest;
1884
+ /**
1885
+ * Update an existing request
1886
+ */
1887
+ updateRequest: (id: string, updates: Partial<DSRRequest>) => DSRRequest | null;
1888
+ /**
1889
+ * Get a request by ID
1890
+ */
1891
+ getRequest: (id: string) => DSRRequest | null;
1892
+ /**
1893
+ * Get requests by status
1894
+ */
1895
+ getRequestsByStatus: (status: RequestStatus) => DSRRequest[];
1896
+ /**
1897
+ * Get requests by type
1898
+ */
1899
+ getRequestsByType: (type: string) => DSRRequest[];
1900
+ /**
1901
+ * Get the request type definition by ID
1902
+ */
1903
+ getRequestType: (typeId: string) => RequestType | undefined;
1904
+ /**
1905
+ * Format a request for display or submission
1906
+ */
1907
+ formatRequest: (request: DSRRequest) => Record<string, unknown>;
1908
+ /**
1909
+ * Clear all requests
1910
+ */
1911
+ clearRequests: () => void;
1912
+ /**
1913
+ * Whether the adapter is still loading data (relevant for async adapters)
1914
+ */
1915
+ isLoading: boolean;
1916
+ }
1917
+
1918
+ /**
1919
+ * Hook for managing lawful basis documentation for processing activities
1920
+ * in compliance with NDPA 2023 Section 25.
1921
+ */
1922
+ export declare function useLawfulBasis({ initialActivities, adapter, storageKey, useLocalStorage, onAdd, onUpdate, onRemove, }?: UseLawfulBasisOptions): UseLawfulBasisReturn;
1923
+
1924
+ declare interface UseLawfulBasisOptions {
1925
+ /**
1926
+ * Initial processing activities to load
1927
+ */
1928
+ initialActivities?: ProcessingActivity[];
1929
+ /**
1930
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
1931
+ */
1932
+ adapter?: StorageAdapter<ProcessingActivity[]>;
1933
+ /**
1934
+ * Storage key for persisting activities
1935
+ * @default "ndpr_lawful_basis_activities"
1936
+ * @deprecated Use adapter instead
1937
+ */
1938
+ storageKey?: string;
1939
+ /**
1940
+ * Whether to use local storage to persist activities
1941
+ * @default true
1942
+ * @deprecated Use adapter instead
1943
+ */
1944
+ useLocalStorage?: boolean;
1945
+ /**
1946
+ * Callback when an activity is added
1947
+ */
1948
+ onAdd?: (activity: ProcessingActivity) => void;
1949
+ /**
1950
+ * Callback when an activity is updated
1951
+ */
1952
+ onUpdate?: (activity: ProcessingActivity) => void;
1953
+ /**
1954
+ * Callback when an activity is removed
1955
+ */
1956
+ onRemove?: (id: string) => void;
1957
+ }
1958
+
1959
+ declare interface UseLawfulBasisReturn {
1960
+ /**
1961
+ * All processing activities
1962
+ */
1963
+ activities: ProcessingActivity[];
1964
+ /**
1965
+ * Add a new processing activity
1966
+ */
1967
+ addActivity: (activity: Omit<ProcessingActivity, 'id' | 'createdAt' | 'updatedAt'>) => ProcessingActivity;
1968
+ /**
1969
+ * Update an existing processing activity
1970
+ */
1971
+ updateActivity: (id: string, updates: Partial<ProcessingActivity>) => ProcessingActivity | null;
1972
+ /**
1973
+ * Remove a processing activity
1974
+ */
1975
+ removeActivity: (id: string) => void;
1976
+ /**
1977
+ * Get a specific processing activity by ID
1978
+ */
1979
+ getActivity: (id: string) => ProcessingActivity | null;
1980
+ /**
1981
+ * Get a summary of all lawful basis documentation
1982
+ */
1983
+ getSummary: () => LawfulBasisSummary;
1984
+ /**
1985
+ * Validate a processing activity
1986
+ */
1987
+ validateActivity: (activity: ProcessingActivity) => LawfulBasisValidationResult;
1988
+ /**
1989
+ * Whether the adapter is still loading data (relevant for async adapters)
1990
+ */
1991
+ isLoading: boolean;
1992
+ }
1993
+
1994
+ /**
1995
+ * Hook for generating NDPA-compliant privacy policies
1996
+ */
1997
+ export declare function usePrivacyPolicy({ templates, initialPolicy, adapter, storageKey, persist, useLocalStorage, onGenerate, }: UsePrivacyPolicyOptions): UsePrivacyPolicyReturn;
1998
+
1999
+ declare interface UsePrivacyPolicyOptions {
2000
+ /**
2001
+ * Available policy templates
2002
+ */
2003
+ templates: PolicyTemplate[];
2004
+ /**
2005
+ * Initial policy data (if editing an existing policy)
2006
+ */
2007
+ initialPolicy?: PrivacyPolicy;
2008
+ /**
2009
+ * Pluggable storage adapter. When provided, takes precedence over storageKey/useLocalStorage.
2010
+ */
2011
+ adapter?: StorageAdapter<PrivacyPolicy>;
2012
+ /**
2013
+ * Storage key for policy data
2014
+ * @default "ndpr_privacy_policy"
2015
+ * @deprecated Use adapter instead
2016
+ */
2017
+ storageKey?: string;
2018
+ /**
2019
+ * Whether to persist policy data in storage. When `false`, the hook
2020
+ * uses an in-memory no-op adapter and nothing survives a page reload.
2021
+ * Prefer `adapter` for richer control (custom backends, async APIs).
2022
+ *
2023
+ * @default true
2024
+ */
2025
+ persist?: boolean;
2026
+ /**
2027
+ * @deprecated Renamed to `persist` in v3.5.0 — `useLocalStorage` is
2028
+ * still accepted for backward compatibility and will be removed in
2029
+ * v4.0. Use `persist` (or pass an explicit `adapter`) instead.
2030
+ * @default true
2031
+ */
2032
+ useLocalStorage?: boolean;
2033
+ /**
2034
+ * Callback function called when a policy is generated
2035
+ */
2036
+ onGenerate?: (policy: PrivacyPolicy) => void;
2037
+ }
2038
+
2039
+ declare interface UsePrivacyPolicyReturn {
2040
+ /**
2041
+ * Current policy data
2042
+ */
2043
+ policy: PrivacyPolicy | null;
2044
+ /**
2045
+ * Selected template
2046
+ */
2047
+ selectedTemplate: PolicyTemplate | null;
2048
+ /**
2049
+ * Organization information
2050
+ */
2051
+ organizationInfo: OrganizationInfo;
2052
+ /**
2053
+ * Select a template
2054
+ */
2055
+ selectTemplate: (templateId: string) => boolean;
2056
+ /**
2057
+ * Update organization information
2058
+ */
2059
+ updateOrganizationInfo: (updates: Partial<OrganizationInfo>) => void;
2060
+ /**
2061
+ * Toggle whether a section is included in the policy
2062
+ */
2063
+ toggleSection: (sectionId: string, included: boolean) => void;
2064
+ /**
2065
+ * Update section content
2066
+ */
2067
+ updateSectionContent: (sectionId: string, content: string) => void;
2068
+ /**
2069
+ * Update variable values
2070
+ */
2071
+ updateVariableValue: (variable: string, value: string) => void;
2072
+ /**
2073
+ * Generate the policy
2074
+ */
2075
+ generatePolicy: () => PrivacyPolicy | null;
2076
+ /**
2077
+ * Get the generated policy text
2078
+ */
2079
+ getPolicyText: () => {
2080
+ fullText: string;
2081
+ sectionTexts: Record<string, string>;
2082
+ missingVariables: string[];
2083
+ };
2084
+ /**
2085
+ * Reset the policy
2086
+ */
2087
+ resetPolicy: () => void;
2088
+ /**
2089
+ * Check if the policy is valid
2090
+ */
2091
+ isValid: () => {
2092
+ valid: boolean;
2093
+ errors: string[];
2094
+ };
2095
+ /**
2096
+ * Whether the adapter is still loading data (relevant for async adapters)
2097
+ */
2098
+ isLoading: boolean;
2099
+ }
2100
+
2101
+ /**
2102
+ * Hook for managing a Record of Processing Activities (ROPA)
2103
+ * in compliance with NDPA 2023 requirements.
2104
+ *
2105
+ * Provides state management and utility functions for maintaining
2106
+ * a comprehensive register of all data processing activities.
2107
+ */
2108
+ export declare function useROPA({ initialData, adapter, onRecordAdd, onRecordUpdate, onRecordArchive, }: UseROPAOptions): UseROPAReturn;
2109
+
2110
+ export declare interface UseROPAOptions {
2111
+ /**
2112
+ * Initial ROPA state
2113
+ */
2114
+ initialData: RecordOfProcessingActivities;
2115
+ /**
2116
+ * Pluggable storage adapter. When provided, adapter data is loaded on mount
2117
+ * and the ROPA is persisted after every mutation. Falls back to initialData
2118
+ * when no adapter data is found.
2119
+ */
2120
+ adapter?: StorageAdapter<RecordOfProcessingActivities>;
2121
+ /**
2122
+ * Callback when a record is added
2123
+ */
2124
+ onRecordAdd?: (record: ProcessingRecord) => void;
2125
+ /**
2126
+ * Callback when a record is updated
2127
+ */
2128
+ onRecordUpdate?: (id: string, updates: Partial<ProcessingRecord>) => void;
2129
+ /**
2130
+ * Callback when a record is archived
2131
+ */
2132
+ onRecordArchive?: (id: string) => void;
2133
+ }
2134
+
2135
+ export declare interface UseROPAReturn {
2136
+ /**
2137
+ * Current state of the Record of Processing Activities
2138
+ */
2139
+ ropa: RecordOfProcessingActivities;
2140
+ /**
2141
+ * Add a new processing record
2142
+ */
2143
+ addRecord: (record: ProcessingRecord) => void;
2144
+ /**
2145
+ * Update an existing processing record
2146
+ */
2147
+ updateRecord: (id: string, updates: Partial<ProcessingRecord>) => void;
2148
+ /**
2149
+ * Archive a processing record by setting its status to 'archived'
2150
+ */
2151
+ archiveRecord: (id: string) => void;
2152
+ /**
2153
+ * Get a single processing record by ID
2154
+ */
2155
+ getRecord: (id: string) => ProcessingRecord | undefined;
2156
+ /**
2157
+ * Get a summary of the ROPA including statistics
2158
+ */
2159
+ getSummary: () => ROPASummary;
2160
+ /**
2161
+ * Export the ROPA as a CSV string
2162
+ */
2163
+ exportCSV: () => string;
2164
+ /**
2165
+ * Identify compliance gaps across all records
2166
+ */
2167
+ getComplianceGaps: () => ROPAComplianceGap[];
2168
+ /**
2169
+ * Whether the adapter is still loading data (relevant for async adapters)
2170
+ */
2171
+ isLoading: boolean;
2172
+ }
2173
+
2174
+ export { }