This repository has been archived by the owner on Oct 17, 2023. It is now read-only.
forked from Instabug/Instabug-React-Native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
402 lines (399 loc) · 12.1 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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
// 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 setInvocationOptions(invocationOptions: invocationOptions[]): void;
function onInvokeHandler(handler: () => void): void;
function onReportSubmitHandler(preSendingHandler: () => void): void;
function onSDKDismissedHandler(
handler: (dismiss: dismissType, report: reportType) => void
): void;
function setDidSelectPromptOptionHandler(
didSelectPromptOptionHandler: () => void
): 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;
function show(type: reportType, options: option[]): void;
function setAutoScreenRecordingEnabled(isEnabled: boolean): void;
function setViewHierarchyEnabled(isEnabled: boolean): void;
enum invocationEvent {
none,
shake,
screenshot,
twoFingersSwipe,
floatingButton
}
enum invocationOptions {
emailFieldHidden,
emailFieldOptional,
commentFieldRequired,
disablePostSendingDialog
}
enum extendedBugReportMode {
enabledWithRequiredFields,
enabledWithOptionalFields,
disabled
}
enum reportType {
bug,
feedback,
question
}
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 setEnabled(isEnabled: boolean): 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 setOnNewReplyReceivedHandler(
onNewReplyReceivedHandler: () => void
): void;
function getUnreadRepliesCount(
messageCountCallback: (count: number) => 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: (surveys: Survey[]) => void
): void;
function setAutoShowingEnabled(autoShowingSurveysEnabled: boolean): void;
function onShowCallback(willShowSurveyHandler: () => void): void;
function setOnShowHandler(onShowHandler: () => void): void;
function onDismissCallback(didDismissSurveyHandler: () => void): void;
function setOnDismissHandler(onDismissHandler: () => void): void;
function showSurvey(surveyToken: string): void;
function hasRespondedToSurvey(
surveyToken: string,
surveyTokenCallback: (hasResponded: boolean) => void
): void;
function setShouldShowWelcomeScreen(shouldShowWelcomeScreen: boolean): void;
function setAppStoreURL(appStoreURL: string): 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 start(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 setSdkDebugLogsLevel(
sdkDebugLogsLevel: sdkDebugLogsLevel
): void;
export function getUnreadMessagesCount(
messageCountCallback: (count: number) => 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(color: string): 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 setString(key: strings, string: string): void;
export function setEnabledAttachmentTypes(
screenshot: boolean,
extraScreenshot: boolean,
galleryImage: boolean,
screenRecording: boolean
): void;
export function identifyUserWithEmail(email: string, name: string): void;
export function identifyUser(email: string, name: string): void;
export function logOut(): void;
export function logUserEventWithName(name: string, params?: any): void;
export function logUserEvent(name: string): 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: (isLive: boolean) => 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 setPrivateView(viewRef: object): void;
export function show(): void;
export function onReportSubmitHandler(
preSendingHandler: (presendingHandler: Report) => void
): void;
export function callPrivateApi(apiName: string, param: any): void;
export function onNavigationStateChange(
prevState: any,
currentState: any,
action: any
): void;
export function onStateChange(
state: any
): void;
export function reportScreenChange(
screenName: string
): void;
export function componentDidAppearListener(componentObj:
{ componentId: any, componentName: any, passProps: any }
): void;
export enum invocationEvent {
none,
shake,
screenshot,
twoFingersSwipe,
floatingButton
}
export enum reproStepsMode {
enabled,
disabled,
enabledWithNoScreenshots
}
export enum dismissType {
submit,
cancel,
addAttachment
}
export enum invocationOptions {
invocationOptionsEmailFieldHidden,
invocationOptionsEmailFieldOptional,
invocationOptionsCommentFieldRequired,
invocationOptionsDisablePostSendingDialog
}
export enum sdkDebugLogsLevel {
sdkDebugLogsLevelVerbose,
sdkDebugLogsLevelDebug,
sdkDebugLogsLevelError,
sdkDebugLogsLevelNone,
}
export enum extendedBugReportMode {
enabledWithRequiredFields,
enabledWithOptionalFields,
disabled
}
export enum locale {
arabic,
azerbaijani,
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,
reportQuestion,
reportBug,
reportFeedback,
emailFieldHint,
commentFieldHintForBugReport,
commentFieldHintForFeedback,
commentFieldHintForQuestion,
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,
surveysCustomThanksTitle,
surveysCustomThanksSubTitle,
surveysStoreRatingThanksTitle,
surveysStoreRatingThanksSubtitle,
reportBugDescription,
reportFeedbackDescription,
reportQuestionDescription,
requestFeatureDescription
}
interface Report {
logDebug(log: string): void;
logVerbose(log: string): void;
logWarn(log: string): void;
logError(log: string): void;
logInfo(log: string): void;
appendTag(tag: string): void;
appendConsoleLog(consoleLog: string): void;
setUserAttribute(key: string, value: string): void;
addFileAttachmentWithUrl(url: string, filename: string): void;
addFileAttachmentWithData(data: string, filename: string): void;
}
interface Survey {
title: string;
}