diff options
Diffstat (limited to 'viewer/src/@types/gallery.d.ts')
-rw-r--r-- | viewer/src/@types/gallery.d.ts | 185 |
1 files changed, 94 insertions, 91 deletions
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index e9b80e6..9011f19 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts | |||
@@ -17,98 +17,101 @@ | |||
17 | -- along with this program. If not, see <https://www.gnu.org/licenses/>. | 17 | -- along with this program. If not, see <https://www.gnu.org/licenses/>. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | declare namespace Gallery { | 20 | import { ItemType } from "./ItemType"; |
21 | type ItemSortStr = "title_asc" | "date_asc" | "date_desc"; | 21 | import { SplashScreenConfig } from "./splashscreen"; |
22 | 22 | ||
23 | interface Config { | 23 | export type ItemSortStr = "title_asc" | "date_asc" | "date_desc"; |
24 | galleryRoot: string; | ||
25 | galleryIndex?: string; | ||
26 | initialItemSort?: ItemSortStr; | ||
27 | initialTagDisplayLimit?: number; | ||
28 | } | ||
29 | 24 | ||
30 | interface GalleryProperties { | 25 | export interface Config { |
31 | galleryTitle: string; | 26 | galleryRoot: string; |
32 | tagCategories: RawTag[]; | 27 | galleryIndex?: string; |
33 | } | 28 | initialItemSort?: ItemSortStr; |
34 | interface Index { | 29 | initialTagDisplayLimit?: number; |
35 | properties: GalleryProperties; | 30 | splashScreen?: SplashScreenConfig; |
36 | tree: Directory; | 31 | } |
37 | } | 32 | |
33 | export interface Properties { | ||
34 | galleryTitle: string; | ||
35 | tagCategories: RawTag[]; | ||
36 | } | ||
37 | export interface Index { | ||
38 | properties: Properties; | ||
39 | tree: DirectoryItem; | ||
40 | } | ||
41 | |||
42 | export interface OtherItem extends Item { | ||
43 | properties: OtherProperties; | ||
44 | } | ||
45 | export interface PictureItem extends Item { | ||
46 | properties: PictureProperties; | ||
47 | } | ||
48 | export interface PlainTextItem extends Item { | ||
49 | properties: PlainTextProperties; | ||
50 | } | ||
51 | export interface PDFItem extends Item { | ||
52 | properties: PDFProperties; | ||
53 | } | ||
54 | export interface VideoItem extends Item { | ||
55 | properties: VideoProperties; | ||
56 | } | ||
57 | export interface AudioItem extends Item { | ||
58 | properties: AudioProperties; | ||
59 | } | ||
60 | export interface DirectoryItem extends Item { | ||
61 | properties: DirectoryProperties; | ||
62 | } | ||
63 | export interface Item { | ||
64 | title: string; | ||
65 | datetime: string; | ||
66 | description: string; | ||
67 | tags: RawTag[]; | ||
68 | path: string; | ||
69 | thumbnail?: Thumbnail; | ||
70 | properties: | ||
71 | | OtherProperties | ||
72 | | PictureProperties | ||
73 | | PlainTextProperties | ||
74 | | PDFProperties | ||
75 | | VideoProperties | ||
76 | | AudioProperties | ||
77 | | DirectoryProperties; | ||
78 | } | ||
79 | export interface Resolution { | ||
80 | width: number; | ||
81 | height: number; | ||
82 | } | ||
83 | export interface OtherProperties { | ||
84 | type: ItemType.OTHER; | ||
85 | resource: string; | ||
86 | } | ||
87 | export interface PictureProperties { | ||
88 | type: ItemType.PICTURE; | ||
89 | resource: string; | ||
90 | resolution: Resolution; | ||
91 | } | ||
92 | export interface PlainTextProperties { | ||
93 | type: ItemType.PLAINTEXT; | ||
94 | resource: string; | ||
95 | } | ||
96 | export interface PDFProperties { | ||
97 | type: ItemType.PDF; | ||
98 | resource: string; | ||
99 | } | ||
100 | export interface VideoProperties { | ||
101 | type: ItemType.VIDEO; | ||
102 | resource: string; | ||
103 | } | ||
104 | export interface AudioProperties { | ||
105 | type: ItemType.AUDIO; | ||
106 | resource: string; | ||
107 | } | ||
108 | export interface DirectoryProperties { | ||
109 | type: ItemType.DIRECTORY; | ||
110 | items: Item[]; | ||
111 | } | ||
38 | 112 | ||
39 | interface Other extends Item { | 113 | export interface Thumbnail { |
40 | properties: OtherProperties; | 114 | resource: string; |
41 | } | 115 | resolution: Resolution; |
42 | interface Picture extends Item { | ||
43 | properties: PictureProperties; | ||
44 | } | ||
45 | interface PlainText extends Item { | ||
46 | properties: PlainTextProperties; | ||
47 | } | ||
48 | interface PDF extends Item { | ||
49 | properties: PDFProperties; | ||
50 | } | ||
51 | interface Video extends Item { | ||
52 | properties: VideoProperties; | ||
53 | } | ||
54 | interface Audio extends Item { | ||
55 | properties: AudioProperties; | ||
56 | } | ||
57 | interface Directory extends Item { | ||
58 | properties: DirectoryProperties; | ||
59 | } | ||
60 | interface Item { | ||
61 | title: string; | ||
62 | datetime: string; | ||
63 | description: string; | ||
64 | tags: RawTag[]; | ||
65 | path: string; | ||
66 | thumbnail?: Thumbnail; | ||
67 | properties: | ||
68 | | OtherProperties | ||
69 | | PictureProperties | ||
70 | | PlainTextProperties | ||
71 | | PDFProperties | ||
72 | | VideoProperties | ||
73 | | AudioProperties | ||
74 | | DirectoryProperties; | ||
75 | } | ||
76 | interface Resolution { | ||
77 | width: number; | ||
78 | height: number; | ||
79 | } | ||
80 | interface OtherProperties { | ||
81 | type: import("./ItemType").ItemType.OTHER; | ||
82 | resource: string; | ||
83 | } | ||
84 | interface PictureProperties { | ||
85 | type: import("./ItemType").ItemType.PICTURE; | ||
86 | resource: string; | ||
87 | resolution: Resolution; | ||
88 | } | ||
89 | interface PlainTextProperties { | ||
90 | type: import("./ItemType").ItemType.PLAINTEXT; | ||
91 | resource: string; | ||
92 | } | ||
93 | interface PDFProperties { | ||
94 | type: import("./ItemType").ItemType.PDF; | ||
95 | resource: string; | ||
96 | } | ||
97 | interface VideoProperties { | ||
98 | type: import("./ItemType").ItemType.VIDEO; | ||
99 | resource: string; | ||
100 | } | ||
101 | interface AudioProperties { | ||
102 | type: import("./ItemType").ItemType.AUDIO; | ||
103 | resource: string; | ||
104 | } | ||
105 | interface DirectoryProperties { | ||
106 | type: import("./ItemType").ItemType.DIRECTORY; | ||
107 | items: Item[]; | ||
108 | } | ||
109 | interface Thumbnail { | ||
110 | resource: string; | ||
111 | resolution: Resolution; | ||
112 | } | ||
113 | type RawTag = string; | ||
114 | } | 116 | } |
117 | export type RawTag = string; | ||