forked from Instabug/Instabug-React-Native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
359 lines (357 loc) · 10.7 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
// Type definitions for instabug-reactnative 8.0
// Project: https://github.com/Instabug/instabug-reactnative#readme
// Definitions by: Aly Ezz <https://github.com/alyezz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export namespace BugReporting {
function setEnabled(isEnabled: boolean): void;
function setInvocationEvents(invocationEvents: invocationEvent[]): void;
function invoke(): void;
function setInvocationOptions(invocationOptions: invocationOptions[]): void;
function invokeWithInvocationModeAndOptions(
invocationMode: invocationMode,
invocationOptions: invocationOptions[]
): void;
function onInvokeHandler(preInvocationHandler: () => void): void;
function onReportSubmitHandler(preSendingHandler: () => void): void;
function onSDKDismissedHandler(postInvocationHandler: (dismiss: dismissType, report: reportType) => void): void;
function setPromptOptionsEnabled(
chat: boolean,
bug: boolean,
feedback: boolean
): void;
function setShakingThresholdForiPhone(iPhoneShakingThreshold: number): void;
function setShakingThresholdForiPad(iPadShakingThreshold: number): void;
function setShakingThresholdForAndroid(androidThreshold: number): void;
function setExtendedBugReportMode(extendedBugReportMode: extendedBugReportMode): void;
function setReportTypes(types: reportType): void;
function showWithOptions(
type: reportType,
options: option[]): void;
enum invocationEvent {
none,
shake,
screenshot,
twoFingersSwipe,
floatingButton
}
enum invocationMode {
NA,
newBug,
newFeedback,
newChat,
chatsList
}
enum invocationOptions {
emailFieldHidden,
emailFieldOptional,
commentFieldRequired,
disablePostSendingDialog
}
enum extendedBugReportMode {
enabledWithRequiredFields,
enabledWithOptionalFields,
disabled
}
enum reportType {
bug,
feedback
}
enum option {
emailFieldHidden,
emailFieldOptional,
commentFieldRequired,
disablePostSendingDialog
}
}
export namespace Chats {
function setEnabled(isEnabled: boolean): void;
function show(): void;
}
export namespace CrashReporting {
function setEnabled(isEnabled: boolean): void;
function reportJSException(Exception: object): void;
}
export namespace FeatureRequests {
function setEmailFieldRequired(
isEmailFieldRequired: boolean,
actionTypes: actionTypes[]
): void;
function show(): void;
enum actionTypes {
allActions,
reportBug,
requestNewFeature,
addCommentToFeature
}
}
export namespace Replies {
function setEnabled(isEnabled: boolean): void;
function hasChats(callback: (previousChats : boolean) => void): void;
function show(): void;
function setOnNewReplyReceivedCallback(onNewReplyReceivedCallback: () => void): void;
function getUnreadRepliesCount(messageCountCallback: () => void): void;
function setInAppNotificationsEnabled(inAppNotificationsEnabled: boolean): void;
function setInAppNotificationSound(shouldPlaySound: boolean): void;
}
export namespace Surveys {
function setEnabled(isEnabled: boolean): void;
function showSurveyIfAvailable(): void;
function setThresholdForReshowingSurveyAfterDismiss(
sessionCount: number,
daysCount: number
): void;
function getAvailableSurveys(availableSurveysCallback: () => void): void;
function setAutoShowingEnabled(autoShowingSurveysEnabled: boolean): void;
function onShowCallback(willShowSurveyHandler: () => void): void;
function onDismissCallback(didDismissSurveyHandler: () => void): void;
function showSurvey(surveyToken: string): void;
function hasRespondedToSurvey(
surveyToken: string,
surveyTokenCallback: () => void
): void;
function setShouldShowWelcomeScreen(shouldShowWelcomeScreen: boolean): void;
}
export namespace NetworkLogger {
function setEnabled(isEnabled: boolean): void;
function setNetworkDataObfuscationHandler(handler: () => void): void;
function setRequestFilterExpression(expression: string): void;
function setProgressHandlerForRequest(handler: () => void): void;
}
export function startWithToken(
token: string,
invocationEvent: invocationEvent[]
): void;
export function setUserData(userData: string): void;
export function setAutoScreenRecordingEnabled(autoScreenRecordingEnabled: boolean): void;
export function setAutoScreenRecordingMaxDuration(autoScreenRecordingMaxDuration: number): void;
export function setTrackUserSteps(isEnabled: boolean): void;
export function setIBGLogPrintsToConsole(printsToConsole: boolean): void;
export function setCrashReportingEnabled(enableCrashReporter: boolean): void;
export function setDidSelectPromptOptionHandler(didSelectPromptOptionHandler: () => void): void;
export function setSessionProfilerEnabled(sessionProfilerEnabled: boolean): void;
export function getUnreadMessagesCount(messageCountCallback: () => void): void;
export function setPushNotificationsEnabled(isPushNotificationEnabled: boolean): void;
export function setEmailFieldRequiredForActions(
isEmailFieldRequired: boolean,
actionTypes: actionTypes
): void;
export function setFloatingButtonEdge(
floatingButtonEdge: number,
offsetFromTop: number
): void;
export function setLocale(locale: locale): void;
export function setColorTheme(colorTheme: colorTheme): void;
export function setPrimaryColor(setPrimaryColor: number): void;
export function appendTags(tags: string[]): void;
export function resetTags(): void;
export function getTags(tagsCallback: () => void): void;
export function setStringToKey(
string: string,
key: strings,
): void;
export function setEnabledAttachmentTypes(
screenshot: boolean,
extraScreenshot: boolean,
galleryImage: boolean,
screenRecording: boolean
): void;
export function identifyUserWithEmail(
email: string,
name: string
): void;
export function logOut(): void;
export function logUserEventWithName(name: string, params?: any): void;
export function logVerbose(message: string): void;
export function logInfo(message: string): void;
export function logDebug(message: string): void;
export function logError(message: string): void;
export function logWarn(message: string): void;
export function clearLogs(): void;
export function setReproStepsMode(reproStepsMode: reproStepsMode): void;
export function setUserAttribute(
key: string,
value: string
): void;
export function getUserAttribute(
key: string,
userAttributeCallback: () => void)
: void;
export function removeUserAttribute(key: string): void;
export function getAllUserAttributes(userAttributesCallback: () => void): void;
export function clearAllUserAttributes(): void;
export function setChatNotificationEnabled(isChatNotificationEnabled: boolean): void;
export function setOnNewMessageHandler(onNewMessageHandler: () => void): void;
export function setViewHierarchyEnabled(viewHierarchyEnabled: boolean): void;
export function setSurveysEnabled(surveysEnabled: boolean): void;
export function setDebugEnabled(isDebugEnabled: boolean): void;
export function enable(): void;
export function disable(): void;
export function setEnableInAppNotificationSound(shouldPlaySound: boolean): void;
export function reportJSException(Exception: object): void;
export function isRunningLive(runningLiveCallBack: () => void): void;
export function setVideoRecordingFloatingButtonPosition(position: IBGPosition): void;
export function setShouldShowSurveysWelcomeScreen(shouldShowWelcomeScreen: boolean): void;
export function showWelcomeMessage(welcomeMessageMode: welcomeMessageMode): void;
export function setWelcomeMessageMode(welcomeMessageMode: welcomeMessageMode): void;
export function addFileAttachment(
filePath: string,
fileName: string
): void;
export function show(): void;
export function onReportSubmitHandler(preSendingHandler: (presendingHandler: Report) => void): void;
export function callPrivateApi(
apiName: string,
param: any
): void;
export enum invocationEvent {
none,
shake,
screenshot,
twoFingersSwipe,
floatingButton
}
export enum reproStepsMode {
enabled,
disabled,
enabledWithNoScreenshots
}
export enum dismissType {
submit,
cancel,
addAttachment
}
export enum promptOption {
bug,
chat,
feedback
}
export enum reportType {
bug,
feedback
}
export enum invocationMode {
NA,
newBug,
newFeedback,
newChat,
chatsList
}
export enum invocationOptions {
invocationOptionsEmailFieldHidden,
invocationOptionsEmailFieldOptional,
invocationOptionsCommentFieldRequired,
invocationOptionsDisablePostSendingDialog
}
export enum extendedBugReportMode {
enabledWithRequiredFields,
enabledWithOptionalFields,
disabled
}
export enum locale {
arabic,
chineseSimplified,
chineseTraditional,
czech,
danish,
dutch,
english,
french,
german,
italian,
japanese,
polish,
portugueseBrazil,
russian,
spanish,
swedish,
turkish,
korean
}
export enum colorTheme {
light,
dark
}
export enum floatingButtonEdge {
left,
right
}
export enum IBGPosition {
bottomRight,
topRight,
bottomLeft,
topLeft
}
export enum welcomeMessageMode {
live,
beta,
disabled
}
export enum actionTypes {
allActions,
reportBug,
requestNewFeature,
addCommentToFeature
}
export enum strings {
shakeHint,
swipeHint,
edgeSwipeStartHint,
startAlertText,
invalidEmailMessage,
invalidEmailTitle,
invalidCommentMessage,
invalidCommentTitle,
invocationHeader,
talkToUs,
reportBug,
reportFeedback,
emailFieldHint,
commentFieldHintForBugReport,
commentFieldHintForFeedback,
addVideoMessage,
addVoiceMessage,
addImageFromGallery,
addExtraScreenshot,
audioRecordingPermissionDeniedTitle,
audioRecordingPermissionDeniedMessage,
microphonePermissionAlertSettingsButtonText,
recordingMessageToHoldText,
recordingMessageToReleaseText,
conversationsHeaderTitle,
screenshotHeaderTitle,
chatsNoConversationsHeadlineText,
doneButtonText,
okButtonText,
cancelButtonText,
thankYouText,
audio,
video,
image,
chatsHeaderTitle,
team,
messagesNotification,
messagesNotificationAndOthers,
conversationTextFieldHint,
collectingDataText,
thankYouAlertText,
welcomeMessageBetaWelcomeStepTitle,
welcomeMessageBetaWelcomeStepContent,
welcomeMessageBetaHowToReportStepTitle,
welcomeMessageBetaHowToReportStepContent,
welcomeMessageBetaFinishStepTitle,
welcomeMessageBetaFinishStepContent,
welcomeMessageLiveWelcomeStepTitle,
welcomeMessageLiveWelcomeStepContent
}
interface Report {
logDebug(log: string);
logVerbose(log: string);
logWarn(log: string);
logError(log: string);
logInfo(log: string);
appendTag(tag: string);
appendConsoleLog(consoleLog: string);
setUserAttribute(key: string, value: string);
addFileAttachmentWithUrl(url: string, filename: string);
addFileAttachmentWithData(data: string, filename: string);
}