diff options
Diffstat (limited to 'viewer/src/@types')
-rw-r--r-- | viewer/src/@types/gallery.ts (renamed from viewer/src/@types/gallery.d.ts) | 134 | ||||
-rw-r--r-- | viewer/src/@types/itemType.ts (renamed from viewer/src/@types/ItemType.ts) | 16 | ||||
-rw-r--r-- | viewer/src/@types/operation.ts (renamed from viewer/src/@types/Operation.ts) | 8 | ||||
-rw-r--r-- | viewer/src/@types/scrollposition.d.ts | 20 | ||||
-rw-r--r-- | viewer/src/@types/splashscreen.ts (renamed from viewer/src/@types/splashscreen.d.ts) | 2 | ||||
-rw-r--r-- | viewer/src/@types/tag.ts (renamed from viewer/src/@types/tag.d.ts) | 5 | ||||
-rw-r--r-- | viewer/src/@types/v-lazy-image.d.ts | 20 | ||||
-rw-r--r-- | viewer/src/@types/vue-dragscroll.d.ts | 20 |
8 files changed, 85 insertions, 140 deletions
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.ts index 0b4cfc4..8c0f177 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ldgallery - A static generator which turns a collection of tagged | 1 | /* ldgallery - A static generator which turns a collection of tagged |
2 | -- pictures into a searchable web gallery. | 2 | -- pictures into a searchable web gallery. |
3 | -- | 3 | -- |
4 | -- Copyright (C) 2019-2020 Guillaume FOUET | 4 | -- Copyright (C) 2019-2022 Guillaume FOUET |
5 | -- | 5 | -- |
6 | -- This program is free software: you can redistribute it and/or modify | 6 | -- This program is free software: you can redistribute it and/or modify |
7 | -- it under the terms of the GNU Affero General Public License as | 7 | -- it under the terms of the GNU Affero General Public License as |
@@ -17,10 +17,10 @@ | |||
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 | import { ItemType } from "./ItemType"; | 20 | import { ItemType } from './itemType'; |
21 | import { SplashScreenConfig } from "./splashscreen"; | 21 | import { SplashScreenConfig } from './splashscreen'; |
22 | 22 | ||
23 | export type ItemSortStr = "title_asc" | "date_asc" | "date_desc"; | 23 | export type ItemSortStr = 'title_asc' | 'date_asc' | 'date_desc'; |
24 | 24 | ||
25 | export interface Config { | 25 | export interface Config { |
26 | galleryRoot: string; | 26 | galleryRoot: string; |
@@ -30,39 +30,54 @@ export interface Config { | |||
30 | splashScreen?: SplashScreenConfig; | 30 | splashScreen?: SplashScreenConfig; |
31 | } | 31 | } |
32 | 32 | ||
33 | export interface Properties { | 33 | // --- |
34 | galleryTitle: string; | 34 | |
35 | tagCategories: RawTag[]; | 35 | export interface Resolution { |
36 | width: number; | ||
37 | height: number; | ||
36 | } | 38 | } |
37 | export interface Index { | 39 | export interface Thumbnail { |
38 | properties: Properties; | 40 | resource: string; |
39 | tree: DirectoryItem; | 41 | resolution: Resolution; |
40 | } | 42 | } |
43 | export type RawTag = string; | ||
41 | 44 | ||
42 | export interface OtherItem extends Item { | 45 | // --- |
43 | properties: OtherProperties; | 46 | |
47 | export interface Downloadable { | ||
48 | resource: string; | ||
49 | type: ItemType; // unknown | ||
44 | } | 50 | } |
45 | export interface PictureItem extends Item { | 51 | export interface OtherProperties extends Downloadable { |
46 | properties: PictureProperties; | 52 | type: ItemType.OTHER; |
47 | } | 53 | } |
48 | export interface PlainTextItem extends Item { | 54 | export interface PictureProperties extends Downloadable { |
49 | properties: PlainTextProperties; | 55 | type: ItemType.PICTURE; |
56 | resolution: Resolution; | ||
50 | } | 57 | } |
51 | export interface MarkdownItem extends Item { | 58 | export interface PlainTextProperties extends Downloadable { |
52 | properties: MarkdownProperties; | 59 | type: ItemType.PLAINTEXT; |
53 | } | 60 | } |
54 | export interface PDFItem extends Item { | 61 | export interface MarkdownProperties extends Downloadable { |
55 | properties: PDFProperties; | 62 | type: ItemType.MARKDOWN; |
56 | } | 63 | } |
57 | export interface VideoItem extends Item { | 64 | export interface PDFProperties extends Downloadable { |
58 | properties: VideoProperties; | 65 | type: ItemType.PDF; |
59 | } | 66 | } |
60 | export interface AudioItem extends Item { | 67 | export interface VideoProperties extends Downloadable { |
61 | properties: AudioProperties; | 68 | type: ItemType.VIDEO; |
62 | } | 69 | } |
63 | export interface DirectoryItem extends Item { | 70 | export interface AudioProperties extends Downloadable { |
64 | properties: DirectoryProperties; | 71 | type: ItemType.AUDIO; |
65 | } | 72 | } |
73 | export interface DirectoryProperties { | ||
74 | type: ItemType.DIRECTORY; | ||
75 | // eslint-disable-next-line no-use-before-define | ||
76 | items: Item[]; | ||
77 | } | ||
78 | |||
79 | // --- | ||
80 | |||
66 | export interface Item { | 81 | export interface Item { |
67 | title: string; | 82 | title: string; |
68 | datetime: string; | 83 | datetime: string; |
@@ -71,55 +86,44 @@ export interface Item { | |||
71 | path: string; | 86 | path: string; |
72 | thumbnail?: Thumbnail; | 87 | thumbnail?: Thumbnail; |
73 | properties: | 88 | properties: |
74 | | OtherProperties | 89 | | Downloadable |
75 | | PictureProperties | ||
76 | | PlainTextProperties | ||
77 | | MarkdownProperties | ||
78 | | PDFProperties | ||
79 | | VideoProperties | ||
80 | | AudioProperties | ||
81 | | DirectoryProperties; | 90 | | DirectoryProperties; |
82 | } | 91 | } |
83 | export interface Resolution { | 92 | export interface DownloadableItem extends Item { // Special unknown item type |
84 | width: number; | 93 | properties: Downloadable; |
85 | height: number; | ||
86 | } | 94 | } |
87 | export interface OtherProperties { | 95 | export interface OtherItem extends Item { |
88 | type: ItemType.OTHER; | 96 | properties: OtherProperties; |
89 | resource: string; | ||
90 | } | 97 | } |
91 | export interface PictureProperties { | 98 | export interface PictureItem extends Item { |
92 | type: ItemType.PICTURE; | 99 | properties: PictureProperties; |
93 | resource: string; | ||
94 | resolution: Resolution; | ||
95 | } | 100 | } |
96 | export interface PlainTextProperties { | 101 | export interface PlainTextItem extends Item { |
97 | type: ItemType.PLAINTEXT; | 102 | properties: PlainTextProperties; |
98 | resource: string; | ||
99 | } | 103 | } |
100 | export interface MarkdownProperties { | 104 | export interface MarkdownItem extends Item { |
101 | type: ItemType.MARKDOWN; | 105 | properties: MarkdownProperties; |
102 | resource: string; | ||
103 | } | 106 | } |
104 | export interface PDFProperties { | 107 | export interface PDFItem extends Item { |
105 | type: ItemType.PDF; | 108 | properties: PDFProperties; |
106 | resource: string; | ||
107 | } | 109 | } |
108 | export interface VideoProperties { | 110 | export interface VideoItem extends Item { |
109 | type: ItemType.VIDEO; | 111 | properties: VideoProperties; |
110 | resource: string; | ||
111 | } | 112 | } |
112 | export interface AudioProperties { | 113 | export interface AudioItem extends Item { |
113 | type: ItemType.AUDIO; | 114 | properties: AudioProperties; |
114 | resource: string; | ||
115 | } | 115 | } |
116 | export interface DirectoryProperties { | 116 | export interface DirectoryItem extends Item { |
117 | type: ItemType.DIRECTORY; | 117 | properties: DirectoryProperties; |
118 | items: Item[]; | ||
119 | } | 118 | } |
120 | 119 | ||
121 | export interface Thumbnail { | 120 | // --- |
122 | resource: string; | 121 | |
123 | resolution: Resolution; | 122 | export interface IndexProperties { |
123 | galleryTitle: string; | ||
124 | tagCategories: RawTag[]; | ||
125 | } | ||
126 | export interface Index { | ||
127 | properties: IndexProperties; | ||
128 | tree: DirectoryItem; | ||
124 | } | 129 | } |
125 | export type RawTag = string; | ||
diff --git a/viewer/src/@types/ItemType.ts b/viewer/src/@types/itemType.ts index 5ef38d8..ecab05c 100644 --- a/viewer/src/@types/ItemType.ts +++ b/viewer/src/@types/itemType.ts | |||
@@ -18,12 +18,12 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | export enum ItemType { | 20 | export enum ItemType { |
21 | OTHER = "other", | 21 | OTHER = 'other', |
22 | PICTURE = "picture", | 22 | PICTURE = 'picture', |
23 | PLAINTEXT = "plaintext", | 23 | PLAINTEXT = 'plaintext', |
24 | MARKDOWN = "markdown", | 24 | MARKDOWN = 'markdown', |
25 | PDF = "pdf", | 25 | PDF = 'pdf', |
26 | VIDEO = "video", | 26 | VIDEO = 'video', |
27 | AUDIO = "audio", | 27 | AUDIO = 'audio', |
28 | DIRECTORY = "directory", | 28 | DIRECTORY = 'directory', |
29 | } | 29 | } |
diff --git a/viewer/src/@types/Operation.ts b/viewer/src/@types/operation.ts index e566f4b..ec6a2d3 100644 --- a/viewer/src/@types/Operation.ts +++ b/viewer/src/@types/operation.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* ldgallery - A static generator which turns a collection of tagged | 1 | /* ldgallery - A static generator which turns a collection of tagged |
2 | -- pictures into a searchable web gallery. | 2 | -- pictures into a searchable web gallery. |
3 | -- | 3 | -- |
4 | -- Copyright (C) 2019-2020 Guillaume FOUET | 4 | -- Copyright (C) 2019-2022 Guillaume FOUET |