react-native-nami-sdk 3.3.0-beta.7 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/.prettierrc +4 -0
  2. package/README.md +9 -9
  3. package/android/README.md +3 -2
  4. package/android/build.gradle +27 -19
  5. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  6. package/android/gradlew +0 -0
  7. package/android/src/main/AndroidManifest.xml +1 -1
  8. package/android/src/main/java/com/namiml/reactnative/Constants.kt +3 -0
  9. package/android/src/main/java/com/namiml/reactnative/NamiBridgeModule.kt +91 -0
  10. package/android/src/main/java/com/namiml/reactnative/NamiBridgePackage.java +140 -0
  11. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCampaignManagerBridge.kt +24 -30
  12. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCustomerManagerBridge.kt +14 -6
  13. package/android/src/main/java/com/{nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt → namiml/reactnative/NamiEntitlementManagerBridge.kt} +18 -8
  14. package/android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt +67 -0
  15. package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +196 -0
  16. package/android/src/main/java/com/namiml/reactnative/NamiPurchaseManagerBridge.kt +114 -0
  17. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiUtil.kt +26 -23
  18. package/{index.d.ts → dist/index.d.ts} +0 -2
  19. package/dist/specs/NativeNami.d.ts +15 -0
  20. package/dist/specs/NativeNamiCampaignManager.d.ts +82 -0
  21. package/dist/specs/NativeNamiCustomerManager.d.ts +29 -0
  22. package/dist/specs/NativeNamiEntitlementManager.d.ts +45 -0
  23. package/dist/specs/NativeNamiFlowManager.d.ts +8 -0
  24. package/dist/specs/NativeNamiPaywallManager.d.ts +71 -0
  25. package/dist/specs/NativeNamiPurchaseManager.d.ts +28 -0
  26. package/dist/src/Nami.d.ts +5 -0
  27. package/dist/src/NamiCampaignManager.d.ts +29 -0
  28. package/{src → dist/src}/NamiCustomerManager.d.ts +11 -13
  29. package/dist/src/NamiEntitlementManager.d.ts +13 -0
  30. package/dist/src/NamiFlowManager.d.ts +11 -0
  31. package/dist/src/NamiPaywallManager.d.ts +30 -0
  32. package/dist/src/NamiPurchaseManager.d.ts +17 -0
  33. package/dist/src/transformers.d.ts +3 -0
  34. package/{src → dist/src}/types.d.ts +35 -6
  35. package/dist/src/version.d.ts +5 -0
  36. package/index.ts +0 -2
  37. package/ios/Nami.m +8 -88
  38. package/ios/Nami.swift +85 -0
  39. package/ios/NamiCampaignManagerBridge.m +3 -3
  40. package/ios/NamiCampaignManagerBridge.swift +49 -61
  41. package/ios/NamiCustomerManager.m +2 -2
  42. package/ios/NamiCustomerManager.swift +13 -3
  43. package/ios/NamiEntitlementManagerBridge.m +2 -3
  44. package/ios/NamiEntitlementManagerBridge.swift +48 -39
  45. package/ios/NamiFlowManagerBridge.m +2 -2
  46. package/ios/NamiFlowManagerBridge.swift +10 -6
  47. package/ios/NamiPaywallManagerBridge.m +3 -3
  48. package/ios/NamiPaywallManagerBridge.swift +16 -6
  49. package/ios/NamiPurchaseManagerBridge.m +3 -2
  50. package/ios/NamiPurchaseManagerBridge.swift +15 -10
  51. package/ios/RNNami-Bridging-Header.h +1 -3
  52. package/package.json +20 -8
  53. package/react-native-config.js +9 -0
  54. package/react-native-nami-sdk.podspec +11 -3
  55. package/scripts/generate-version.ts +18 -0
  56. package/specs/NativeNami.ts +16 -0
  57. package/specs/NativeNamiCampaignManager.ts +94 -0
  58. package/specs/NativeNamiCustomerManager.ts +37 -0
  59. package/specs/NativeNamiEntitlementManager.ts +54 -0
  60. package/specs/NativeNamiFlowManager.ts +12 -0
  61. package/specs/NativeNamiPaywallManager.ts +85 -0
  62. package/specs/NativeNamiPurchaseManager.ts +33 -0
  63. package/src/Nami.ts +28 -18
  64. package/src/NamiCampaignManager.ts +57 -53
  65. package/src/NamiCustomerManager.ts +55 -81
  66. package/src/NamiEntitlementManager.ts +49 -36
  67. package/src/NamiFlowManager.ts +35 -45
  68. package/src/NamiPaywallManager.ts +84 -139
  69. package/src/NamiPurchaseManager.ts +69 -70
  70. package/src/transformers.ts +21 -0
  71. package/src/types.ts +39 -7
  72. package/src/version.ts +5 -0
  73. package/tsconfig.json +24 -22
  74. package/.eslintignore +0 -3
  75. package/.eslintrc.js +0 -52
  76. package/.github/workflows/CI.yaml +0 -341
  77. package/.github/workflows/app_prod.yaml +0 -387
  78. package/.github/workflows/app_stg.yaml +0 -398
  79. package/.github/workflows/build.yml +0 -70
  80. package/.pre-commit-config.yaml +0 -24
  81. package/.prettierrc.js +0 -7
  82. package/android/src/main/java/com/nami/reactlibrary/Constants.kt +0 -3
  83. package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +0 -141
  84. package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +0 -51
  85. package/android/src/main/java/com/nami/reactlibrary/NamiFlowManagerBridge.kt +0 -58
  86. package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +0 -58
  87. package/android/src/main/java/com/nami/reactlibrary/NamiManagerBridge.kt +0 -26
  88. package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +0 -258
  89. package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +0 -108
  90. package/build-utils/get_version_code.py +0 -140
  91. package/build-utils/preflight.py +0 -46
  92. package/ios/NamiMLManagerBridge.m +0 -93
  93. package/ios/NamiManager.m +0 -18
  94. package/ios/NamiManager.swift +0 -30
  95. package/ios/RNNami.h +0 -10
  96. package/ios/RNNami.m +0 -13
  97. package/src/Nami.d.ts +0 -8
  98. package/src/NamiCampaignManager.d.ts +0 -18
  99. package/src/NamiEntitlementManager.d.ts +0 -15
  100. package/src/NamiFlowManager.d.ts +0 -32
  101. package/src/NamiMLManager.d.ts +0 -7
  102. package/src/NamiMLManager.ts +0 -13
  103. package/src/NamiManager.d.ts +0 -5
  104. package/src/NamiManager.ts +0 -14
  105. package/src/NamiPaywallManager.d.ts +0 -34
  106. package/src/NamiPurchaseManager.d.ts +0 -20
@@ -1,100 +1,99 @@
1
- import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
2
- import { EmitterSubscription } from 'react-native';
1
+ import {
2
+ NativeEventEmitter,
3
+ TurboModuleRegistry,
4
+ NativeModules,
5
+ } from 'react-native';
6
+ import type { Spec } from '../specs/NativeNamiPurchaseManager';
3
7
  import {
4
8
  NamiPurchase,
5
9
  NamiPurchasesState,
6
10
  NamiRestorePurchasesState,
7
11
  } from './types';
12
+ import { coerceSkuType } from './transformers';
8
13
 
9
- export const { NamiPurchaseManagerBridge, RNNamiPurchaseManager } =
10
- NativeModules;
14
+ const RNNamiPurchaseManager: Spec =
15
+ TurboModuleRegistry.getEnforcing?.<Spec>('RNNamiPurchaseManager') ??
16
+ NativeModules.RNNamiPurchaseManager;
11
17
 
12
18
  export enum NamiPurchaseManagerEvents {
13
19
  PurchasesChanged = 'PurchasesChanged',
14
20
  RestorePurchasesStateChanged = 'RestorePurchasesStateChanged',
15
21
  }
16
22
 
17
- export interface INamiPurchaseManager {
18
- emitter: NativeEventEmitter;
19
- allPurchases: () => NamiPurchase[];
20
- anySkuPurchased: (skuIds: string[]) => boolean;
21
- consumePurchasedSku: (skuId: string) => void;
22
- presentCodeRedemptionSheet: () => void;
23
- restorePurchases: (
24
- callback: (
25
- purchaseState: NamiPurchasesState,
26
- purchases: NamiPurchase[],
27
- error: string,
28
- ) => void,
29
- ) => EmitterSubscription['remove'];
30
- skuPurchased: (skuId: string) => boolean;
31
- registerPurchasesChangedHandler: (
32
- callback: (
33
- purchaseState: NamiPurchasesState,
34
- purchases: NamiPurchase[],
35
- error: string,
36
- ) => void,
37
- ) => EmitterSubscription['remove'];
38
- registerRestorePurchasesHandler: (
39
- callback: (
40
- state: NamiRestorePurchasesState,
41
- newPurchases: NamiPurchase[],
42
- oldPurchases: NamiPurchase[],
43
- ) => void,
44
- ) => EmitterSubscription['remove'];
45
- }
23
+ const emitter = new NativeEventEmitter(NativeModules.RNNamiPurchaseManager);
24
+
25
+ export const NamiPurchaseManager = {
26
+ emitter,
27
+
28
+ allPurchases: async (): Promise<NamiPurchase[]> => {
29
+ const rawPurchases = await RNNamiPurchaseManager.allPurchases();
30
+
31
+ return rawPurchases.map((purchase) => ({
32
+ ...purchase,
33
+ purchaseInitiatedTimestamp: new Date(purchase.purchaseInitiatedTimestamp),
34
+ expires: purchase.expires ? new Date(purchase.expires) : undefined,
35
+ sku: purchase.sku
36
+ ? {
37
+ ...purchase.sku,
38
+ type: coerceSkuType(purchase.sku.type),
39
+ }
40
+ : undefined,
41
+ }));
42
+ },
43
+
44
+ skuPurchased: async (skuId: string): Promise<boolean> =>
45
+ await RNNamiPurchaseManager.skuPurchased(skuId),
46
+
47
+ anySkuPurchased: async (skuIds: string[]): Promise<boolean> =>
48
+ await RNNamiPurchaseManager.anySkuPurchased(skuIds),
49
+
50
+ consumePurchasedSku: (skuId: string): void =>
51
+ RNNamiPurchaseManager.consumePurchasedSku(skuId),
52
+
53
+ presentCodeRedemptionSheet: (): void =>
54
+ RNNamiPurchaseManager.presentCodeRedemptionSheet(),
55
+
56
+ restorePurchases: (): void => RNNamiPurchaseManager.restorePurchases(),
46
57
 
47
- export const NamiPurchaseManager: INamiPurchaseManager = {
48
- emitter: new NativeEventEmitter(RNNamiPurchaseManager),
49
- ...NamiPurchaseManagerBridge,
50
- ...RNNamiPurchaseManager,
51
58
  registerPurchasesChangedHandler: (
52
59
  callback: (
53
- purchaseState: NamiPurchasesState,
60
+ state: NamiPurchasesState,
54
61
  purchases: NamiPurchase[],
55
62
  error: string,
56
63
  ) => void,
57
- ) => {
58
- const subscription = NamiPurchaseManager.emitter.addListener(
64
+ ): (() => void) => {
65
+ const subscription = emitter.addListener(
59
66
  NamiPurchaseManagerEvents.PurchasesChanged,
60
- body => {
61
- let purchases = body.purchases;
62
- let purchaseState =
63
- body.purchaseState.toLowerCase() as NamiPurchasesState;
64
- let error = body.error;
65
- callback(purchaseState, purchases, error);
67
+ (event: {
68
+ state: NamiPurchasesState;
69
+ purchases: NamiPurchase[];
70
+ error: string;
71
+ }) => {
72
+ callback(event.state, event.purchases, event.error);
66
73
  },
67
74
  );
68
- RNNamiPurchaseManager.registerPurchasesChangedHandler();
69
- return () => {
70
- if (subscription) {
71
- subscription.remove();
72
- }
73
- };
75
+ RNNamiPurchaseManager.registerPurchasesChangedHandler?.();
76
+ return () => subscription.remove();
74
77
  },
78
+
75
79
  registerRestorePurchasesHandler: (
76
80
  callback: (
77
81
  state: NamiRestorePurchasesState,
78
82
  newPurchases: NamiPurchase[],
79
83
  oldPurchases: NamiPurchase[],
80
84
  ) => void,
81
- ) => {
82
- if (Platform.OS === 'ios') {
83
- const subscription = NamiPurchaseManager.emitter.addListener(
84
- NamiPurchaseManagerEvents.RestorePurchasesStateChanged,
85
- body => {
86
- let state = body.state.toLowerCase() as NamiRestorePurchasesState;
87
- let newPurchases = body.newPurchases;
88
- let oldPurchases = body.oldPurchases;
89
- callback(state, newPurchases, oldPurchases);
90
- },
91
- );
92
- RNNamiPurchaseManager.registerRestorePurchasesHandler();
93
- return () => {
94
- if (subscription) {
95
- subscription.remove();
96
- }
97
- };
98
- }
85
+ ): (() => void) => {
86
+ const subscription = emitter.addListener(
87
+ NamiPurchaseManagerEvents.RestorePurchasesStateChanged,
88
+ (event: {
89
+ state: NamiRestorePurchasesState;
90
+ newPurchases: NamiPurchase[];
91
+ oldPurchases: NamiPurchase[];
92
+ }) => {
93
+ callback(event.state, event.newPurchases, event.oldPurchases);
94
+ },
95
+ );
96
+ RNNamiPurchaseManager.registerRestorePurchasesHandler?.();
97
+ return () => subscription.remove();
99
98
  },
100
99
  };
@@ -0,0 +1,21 @@
1
+ import type { NamiPurchase, NamiSKUType } from './types';
2
+
3
+ export function parsePurchaseDates(purchase: any): NamiPurchase {
4
+ return {
5
+ ...purchase,
6
+ purchaseInitiatedTimestamp: new Date(purchase.purchaseInitiatedTimestamp),
7
+ expires: purchase.expires ? new Date(purchase.expires) : undefined,
8
+ };
9
+ }
10
+
11
+ const validSkuTypes: NamiSKUType[] = [
12
+ 'unknown',
13
+ 'one_time_purchase',
14
+ 'subscription',
15
+ ];
16
+
17
+ export function coerceSkuType(raw: string): NamiSKUType {
18
+ return validSkuTypes.includes(raw as NamiSKUType)
19
+ ? (raw as NamiSKUType)
20
+ : 'unknown';
21
+ }
package/src/types.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export type NamiConfiguration = {
2
- 'appPlatformID-apple': string;
3
- 'appPlatformID-android': string;
2
+ appPlatformID: string;
4
3
  logLevel: string;
5
4
  namiCommands?: string[];
6
5
  namiLanguageCode?: NamiLanguageCodes;
@@ -147,9 +146,9 @@ export type AppleProduct = {
147
146
  priceLanguage: string;
148
147
  };
149
148
 
150
- export type GoogleProduct = {};
149
+ export type GoogleProduct = Record<string, never>;
151
150
 
152
- export type AmazonProduct = {};
151
+ export type AmazonProduct = Record<string, never>;
153
152
 
154
153
  // NamiCampaignManager
155
154
  export type NamiCampaign = {
@@ -206,7 +205,7 @@ export type PaywallLaunchContext = {
206
205
  };
207
206
  // Custom object used as data source for advanced paywall components
208
207
  customObject?: {
209
- [key: string]: any;
208
+ [key: string]: unknown;
210
209
  };
211
210
  };
212
211
 
@@ -239,13 +238,25 @@ export type NamiEntitlement = {
239
238
  activePurchases: NamiPurchase[];
240
239
  desc: string;
241
240
  name: string;
242
- namiId: string;
243
241
  purchasedSkus: NamiSKU[];
244
242
  referenceId: string;
245
243
  relatedSkus: NamiSKU[];
246
244
  };
247
245
 
248
- // NamiPaywallManager
246
+ export type NamiPurchaseDetails = {
247
+ product: NamiSKU;
248
+ transactionID?: string;
249
+ originalTransactionID?: string;
250
+ orderId?: string;
251
+ purchaseToken?: string;
252
+ receiptId?: string;
253
+ localizedPrice?: string;
254
+ price?: string;
255
+ currencyCode?: string;
256
+ userId?: string;
257
+ marketplace?: string;
258
+ };
259
+
249
260
  export type NamiPurchaseSuccessApple = {
250
261
  product: NamiSKU;
251
262
  transactionID: string;
@@ -309,6 +320,16 @@ export type NamiPurchase = {
309
320
  purchaseSource?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
310
321
  };
311
322
 
323
+ export type NamiPurchaseFromBridge = {
324
+ sku?: NamiSKU;
325
+ skuId: string;
326
+ transactionIdentifier?: string;
327
+ purchaseToken?: string;
328
+ expires?: number;
329
+ purchaseInitiatedTimestamp: number;
330
+ purchaseSource?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN';
331
+ };
332
+
312
333
  export type NamiPurchasesState =
313
334
  | 'pending'
314
335
  | 'purchased'
@@ -357,3 +378,14 @@ export type NamiPaywallEventVideoMetadata = {
357
378
  contentTimecode?: number;
358
379
  contentDuration?: number;
359
380
  };
381
+
382
+ export type NamiFlowHandoffPayload = {
383
+ handoffTag: string;
384
+ handoffData?: Record<string, unknown>;
385
+ };
386
+
387
+ export type NamiAccountStateEvent = {
388
+ action: AccountStateAction;
389
+ success: boolean;
390
+ error?: number;
391
+ };
package/src/version.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Auto-generated file. Do not edit manually.
3
+ * React Native Nami SDK version.
4
+ */
5
+ export const NAMI_REACT_NATIVE_VERSION = '3.3.0';
package/tsconfig.json CHANGED
@@ -1,29 +1,31 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
4
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
5
- "lib": ["es2017"], /* Specify library files to be included in the compilation. */
6
- "allowJs": true, /* Allow javascript files to be compiled. */
3
+ "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
4
+ "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5
+ "lib": [
6
+ "es2017"
7
+ ] /* Specify library files to be included in the compilation. */,
8
+ "allowJs": true /* Allow javascript files to be compiled. */,
7
9
  // "checkJs": true, /* Report errors in .js files. */
8
- "jsx": "react-native", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
9
- "declaration": true, /* Generates corresponding '.d.ts' file. */
10
+ "jsx": "react-native" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
11
+ "declaration": true /* Generates corresponding '.d.ts' file. */,
10
12
  // "sourceMap": true, /* Generates corresponding '.map' file. */
11
13
  // "outFile": "./", /* Concatenate and emit output to single file. */
12
- "declarationDir": "src", /* Output directory for generated declaration files. */
13
- "outDir": "dist", /* Redirect output structure to the directory. */
14
- "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
14
+ // "declarationDir": "src", /* Output directory for generated declaration files. */
15
+ "outDir": "dist" /* Redirect output structure to the directory. */,
16
+ "rootDir": "." /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
15
17
  // "removeComments": true, /* Do not emit comments to output. */
16
- "emitDeclarationOnly": true, /* Only output d.ts files and not js files */
18
+ "emitDeclarationOnly": true /* Only output d.ts files and not js files */,
17
19
  // "noEmit": true, /* Do not emit outputs. */
18
20
  // "incremental": true, /* Enable incremental compilation */
19
21
  // "importHelpers": true, /* Import emit helpers from 'tslib'. */
20
22
  // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
21
- "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
23
+ "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
22
24
  "useDefineForClassFields": true,
23
25
 
24
26
  /* Strict Type-Checking Options */
25
- "strict": true, /* Enable all strict type-checking options. */
26
- "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
27
+ "strict": true /* Enable all strict type-checking options. */,
28
+ "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
27
29
  // "strictNullChecks": true, /* Enable strict null checks. */
28
30
  // "strictFunctionTypes": true, /* Enable strict checking of function types. */
29
31
  // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
@@ -37,16 +39,16 @@
37
39
  // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
38
40
 
39
41
  /* Module Resolution Options */
40
- "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
42
+ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
41
43
  // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
42
44
  // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
43
45
  // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
44
46
  // "typeRoots": [""], /* List of folders to include type definitions from. */
45
47
  // "types": [], /* Type declaration files to be included in compilation. */
46
- "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
47
- "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
48
+ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
49
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
48
50
  // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
49
- "skipLibCheck": true, /* Skip type checking of declaration files. */
51
+ "skipLibCheck": true /* Skip type checking of declaration files. */,
50
52
  "resolveJsonModule": true,
51
53
  /* Source Map Options */
52
54
  // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
@@ -55,16 +57,16 @@
55
57
  // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
56
58
 
57
59
  /* Experimental Options */
58
- "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
60
+ "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */
59
61
  // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
60
62
  },
61
- "include": [
62
- "./src"
63
- ],
63
+ "include": ["./src", "index.ts"],
64
64
  "exclude": [
65
65
  "node_modules",
66
66
  "./examples",
67
67
  "./build-utils",
68
- "**/*.spec.*"
68
+ "./specs/*",
69
+ "**/*.spec.*",
70
+ "**/*.d.ts"
69
71
  ]
70
72
  }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- node_modules/
2
- .eslintrc.*
3
- *.d.ts
package/.eslintrc.js DELETED
@@ -1,52 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: '@react-native-community',
4
- parser: '@typescript-eslint/parser',
5
- plugins: ['@typescript-eslint'],
6
- parserOptions: {
7
- ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
8
- sourceType: 'module', // Allows for the use of imports
9
- ecmaFeatures: {
10
- jsx: true, // Allows for the parsing of JSX
11
- },
12
- },
13
- rules: {
14
- 'react/no-unstable-nested-components': [
15
- 'off' | 'warn' | 'error',
16
- { allowAsProps: true | false },
17
- ],
18
- 'prettier/prettier': [
19
- 'error',
20
- {
21
- bracketSpacing: true,
22
- jsxBracketSameLine: true,
23
- singleQuote: true,
24
- trailingComma: 'all',
25
- arrowParens: 'avoid',
26
- },
27
- ],
28
- quotes: ['error', 'single'],
29
- indent: ['error', 2, { SwitchCase: 1 }],
30
- 'comma-dangle': [2, 'always-multiline'],
31
- 'react/prop-types': 'off',
32
- '@typescript-eslint/no-namespace': 'off',
33
- '@typescript-eslint/no-explicit-any': 'off',
34
- '@typescript-eslint/ban-ts-comment': 'off',
35
- '@typescript-eslint/interface-name-prefix': 'off',
36
- '@typescript-eslint/no-non-null-assertion': 'off',
37
- '@typescript-eslint/no-unused-vars': [
38
- 2,
39
- { args: 'none', ignoreRestSiblings: true },
40
- ],
41
- '@typescript-eslint/no-use-before-define': ['error', { variables: false }],
42
- 'react/jsx-first-prop-new-line': [1, 'multiline'],
43
- 'react/jsx-max-props-per-line': [
44
- 1,
45
- {
46
- maximum: 1,
47
- },
48
- ],
49
- 'no-unused-vars': 'off',
50
- 'object-curly-spacing': ['error', 'always'],
51
- },
52
- };