forked from osmlab/osm-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
54 lines (47 loc) · 1.58 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
// Type definitions for osm-auth 1.0.1
declare namespace OSMAuth {
interface OSMAuthConstructor {
new (options: OSMAuthOptions): OSMAuthInstance;
}
interface OSMAuthInstance {
logout(): OSMAuthInstance;
authenticated(): boolean;
authenticate(callback: (error: null | ErrorEvent | XMLHttpRequest, oauth?: OSMAuthInstance) => any): any;
xhr(options: OSMAuthXHROptions, callback: (error: null | ErrorEvent | XMLHttpRequest, xhr: any) => any): any;
options(): OSMAuthOptions;
options(options: OSMAuthNewOptions): OSMAuthInstance;
bootstrapToken(oauth_token: string, callback: (error: null | ErrorEvent | XMLHttpRequest, oauth?: OSMAuthInstance) => any): any;
preauth(options: OSMAuthOptions): OSMAuthInstance;
}
interface OSMAuthOptions {
oauth_consumer_key: string;
oauth_secret: string;
url?: string;
auto?: boolean;
loading?: () => any;
done?: () => any;
landing?: string;
singlepage?: boolean;
}
interface OSMAuthNewOptions {
oauth_consumer_key?: string;
oauth_secret?: string;
url?: string;
auto?: boolean;
loading?: () => any;
done?: () => any;
landing?: string;
singlepage?: boolean;
}
interface OSMAuthXHROptions {
path: string;
method: 'POST' | 'PUT' | 'GET' | 'DELETE';
content?: string;
prefix?: boolean;
options?: any;
}
}
declare var osmAuth: OSMAuth.OSMAuthConstructor;
declare module "osm-auth" {
export = osmAuth;
}