UNPKG

1.4 kBPlain TextView Raw
1/** Key value should be the same here */
2export enum Integration {
3 reactNative = 'reactNative',
4 cordova = 'cordova',
5 electron = 'electron',
6 nextjs = 'nextjs',
7}
8
9/** Key value should be the same here */
10export enum Platform {
11 ios = 'ios',
12 android = 'android',
13}
14
15export function getPlatformChoices(): any[] {
16 return Object.keys(Platform).map((platform: string) => ({
17 checked: true,
18 name: getPlatformDescription(platform),
19 value: platform,
20 }));
21}
22
23export function getPlatformDescription(type: string): string {
24 switch (type) {
25 case Platform.ios:
26 return 'iOS';
27 default:
28 return 'Android';
29 }
30}
31
32export function getIntegrationDescription(type: string): string {
33 switch (type) {
34 case Integration.reactNative:
35 return 'React Native';
36 case Integration.cordova:
37 return 'Cordova';
38 case Integration.electron:
39 return 'Electron';
40 case Integration.nextjs:
41 return 'Next.js';
42 default:
43 return 'React Native';
44 }
45}
46
47export function getIntegrationChoices(): any[] {
48 return Object.keys(Integration).map((type: string) => ({
49 name: getIntegrationDescription(type),
50 value: type,
51 }));
52}
53
54export interface Args {
55 url: string;
56 debug: boolean;
57 uninstall: boolean;
58 integration: Integration;
59 platform: Platform;
60 skipConnect: boolean;
61 quiet: boolean;
62}
63
64export const DEFAULT_URL = 'https://sentry.io/';