-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.d.ts
74 lines (66 loc) · 1.82 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
// Type definitions for react-native-survey-monkey
// Project: https://github.com/yarikpwnzer/react-native-survey-monkey
// Definitions by: Alan Soares <github.com/alanrsoares>
export interface ResponseAnswer {
row_id: number;
row_index: number;
row_value: string;
}
export interface ResponseItem {
page_index: number;
question_value: string;
question_index: number;
question_id: number;
page_id: number;
answers: ResponseAnswer[];
}
export interface SurveyMonkeyError {
code: string;
description: string;
fullDescription: string;
}
export interface Respondent {
completion_status: string;
responses: ResponseItem[];
}
export interface SurveyMonkeyResponse {
respondent: null | Respondent;
error: null | SurveyMonkeyError;
target: number;
}
export interface SurveyMonkeyProps {
/**
* Callback invoked once the survey is ended, whether completed or not
*/
onRespondentDidEndSurvey?: (response: SurveyMonkeyResponse) => void;
/**
* Only available on iOS, android doesn't use a title bar for webviews
*/
cancelButtonTintColor?: string;
}
export interface ConfirmDialogConfig {
title: string;
body: string;
positiveActionTitle: string;
cancelTitle: string;
afterInstallInterval: number;
afterAcceptInterval: number;
afterDeclineInterval: number;
}
declare class SurveyMonkey extends React.PureComponent<SurveyMonkeyProps> {
/**
* Shows the survey associated with the collectorHash
*
* @param collectorHash - hash generated for the SurveyMonkey mobile SDK
* @param customVariables
* @param customTitle
* @param confirmDialogParams
*/
public showSurveyMonkey(
collectorHash: string,
customVariables?: null | Record<string, string>,
customTitle?: null | string,
confirmDialogParams?: Partial<ConfirmDialogConfig>
): void;
}
export default SurveyMonkey;