-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathglobal.d.ts
60 lines (56 loc) · 1.63 KB
/
global.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
export { };
declare global {
declare module 'dirty-json'
interface Blob {
toPNG(callback?: () => void): Promise<Blob | undefined>
toWebP(callback?: () => void): Promise<Blob | undefined>
toJPEG(callback?: () => void): Promise<Blob | undefined>
addOrUpdateExifData(userComment: string): Promise<Blob>
}
interface Window {
gapi: {
load: (api: string, callback: () => void) => void;
client: {
init: (config: {
apiKey: string;
discoveryDocs: string[];
}) => Promise<void>;
getToken: () => { access_token: string, expires_in: number } | null;
setToken: (token: { access_token: string }) => void;
drive: {
files: {
create: (params: {
resource: DriveFileResource;
media?: DriveFileMedia;
fields: string;
uploadType?: string;
}) => Promise<{ result: { id: string; name: string } }>;
list: (params: DriveListParams) => Promise<{
result: {
files: Array<{ id: string; name: string }>;
};
}>;
};
};
};
};
google: {
accounts: {
oauth2: {
initTokenClient: (config: {
client_id: string;
scope: string;
callback: (response: {
expires_in?: number;
access_token?: string;
error?: string;
}) => void;
}) => {
requestAccessToken: (params?: { prompt?: string }) => void;
};
revoke: (token: string) => void;
};
};
};
}
}