@finspringinnovations/fdsdk 0.0.1 → 0.0.2

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 (60) hide show
  1. package/lib/components/AmountInput.js +1 -2
  2. package/lib/components/CheckboxOption.js +3 -3
  3. package/lib/components/CompanyHeader.js +40 -36
  4. package/lib/components/InterestRateCard.js +3 -2
  5. package/lib/components/OTPInput.js +1 -1
  6. package/lib/components/PaymentDetailsCard.js +8 -7
  7. package/lib/components/PendingFDBottomSheet.js +8 -8
  8. package/lib/components/TextFieldWithLabel.js +1 -1
  9. package/lib/components/TrustBox.js +2 -2
  10. package/lib/config/appDataConfig.d.ts +50 -0
  11. package/lib/config/appDataConfig.js +34 -1
  12. package/lib/hooks/usePaymentSSE.d.ts +27 -0
  13. package/lib/hooks/usePaymentSSE.js +251 -0
  14. package/lib/hooks/usePaymentStatusTimer.d.ts +25 -0
  15. package/lib/hooks/usePaymentStatusTimer.js +122 -0
  16. package/lib/index.d.ts +2 -2
  17. package/lib/index.js +5 -2
  18. package/lib/navigation/RootNavigator.js +5 -0
  19. package/lib/navigation/index.d.ts +2 -0
  20. package/lib/navigation/index.js +13 -11
  21. package/lib/screens/FDCalculator.js +35 -34
  22. package/lib/screens/FDList.js +10 -12
  23. package/lib/screens/NomineeDetail.js +28 -22
  24. package/lib/screens/PayNow.js +6 -6
  25. package/lib/screens/Payment.d.ts +1 -0
  26. package/lib/screens/Payment.js +75 -28
  27. package/lib/screens/PaymentStatus.js +33 -42
  28. package/lib/screens/ReviewKYC.js +2 -2
  29. package/lib/theme/ThemeContext.d.ts +2 -0
  30. package/lib/theme/ThemeContext.js +4 -2
  31. package/lib/theme/index.d.ts +6 -1
  32. package/lib/theme/index.js +24 -8
  33. package/lib/utils/sseParser.d.ts +7 -0
  34. package/lib/utils/sseParser.js +27 -0
  35. package/package.json +2 -2
  36. package/src/components/AmountInput.tsx +5 -1
  37. package/src/components/CheckboxOption.tsx +3 -3
  38. package/src/components/CompanyHeader.tsx +50 -44
  39. package/src/components/InterestRateCard.tsx +3 -2
  40. package/src/components/OTPInput.tsx +1 -1
  41. package/src/components/PaymentDetailsCard.tsx +45 -40
  42. package/src/components/PendingFDBottomSheet.tsx +8 -8
  43. package/src/components/TextFieldWithLabel.tsx +1 -1
  44. package/src/components/TrustBox.tsx +2 -2
  45. package/src/config/appDataConfig.ts +64 -0
  46. package/src/hooks/usePaymentSSE.ts +286 -0
  47. package/src/hooks/usePaymentStatusTimer.ts +169 -0
  48. package/src/index.tsx +4 -1
  49. package/src/navigation/RootNavigator.tsx +6 -0
  50. package/src/navigation/index.tsx +16 -17
  51. package/src/screens/FDCalculator.tsx +37 -38
  52. package/src/screens/FDList.tsx +11 -11
  53. package/src/screens/NomineeDetail.tsx +28 -21
  54. package/src/screens/PayNow.tsx +7 -7
  55. package/src/screens/Payment.tsx +91 -35
  56. package/src/screens/PaymentStatus.tsx +44 -57
  57. package/src/screens/ReviewKYC.tsx +2 -2
  58. package/src/theme/ThemeContext.tsx +6 -1
  59. package/src/theme/index.ts +30 -8
  60. package/src/utils/sseParser.ts +40 -0
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const react_native_1 = require("react-native");
8
- const Ionicons_1 = __importDefault(require("react-native-vector-icons/Ionicons"));
9
8
  const base64Images_1 = require("../constants/strings/base64Images");
10
9
  const ThemeContext_1 = require("../theme/ThemeContext");
11
10
  const theme_1 = require("../theme");
@@ -40,7 +39,7 @@ const AmountInput = ({ label, value, onChangeText, onBlur, onFocus, placeholder
40
39
  react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.error }, style: { width: 16, height: 16, marginRight: 6 }, resizeMode: "contain" }),
41
40
  react_1.default.createElement(react_native_1.Text, { style: styles.errorText }, errorMessage))),
42
41
  noteText && (react_1.default.createElement(react_native_1.View, { style: styles.noteRow },
43
- react_1.default.createElement(Ionicons_1.default, { name: "information-circle-outline", size: 14, color: themeName === 'dark' ? colors.labelColor : colors.textLight, style: styles.noteIcon }),
42
+ react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.info }, style: [styles.noteIcon, { width: 14, height: 14, tintColor: colors.textLight }], resizeMode: "contain" }),
44
43
  react_1.default.createElement(react_native_1.Text, { style: styles.noteText }, noteText))),
45
44
  minMaxText && (react_1.default.createElement(react_native_1.View, { style: styles.limitContainer },
46
45
  react_1.default.createElement(react_native_1.Text, { style: styles.limitLabel }, "Min: "),
@@ -21,20 +21,20 @@ const createStyles = (colors, typography, themeName) => react_native_1.StyleShee
21
21
  flexDirection: 'row',
22
22
  alignItems: 'center',
23
23
  paddingVertical: 0,
24
+ paddingHorizontal: 5
24
25
  },
25
26
  checkbox: {
26
27
  width: 18,
27
28
  height: 18,
28
29
  borderRadius: 3,
29
30
  borderWidth: 1.5,
30
- borderColor: themeName === 'dark' ? colors.tabSelected : colors.primary,
31
+ borderColor: colors.inputBorder || colors.border,
31
32
  marginRight: 12,
32
33
  alignItems: 'center',
33
34
  justifyContent: 'center',
34
35
  },
35
36
  checkboxChecked: {
36
- // backgroundColor: colors.tabSelected,
37
- borderColor: colors.tabSelected,
37
+ borderColor: colors.inputBorder || colors.border,
38
38
  },
39
39
  label: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: colors.text, flex: 1 }),
40
40
  });
@@ -10,7 +10,8 @@ const base64Images_1 = require("../constants/strings/base64Images");
10
10
  const CompanyHeader = ({ companyName, rating }) => {
11
11
  const colors = (0, ThemeContext_1.useColors)();
12
12
  const typography = (0, ThemeContext_1.useTypography)();
13
- const styles = createStyles(colors, typography);
13
+ const { themeName } = (0, ThemeContext_1.useTheme)();
14
+ const styles = createStyles(colors, typography, themeName);
14
15
  return (react_1.default.createElement(react_native_1.View, { style: styles.wrapper },
15
16
  react_1.default.createElement(react_native_1.View, { style: styles.card },
16
17
  react_1.default.createElement(react_native_1.View, { style: styles.innerBorder },
@@ -19,39 +20,42 @@ const CompanyHeader = ({ companyName, rating }) => {
19
20
  react_1.default.createElement(react_native_1.Text, { style: styles.name }, companyName),
20
21
  react_1.default.createElement(react_native_1.Text, { style: styles.rating }, rating))))));
21
22
  };
22
- const createStyles = (colors, typography) => react_native_1.StyleSheet.create({
23
- wrapper: {
24
- paddingHorizontal: 2,
25
- paddingTop: 12,
26
- paddingBottom: 8,
27
- },
28
- card: {
29
- backgroundColor: '#0B2940',
30
- borderRadius: 24,
31
- padding: 4,
32
- borderWidth: 1,
33
- borderColor: '#124061',
34
- shadowColor: '#000',
35
- shadowOpacity: 0.2,
36
- shadowOffset: { width: 0, height: 4 },
37
- shadowRadius: 12,
38
- elevation: 4,
39
- },
40
- innerBorder: {
41
- borderRadius: 20,
42
- padding: 16,
43
- flexDirection: 'row',
44
- alignItems: 'center',
45
- },
46
- logo: {
47
- width: 45,
48
- height: 45,
49
- marginRight: 12,
50
- },
51
- info: {
52
- flex: 1,
53
- },
54
- name: Object.assign(Object.assign({}, typography.styles.h2), { color: '#FFFFFF', marginBottom: 6 }),
55
- rating: Object.assign(Object.assign({}, typography.styles.text14Medium), { color: '#BFD5F6' }),
56
- });
23
+ const createStyles = (colors, typography, themeName) => {
24
+ const isDark = themeName === 'dark';
25
+ return react_native_1.StyleSheet.create({
26
+ wrapper: {
27
+ paddingHorizontal: 2,
28
+ paddingTop: 12,
29
+ paddingBottom: 8,
30
+ },
31
+ card: {
32
+ backgroundColor: isDark ? colors.headerBg : '#FFFFFF',
33
+ borderRadius: 24,
34
+ padding: 4,
35
+ borderWidth: 1,
36
+ borderColor: isDark ? colors.headerBg + 'AA' : colors.border + '40',
37
+ shadowColor: colors.shadow || '#000',
38
+ shadowOpacity: isDark ? 0.2 : 0.1,
39
+ shadowOffset: { width: 0, height: 4 },
40
+ shadowRadius: 12,
41
+ elevation: 4,
42
+ },
43
+ innerBorder: {
44
+ borderRadius: 20,
45
+ padding: 16,
46
+ flexDirection: 'row',
47
+ alignItems: 'center',
48
+ },
49
+ logo: {
50
+ width: 45,
51
+ height: 45,
52
+ marginRight: 12,
53
+ },
54
+ info: {
55
+ flex: 1,
56
+ },
57
+ name: Object.assign(Object.assign({}, typography.styles.h2), { color: isDark ? colors.headerText : colors.text, marginBottom: 6 }),
58
+ rating: Object.assign(Object.assign({}, typography.styles.text14Medium), { color: isDark ? colors.headerText : colors.primary, opacity: isDark ? 0.8 : 1 }),
59
+ });
60
+ };
57
61
  exports.default = CompanyHeader;
@@ -24,9 +24,10 @@ const InterestRateCard = ({ interestRate, maturityAmount, children, }) => {
24
24
  const createStyles = (colors, typography, themeName) => react_native_1.StyleSheet.create({
25
25
  card: {
26
26
  backgroundColor: themeName === 'dark' ? colors.inputBackground : 'rgba(0,235,180,0.1)',
27
- padding: 16,
27
+ paddingVertical: 16,
28
28
  borderRadius: 4,
29
29
  marginTop: 25,
30
+ paddingHorizontal: 12,
30
31
  },
31
32
  row: {
32
33
  flexDirection: 'row',
@@ -39,7 +40,7 @@ const createStyles = (colors, typography, themeName) => react_native_1.StyleShee
39
40
  flex: 1,
40
41
  alignItems: 'flex-end',
41
42
  },
42
- label: Object.assign(Object.assign({}, typography.styles.bodySmall), { color: themeName === 'dark' ? colors.labelColor : colors.textLight, marginBottom: 4 }),
43
+ label: Object.assign(Object.assign({}, typography.styles.bodySmall), { color: colors.textLight, marginBottom: 4 }),
43
44
  value: Object.assign(Object.assign({}, typography.styles.bodyLarge), { fontWeight: '600', color: colors.text }),
44
45
  valueRight: Object.assign(Object.assign({}, typography.styles.bodyLarge), { fontWeight: '700', color: colors.text }),
45
46
  });
@@ -117,7 +117,7 @@ const createStyles = (colors, typography, themeName) => react_native_1.StyleShee
117
117
  marginBottom: 16,
118
118
  gap: 8,
119
119
  },
120
- otpInput: Object.assign(Object.assign({ width: 48, height: 48, borderWidth: 1, borderColor: themeName === 'dark' ? colors.inputBorder : colors.primary, borderRadius: 8 }, typography.styles.bodyLarge), { color: colors.text, backgroundColor: themeName === 'dark' ? colors.inputBackground : 'white' }),
120
+ otpInput: Object.assign(Object.assign({ width: 48, height: 48, borderWidth: 1, borderColor: colors.inputBorder || colors.border, borderRadius: 8 }, typography.styles.bodyLarge), { color: colors.text, backgroundColor: themeName === 'dark' ? colors.inputBackground : 'white' }),
121
121
  otpInputError: {
122
122
  borderColor: colors.error,
123
123
  borderWidth: 2,
@@ -35,20 +35,21 @@ const PaymentDetailsCard = ({ companyName, amount, fdRate, tenure, interestPayou
35
35
  };
36
36
  const createStyles = (colors, typography, themeName) => {
37
37
  var _a, _b, _c, _d;
38
+ const isDark = themeName === 'dark';
38
39
  return react_native_1.StyleSheet.create({
39
40
  card: {
40
- backgroundColor: themeName === 'dark' ? '#0B2940' : '#0B2940',
41
+ backgroundColor: isDark ? colors.headerBg : 'rgba(0,235,180,0.1)',
41
42
  borderRadius: 16,
42
43
  padding: 20,
43
44
  alignItems: 'flex-start',
44
45
  marginHorizontal: 16,
45
- borderWidth: 1,
46
- borderColor: '#1F4C73',
46
+ borderWidth: isDark ? 1 : 0,
47
+ borderColor: isDark ? colors.headerBg + 'AA' : 'transparent',
47
48
  },
48
- companyName: Object.assign(Object.assign({}, typography.styles.h3), { color: '#FFFFFF', marginBottom: 12 }),
49
+ companyName: Object.assign(Object.assign({}, typography.styles.h3), { color: isDark ? colors.headerText : colors.text, marginBottom: 12 }),
49
50
  companyLine: {
50
51
  height: 1,
51
- backgroundColor: '#1F4C73',
52
+ backgroundColor: isDark ? colors.headerText + '33' : colors.border + '40',
52
53
  marginBottom: 12,
53
54
  width: '100%',
54
55
  },
@@ -61,8 +62,8 @@ const createStyles = (colors, typography, themeName) => {
61
62
  alignItems: 'center',
62
63
  paddingVertical: 8,
63
64
  },
64
- detailLabel: Object.assign(Object.assign({}, typography.styles.text12Regular), { color: '#BFD5F6' }),
65
- detailValue: Object.assign(Object.assign({}, typography.styles.text14Medium), { color: '#FFFFFF', lineHeight: ((_d = (_b = (_a = typography.styles.text14Medium) === null || _a === void 0 ? void 0 : _a.lineHeight) !== null && _b !== void 0 ? _b : (_c = typography.styles.text14Medium) === null || _c === void 0 ? void 0 : _c.fontSize) !== null && _d !== void 0 ? _d : 14) + 3 }),
65
+ detailLabel: Object.assign(Object.assign({}, typography.styles.text12Regular), { color: isDark ? colors.headerText : colors.text, opacity: isDark ? 0.7 : 1 }),
66
+ detailValue: Object.assign(Object.assign({}, typography.styles.text14Medium), { color: isDark ? colors.headerText : colors.text, lineHeight: ((_d = (_b = (_a = typography.styles.text14Medium) === null || _a === void 0 ? void 0 : _a.lineHeight) !== null && _b !== void 0 ? _b : (_c = typography.styles.text14Medium) === null || _c === void 0 ? void 0 : _c.fontSize) !== null && _d !== void 0 ? _d : 14) + 3 }),
66
67
  });
67
68
  };
68
69
  exports.default = PaymentDetailsCard;
@@ -47,11 +47,11 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
47
47
  },
48
48
  bottomSheet: {
49
49
  padding: spacing.sm,
50
- backgroundColor: themeName === 'dark' ? colors.background : 'white',
50
+ backgroundColor: colors.background,
51
51
  borderTopLeftRadius: 20,
52
52
  borderTopRightRadius: 20,
53
53
  borderWidth: themeName === 'dark' ? 1 : 0,
54
- borderColor: themeName === 'dark' ? '#ffffff' : 'transparent',
54
+ borderColor: themeName === 'dark' ? colors.border : 'transparent',
55
55
  maxHeight: react_native_1.Dimensions.get('window').height * 0.8,
56
56
  minHeight: react_native_1.Platform.OS === 'ios' ? 430 : 400,
57
57
  },
@@ -71,7 +71,7 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
71
71
  title: {
72
72
  fontSize: 17,
73
73
  fontWeight: '500',
74
- color: themeName === 'dark' ? colors.labelColor : '#333',
74
+ color: colors.text,
75
75
  flex: 1,
76
76
  marginRight: spacing.md,
77
77
  lineHeight: 24,
@@ -80,7 +80,7 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
80
80
  width: 32,
81
81
  height: 32,
82
82
  borderRadius: 16,
83
- backgroundColor: '#f5f5f5',
83
+ backgroundColor: colors.surface,
84
84
  justifyContent: 'center',
85
85
  alignItems: 'center',
86
86
  },
@@ -90,13 +90,13 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
90
90
  paddingTop: spacing.lg,
91
91
  paddingBottom: react_native_1.Platform.OS === 'ios' ? 20 : 0,
92
92
  },
93
- sectionTitle: Object.assign(Object.assign({}, typography.styles.h3), { color: themeName === 'dark' ? colors.labelColor : '#333', marginBottom: spacing.md }),
93
+ sectionTitle: Object.assign(Object.assign({}, typography.styles.h3), { color: colors.text, marginBottom: spacing.md }),
94
94
  bookNewButton: {
95
95
  marginTop: spacing.xxxl,
96
96
  marginBottom: spacing.xxxl,
97
97
  alignItems: 'center',
98
98
  },
99
- bookNewText: Object.assign(Object.assign({}, typography.styles.body2), { color: themeName === 'dark' ? colors.labelColor : '#000000' }),
99
+ bookNewText: Object.assign(Object.assign({}, typography.styles.body2), { color: colors.text }),
100
100
  disabledButton: {
101
101
  opacity: 0.6,
102
102
  },
@@ -110,13 +110,13 @@ const createStyles = (colors, typography, spacing, themeName) => react_native_1.
110
110
  },
111
111
  continueButton: {
112
112
  height: 50,
113
- backgroundColor: '#007AFF',
113
+ backgroundColor: colors.buttonBackground || colors.headerBg,
114
114
  borderRadius: 25,
115
115
  paddingHorizontal: spacing.lg,
116
116
  alignItems: 'center',
117
117
  justifyContent: 'center',
118
118
  marginBottom: react_native_1.Platform.OS === 'ios' ? spacing.lg + 20 : spacing.lg,
119
119
  },
120
- continueButtonText: Object.assign(Object.assign({}, typography.styles.button), { color: 'white', fontWeight: '600' }),
120
+ continueButtonText: Object.assign(Object.assign({}, typography.styles.button), { color: colors.buttonTextColor || colors.headerText, fontWeight: '600' }),
121
121
  });
122
122
  exports.default = PendingFDBottomSheet;
@@ -91,7 +91,7 @@ const TextFieldWithLabel = ({ label, value, onChangeText, placeholder, placehold
91
91
  return { borderColor: colors.success, borderWidth: 1 };
92
92
  }
93
93
  if (isFocused) {
94
- return { borderColor: colors.primary, borderWidth: 1 };
94
+ return { borderColor: colors.inputBorder || colors.border, borderWidth: 1 };
95
95
  }
96
96
  if (themeName === 'dark') {
97
97
  return {
@@ -39,7 +39,7 @@ const createStyles = (colors, typography, themeName) => react_native_1.StyleShee
39
39
  flexDirection: 'column',
40
40
  flex: 1,
41
41
  },
42
- titleLight: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: themeName === 'dark' ? '#C4CDD3' : colors.textLight, marginBottom: 0 }),
43
- title: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: themeName === 'dark' ? colors.labelColor : colors.textLight, marginBottom: 0 }),
42
+ titleLight: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: colors.textLight, marginBottom: 0 }),
43
+ title: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: colors.text, marginBottom: 0 }),
44
44
  });
45
45
  exports.default = TrustBox;
@@ -5,6 +5,35 @@ export interface EnvironmentData {
5
5
  encryptionKey?: string;
6
6
  enableLogging?: boolean;
7
7
  }
8
+ /**
9
+ * Custom color overrides that can be passed during SDK initialization.
10
+ * Any color defined here will override the corresponding color from the selected theme.
11
+ */
12
+ export interface CustomColors {
13
+ primary?: string;
14
+ tabSelected?: string;
15
+ headerBg?: string;
16
+ headerText?: string;
17
+ success?: string;
18
+ textSecondary?: string;
19
+ border?: string;
20
+ shadow?: string;
21
+ background?: string;
22
+ surface?: string;
23
+ text?: string;
24
+ textLight?: string;
25
+ error?: string;
26
+ warning?: string;
27
+ info?: string;
28
+ muted?: string;
29
+ inputBackground?: string;
30
+ inputBorder?: string;
31
+ placeholderColor?: string;
32
+ labelColor?: string;
33
+ buttonBackground?: string;
34
+ buttonTextColor?: string;
35
+ cancelButtonBg?: string;
36
+ }
8
37
  export interface AppData {
9
38
  id: string;
10
39
  name: string;
@@ -100,6 +129,27 @@ export declare const validateAppData: (appData: AppData) => {
100
129
  isValid: boolean;
101
130
  errors: string[];
102
131
  };
132
+ /**
133
+ * Set custom color overrides for the SDK theme.
134
+ * Colors defined here will override the corresponding color from the selected theme (primary/dark/corporate).
135
+ * Call this before rendering the SDK navigator.
136
+ *
137
+ * @example
138
+ * setSDKColors({
139
+ * primary: '#FF5722',
140
+ * headerBg: '#1976D2',
141
+ * buttonBackground: '#1976D2',
142
+ * });
143
+ */
144
+ export declare const setSDKColors: (customColors: CustomColors) => void;
145
+ /**
146
+ * Get the current custom color overrides
147
+ */
148
+ export declare const getSDKColors: () => CustomColors | null;
149
+ /**
150
+ * Clear custom color overrides
151
+ */
152
+ export declare const clearSDKColors: () => void;
103
153
  /**
104
154
  * Clear app data (for testing or logout scenarios)
105
155
  */
@@ -34,11 +34,13 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.clearAllData = exports.clearEnvironmentData = exports.clearAppData = exports.validateAppData = exports.getUserDemographics = exports.getUserInfoForAPI = exports.isEnvironmentInitialized = exports.isSDKInitialized = exports.getEnvironmentData = exports.getAppData = exports.initializeEnvironment = exports.initializeSDK = void 0;
37
+ exports.clearAllData = exports.clearEnvironmentData = exports.clearAppData = exports.clearSDKColors = exports.getSDKColors = exports.setSDKColors = exports.validateAppData = exports.getUserDemographics = exports.getUserInfoForAPI = exports.isEnvironmentInitialized = exports.isSDKInitialized = exports.getEnvironmentData = exports.getAppData = exports.initializeEnvironment = exports.initializeSDK = void 0;
38
38
  // Global app data storage
39
39
  let globalAppData = null;
40
40
  // Global environment data storage
41
41
  let globalEnvironmentData = null;
42
+ // Global custom color overrides
43
+ let globalCustomColors = null;
42
44
  /**
43
45
  * Initialize the SDK with app data from the main application
44
46
  * This should be called when the SDK starts
@@ -240,6 +242,36 @@ const validateAppData = (appData) => {
240
242
  };
241
243
  };
242
244
  exports.validateAppData = validateAppData;
245
+ /**
246
+ * Set custom color overrides for the SDK theme.
247
+ * Colors defined here will override the corresponding color from the selected theme (primary/dark/corporate).
248
+ * Call this before rendering the SDK navigator.
249
+ *
250
+ * @example
251
+ * setSDKColors({
252
+ * primary: '#FF5722',
253
+ * headerBg: '#1976D2',
254
+ * buttonBackground: '#1976D2',
255
+ * });
256
+ */
257
+ const setSDKColors = (customColors) => {
258
+ globalCustomColors = customColors;
259
+ };
260
+ exports.setSDKColors = setSDKColors;
261
+ /**
262
+ * Get the current custom color overrides
263
+ */
264
+ const getSDKColors = () => {
265
+ return globalCustomColors;
266
+ };
267
+ exports.getSDKColors = getSDKColors;
268
+ /**
269
+ * Clear custom color overrides
270
+ */
271
+ const clearSDKColors = () => {
272
+ globalCustomColors = null;
273
+ };
274
+ exports.clearSDKColors = clearSDKColors;
243
275
  /**
244
276
  * Clear app data (for testing or logout scenarios)
245
277
  */
@@ -260,5 +292,6 @@ exports.clearEnvironmentData = clearEnvironmentData;
260
292
  const clearAllData = () => {
261
293
  globalAppData = null;
262
294
  globalEnvironmentData = null;
295
+ globalCustomColors = null;
263
296
  };
264
297
  exports.clearAllData = clearAllData;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * usePaymentSSE - React Native SSE hook for payment status tracking.
3
+ *
4
+ * Mirrors the web app's usePaymentSSE (FDWebApplication/src/hooks/usePaymentSSE.ts).
5
+ * Uses XMLHttpRequest instead of fetch+ReadableStream because
6
+ * React Native does not support ReadableStream / getReader().
7
+ *
8
+ * Backend spec:
9
+ * Endpoint: GET /events?applicationId=<id>
10
+ * Events: fd_payment_status, digilocker_verification_status
11
+ * Format: Standard SSE → event: fd_payment_status\ndata: {"paymentStatus":"FAILED"}\n\n
12
+ *
13
+ * Usage:
14
+ * const { start, stop } = usePaymentSSE();
15
+ * start(applicationId, { onPaymentStatus: (status, payload) => { ... } });
16
+ * stop();
17
+ */
18
+ export interface UsePaymentSSECallbacks {
19
+ onPaymentStatus: (status: string, payload: Record<string, unknown>) => void;
20
+ onDigilockerStatus?: (payload: Record<string, unknown>) => void;
21
+ onError?: (error: any) => void;
22
+ onConnected?: () => void;
23
+ }
24
+ export declare function usePaymentSSE(): {
25
+ start: (applicationId: string, callbacks: UsePaymentSSECallbacks) => void;
26
+ stop: () => void;
27
+ };