forked from tien271/cordova-plugin-photo-library-wkwebview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhotoLibrary.d.ts
87 lines (67 loc) · 3.46 KB
/
PhotoLibrary.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
75
76
77
78
79
80
81
82
83
84
85
86
87
declare module PhotoLibraryCordova {
export interface Plugin {
getLibrary(success: (chunk: { library: LibraryItem[], isLastChunk: boolean }) => void, error: (err: any) => void, options?: GetLibraryOptions): void;
requestAuthorization(success: () => void, error: (err: any) => void, options?: RequestAuthorizationOptions): void;
getAlbums(success: (result: AlbumItem[]) => void, error: (err:any) => void): void;
isAuthorized(success: (result: boolean) => void, error: (err:any) => void): void;
getThumbnailURL(photoId: string, success: (result: string) => void, error: (err: any) => void, options?: GetThumbnailOptions): void;
getThumbnailURL(libraryItem: LibraryItem, success: (result: string) => void, error: (err: any) => void, options?: GetThumbnailOptions): void;
getThumbnailURL(photoId: string, options?: GetThumbnailOptions): string; // Will not work in browser
getThumbnailURL(libraryItem: LibraryItem, options?: GetThumbnailOptions): string; // Will not work in browser
getPhotoURL(photoId: string, success: (result: string) => void, error: (err: any) => void, options?: GetPhotoOptions): void;
getPhotoURL(libraryItem: LibraryItem, success: (result: string) => void, error: (err: any) => void, options?: GetPhotoOptions): void;
getPhotoURL(photoId: string, options?: GetPhotoOptions): string; // Will not work in browser
getPhotoURL(libraryItem: LibraryItem, options?: GetPhotoOptions): string; // Will not work in browser
getThumbnail(photoId: string, success: (result: Blob) => void, error: (err: any) => void, options?: GetThumbnailOptions): void;
getThumbnail(libraryItem: LibraryItem, success: (result: Blob) => void, error: (err: any) => void, options?: GetThumbnailOptions): void;
getPhoto(photoId: string, success: (result: Blob) => void, error: (err: any) => void, options?: GetPhotoOptions): void;
getPhoto(libraryItem: LibraryItem, success: (result: Blob) => void, error: (err: any) => void, options?: GetPhotoOptions): void;
getLibraryItem(libraryItem: LibraryItem, success: (result: Blob) => void, error: (err: any) => void, options?: GetPhotoOptions): void;
stopCaching(success: () => void, error: (err: any) => void): void;
saveImage(url: string, album: AlbumItem | string, success: (libraryItem: LibraryItem) => void, error: (err: any) => void, options?: GetThumbnailOptions): void;
saveVideo(url: string, album: AlbumItem | string, success: () => void, error: (err: any) => void): void;
}
export interface LibraryItem {
id: string;
photoURL: string;
thumbnailURL: string;
fileName: string;
width: number;
height: number;
creationDate: Date;
latitude?: number;
longitude?: number;
albumIds?: string[];
}
export interface AlbumItem {
id: string;
title: string;
}
export interface GetLibraryOptions {
thumbnailWidth?: number;
thumbnailHeight?: number;
quality?: number;
itemsInChunk?: number;
chunkTimeSec?: number;
useOriginalFileNames?: boolean;
includeImages?: boolean;
includeAlbumData?: boolean;
includeCloudData?: boolean;
includeVideos?: boolean;
maxItems?: number;
}
export interface RequestAuthorizationOptions {
read?: boolean;
write?: boolean;
}
export interface GetThumbnailOptions {
thumbnailWidth?: number;
thumbnailHeight?: number;
quality?: number;
}
export interface GetPhotoOptions {
}
}
interface CordovaPlugins {
photoLibrary: PhotoLibraryCordova.Plugin;
}