Skip to content

Commit b796f42

Browse files
committed
chore(ts): export types properly
1 parent 4e9aaa8 commit b796f42

File tree

4 files changed

+64
-65
lines changed

4 files changed

+64
-65
lines changed

src/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
Platform,
66
type EmitterSubscription,
77
} from 'react-native';
8-
import {
9-
Threat,
10-
type NativeEventEmitterActions,
11-
type PackageInfo,
12-
type SuspiciousAppInfo,
13-
type TalsecConfig,
14-
} from './definitions';
8+
import type {
9+
NativeEventEmitterActions,
10+
PackageInfo,
11+
SuspiciousAppInfo,
12+
TalsecConfig,
13+
} from './types';
1514
import { getThreatCount, itemsHaveType } from './utils';
1615
import { Buffer } from 'buffer';
16+
import { Threat } from './threat';
1717

1818
const { FreeraspReactNative } = NativeModules;
1919

@@ -164,5 +164,5 @@ export const addToWhitelist = async (packageName: string): Promise<boolean> => {
164164
return FreeraspReactNative.addToWhitelist(packageName);
165165
};
166166

167-
export * from './definitions';
167+
export * from './types';
168168
export default FreeraspReactNative;

src/definitions.ts renamed to src/threat.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,5 @@
11
import { Platform } from 'react-native';
22

3-
export type TalsecConfig = {
4-
androidConfig?: TalsecAndroidConfig;
5-
iosConfig?: TalsecIosConfig;
6-
watcherMail: string;
7-
isProd?: boolean;
8-
};
9-
10-
export type TalsecAndroidConfig = {
11-
packageName: string;
12-
certificateHashes: string[];
13-
supportedAlternativeStores?: string[];
14-
malwareConfig?: TalsecMalwareConfig;
15-
};
16-
17-
export type TalsecIosConfig = {
18-
appBundleId: string;
19-
appTeamId: string;
20-
};
21-
22-
export type TalsecMalwareConfig = {
23-
blocklistedHashes?: string[];
24-
blocklistedPackageNames?: string[];
25-
blocklistedPermissions?: string[][];
26-
whitelistedInstallationSources?: string[];
27-
};
28-
29-
export type SuspiciousAppInfo = {
30-
packageInfo: PackageInfo;
31-
reason: string;
32-
};
33-
34-
export type PackageInfo = {
35-
packageName: string;
36-
appName?: string;
37-
version?: string;
38-
appIcon?: string;
39-
installerStore?: string;
40-
};
41-
42-
export type NativeEventEmitterActions = {
43-
privilegedAccess?: () => any;
44-
debug?: () => any;
45-
simulator?: () => any;
46-
appIntegrity?: () => any;
47-
unofficialStore?: () => any;
48-
hooks?: () => any;
49-
deviceBinding?: () => any;
50-
deviceID?: () => any;
51-
passcode?: () => any;
52-
secureHardwareNotAvailable?: () => any;
53-
obfuscationIssues?: () => any;
54-
devMode?: () => any;
55-
systemVPN?: () => any;
56-
malware?: (suspiciousApps: SuspiciousAppInfo[]) => any;
57-
};
58-
593
export class Threat {
604
value: number;
615

src/types.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export type TalsecConfig = {
2+
androidConfig?: TalsecAndroidConfig;
3+
iosConfig?: TalsecIosConfig;
4+
watcherMail: string;
5+
isProd?: boolean;
6+
};
7+
8+
export type TalsecAndroidConfig = {
9+
packageName: string;
10+
certificateHashes: string[];
11+
supportedAlternativeStores?: string[];
12+
malwareConfig?: TalsecMalwareConfig;
13+
};
14+
15+
export type TalsecIosConfig = {
16+
appBundleId: string;
17+
appTeamId: string;
18+
};
19+
20+
export type TalsecMalwareConfig = {
21+
blocklistedHashes?: string[];
22+
blocklistedPackageNames?: string[];
23+
blocklistedPermissions?: string[][];
24+
whitelistedInstallationSources?: string[];
25+
};
26+
27+
export type SuspiciousAppInfo = {
28+
packageInfo: PackageInfo;
29+
reason: string;
30+
};
31+
32+
export type PackageInfo = {
33+
packageName: string;
34+
appName?: string;
35+
version?: string;
36+
appIcon?: string;
37+
installerStore?: string;
38+
};
39+
40+
export type NativeEventEmitterActions = {
41+
privilegedAccess?: () => any;
42+
debug?: () => any;
43+
simulator?: () => any;
44+
appIntegrity?: () => any;
45+
unofficialStore?: () => any;
46+
hooks?: () => any;
47+
deviceBinding?: () => any;
48+
deviceID?: () => any;
49+
passcode?: () => any;
50+
secureHardwareNotAvailable?: () => any;
51+
obfuscationIssues?: () => any;
52+
devMode?: () => any;
53+
systemVPN?: () => any;
54+
malware?: (suspiciousApps: SuspiciousAppInfo[]) => any;
55+
};

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Threat } from './definitions';
1+
import { Threat } from './threat';
22

33
export const getThreatCount = (): number => {
44
return Threat.getValues().length;

0 commit comments

Comments
 (0)