react-native-nami-sdk 3.3.0-beta.8 → 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.
- package/.prettierrc +4 -0
- package/README.md +9 -9
- package/android/README.md +3 -2
- package/android/build.gradle +27 -19
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/namiml/reactnative/Constants.kt +3 -0
- package/android/src/main/java/com/namiml/reactnative/NamiBridgeModule.kt +91 -0
- package/android/src/main/java/com/namiml/reactnative/NamiBridgePackage.java +140 -0
- package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCampaignManagerBridge.kt +24 -30
- package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCustomerManagerBridge.kt +14 -6
- package/android/src/main/java/com/{nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt → namiml/reactnative/NamiEntitlementManagerBridge.kt} +18 -8
- package/android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt +67 -0
- package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +196 -0
- package/android/src/main/java/com/namiml/reactnative/NamiPurchaseManagerBridge.kt +114 -0
- package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiUtil.kt +26 -23
- package/{index.d.ts → dist/index.d.ts} +0 -2
- package/dist/specs/NativeNami.d.ts +15 -0
- package/dist/specs/NativeNamiCampaignManager.d.ts +82 -0
- package/dist/specs/NativeNamiCustomerManager.d.ts +29 -0
- package/dist/specs/NativeNamiEntitlementManager.d.ts +45 -0
- package/dist/specs/NativeNamiFlowManager.d.ts +8 -0
- package/dist/specs/NativeNamiPaywallManager.d.ts +71 -0
- package/dist/specs/NativeNamiPurchaseManager.d.ts +28 -0
- package/dist/src/Nami.d.ts +5 -0
- package/dist/src/NamiCampaignManager.d.ts +29 -0
- package/{src → dist/src}/NamiCustomerManager.d.ts +11 -13
- package/dist/src/NamiEntitlementManager.d.ts +13 -0
- package/dist/src/NamiFlowManager.d.ts +11 -0
- package/dist/src/NamiPaywallManager.d.ts +30 -0
- package/dist/src/NamiPurchaseManager.d.ts +17 -0
- package/dist/src/transformers.d.ts +3 -0
- package/{src → dist/src}/types.d.ts +35 -6
- package/dist/src/version.d.ts +5 -0
- package/index.ts +0 -2
- package/ios/Nami.m +8 -88
- package/ios/Nami.swift +85 -0
- package/ios/NamiCampaignManagerBridge.m +3 -3
- package/ios/NamiCampaignManagerBridge.swift +49 -61
- package/ios/NamiCustomerManager.m +2 -2
- package/ios/NamiCustomerManager.swift +13 -3
- package/ios/NamiEntitlementManagerBridge.m +2 -3
- package/ios/NamiEntitlementManagerBridge.swift +48 -39
- package/ios/NamiFlowManagerBridge.m +2 -2
- package/ios/NamiFlowManagerBridge.swift +10 -6
- package/ios/NamiPaywallManagerBridge.m +3 -3
- package/ios/NamiPaywallManagerBridge.swift +16 -6
- package/ios/NamiPurchaseManagerBridge.m +3 -2
- package/ios/NamiPurchaseManagerBridge.swift +15 -10
- package/ios/RNNami-Bridging-Header.h +1 -3
- package/package.json +20 -8
- package/react-native-config.js +9 -0
- package/react-native-nami-sdk.podspec +11 -3
- package/scripts/generate-version.ts +18 -0
- package/specs/NativeNami.ts +16 -0
- package/specs/NativeNamiCampaignManager.ts +94 -0
- package/specs/NativeNamiCustomerManager.ts +37 -0
- package/specs/NativeNamiEntitlementManager.ts +54 -0
- package/specs/NativeNamiFlowManager.ts +12 -0
- package/specs/NativeNamiPaywallManager.ts +85 -0
- package/specs/NativeNamiPurchaseManager.ts +33 -0
- package/src/Nami.ts +28 -18
- package/src/NamiCampaignManager.ts +57 -53
- package/src/NamiCustomerManager.ts +55 -81
- package/src/NamiEntitlementManager.ts +49 -36
- package/src/NamiFlowManager.ts +35 -45
- package/src/NamiPaywallManager.ts +84 -139
- package/src/NamiPurchaseManager.ts +69 -70
- package/src/transformers.ts +21 -0
- package/src/types.ts +39 -7
- package/src/version.ts +5 -0
- package/tsconfig.json +24 -22
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -52
- package/.github/workflows/CI.yaml +0 -341
- package/.github/workflows/app_prod.yaml +0 -387
- package/.github/workflows/app_stg.yaml +0 -398
- package/.github/workflows/build.yml +0 -70
- package/.pre-commit-config.yaml +0 -24
- package/.prettierrc.js +0 -7
- package/android/src/main/java/com/nami/reactlibrary/Constants.kt +0 -3
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +0 -141
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +0 -51
- package/android/src/main/java/com/nami/reactlibrary/NamiFlowManagerBridge.kt +0 -60
- package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +0 -58
- package/android/src/main/java/com/nami/reactlibrary/NamiManagerBridge.kt +0 -26
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +0 -258
- package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +0 -108
- package/build-utils/get_version_code.py +0 -140
- package/build-utils/preflight.py +0 -46
- package/ios/NamiMLManagerBridge.m +0 -93
- package/ios/NamiManager.m +0 -18
- package/ios/NamiManager.swift +0 -30
- package/ios/RNNami.h +0 -10
- package/ios/RNNami.m +0 -13
- package/src/Nami.d.ts +0 -8
- package/src/NamiCampaignManager.d.ts +0 -18
- package/src/NamiEntitlementManager.d.ts +0 -15
- package/src/NamiFlowManager.d.ts +0 -32
- package/src/NamiMLManager.d.ts +0 -7
- package/src/NamiMLManager.ts +0 -13
- package/src/NamiManager.d.ts +0 -5
- package/src/NamiManager.ts +0 -14
- package/src/NamiPaywallManager.d.ts +0 -34
- package/src/NamiPurchaseManager.d.ts +0 -20
|
@@ -1,100 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
) =>
|
|
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
|
-
|
|
60
|
+
state: NamiPurchasesState,
|
|
54
61
|
purchases: NamiPurchase[],
|
|
55
62
|
error: string,
|
|
56
63
|
) => void,
|
|
57
|
-
) => {
|
|
58
|
-
const subscription =
|
|
64
|
+
): (() => void) => {
|
|
65
|
+
const subscription = emitter.addListener(
|
|
59
66
|
NamiPurchaseManagerEvents.PurchasesChanged,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
callback(
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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]:
|
|
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
|
-
|
|
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
package/tsconfig.json
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "esnext"
|
|
4
|
-
"module": "commonjs"
|
|
5
|
-
"lib": [
|
|
6
|
-
|
|
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"
|
|
9
|
-
"declaration": true
|
|
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
|
-
|
|
14
|
-
|
|
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
|
|
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
|
|
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
|
|
26
|
-
"noImplicitAny": false
|
|
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"
|
|
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
|
|
47
|
-
"esModuleInterop": true
|
|
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
|
|
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
|
|
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
|
-
"
|
|
68
|
+
"./specs/*",
|
|
69
|
+
"**/*.spec.*",
|
|
70
|
+
"**/*.d.ts"
|
|
69
71
|
]
|
|
70
72
|
}
|
package/.eslintignore
DELETED
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
|
-
};
|