UNPKG

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