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