-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.ts
74 lines (59 loc) · 1.72 KB
/
index.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
export interface TellerUser {
id: string;
}
export interface TellerInstitution {
id: string;
name: string;
}
export interface TellerEnrollment {
id: string;
institution: TellerInstitution;
}
export interface TellerConnectEnrollment {
accessToken: string;
user: TellerUser;
enrollment: TellerEnrollment;
signatures?: string[];
}
export interface TellerConnectFailure {
type: "payee" | "payment";
code: "timeout" | "error";
message: string;
}
export type TellerConnectOnSuccess = (enrollment: TellerConnectEnrollment) => void;
export type TellerConnectOnInit = () => void;
export type TellerConnectOnExit = () => void;
export type TellerConnectOnFailure = (failure: TellerConnectFailure) => void;
export type TellerConnectOnEvent = (name: string, data: object) => void;
export interface TellerConnectOptions {
// Required options
applicationId: string;
onSuccess: TellerConnectOnSuccess;
// Additional options
environment?: "sandbox" | "development" | "production";
institution?: string;
selectAccount?: "disabled" | "single" | "multiple";
enrollmentId?: string;
connectToken?: string;
nonce?: string;
onInit?: TellerConnectOnInit;
onExit?: TellerConnectOnExit;
onFailure?: TellerConnectOnFailure;
// Undocumented options
appearance?: "dark" | "light" | "system";
products?: ("balance" | "identity" | "transactions" | "verify")[];
accountFilter?: object;
onEvent?: TellerConnectOnEvent;
}
export interface TellerConnectInstance {
open: () => void;
destroy: () => void;
}
export interface TellerConnect extends TellerConnectInstance {
setup: (config: TellerConnectOptions) => TellerConnectInstance;
}
declare global {
interface Window {
TellerConnect: TellerConnect;
}
}