forked from ArmandoAssuncao/react-native-ca-mas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
39 lines (34 loc) · 1.14 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
declare module 'react-native-ca-mas' {
export interface IMAS {
debug: () => void
getState: () => PromiseLike<number>
invoke: <B, O>(path: string, options: IInvokeOptions<O>) => Promise<IInvokeResponse<B>>
isAuthenticationListenerRegistered: () => PromiseLike<boolean>
}
export interface IMASDevice {
deregister: () => Promise<void>
getIdentifier: () => PromiseLike<string>
isRegistered: () => PromiseLike<boolean>
resetLocally: () => void
}
export interface IMASUser {
getAuthCredentialsType: () => PromiseLike<string>
getCurrentUser: () => PromiseLike<any>
login: (username: string, password: string) => Promise<boolean>
logout: () => Promise<boolean>
}
export interface IInvokeOptions<B = any> {
body?: B
headers?: object
method: 'DELETE' | 'GET' | 'POST' | 'PUT'
}
export interface IInvokeResponse<B = any> {
body?: B
headers?: object
message?: string
statusCode?: number
}
export var MAS: IMAS
export var MASDevice: IMASDevice
export var MASUser: IMASUser
}