aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/@types
diff options
context:
space:
mode:
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.ts20
-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.ts20
-rw-r--r--viewer/src/@types/vue-dragscroll.d.ts20
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
20import { ItemType } from "./ItemType"; 20import { ItemType } from './itemType';
21import { SplashScreenConfig } from "./splashscreen"; 21import { SplashScreenConfig } from './splashscreen';
22 22
23export type ItemSortStr = "title_asc" | "date_asc" | "date_desc"; 23export type ItemSortStr = 'title_asc' | 'date_asc' | 'date_desc';
24 24
25export interface Config { 25export 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
33export interface Properties { 33// ---
34 galleryTitle: string; 34
35 tagCategories: RawTag[]; 35export interface Resolution {
36 width: number;
37 height: number;
36} 38}
37export interface Index { 39export interface Thumbnail {
38 properties: Properties; 40 resource: string;
39 tree: DirectoryItem; 41 resolution: Resolution;
40} 42}
43export type RawTag = string;
41 44
42export interface OtherItem extends Item { 45// ---
43 properties: OtherProperties; 46
47export interface Downloadable {
48 resource: string;
49 type: ItemType; // unknown
44} 50}
45export interface PictureItem extends Item { 51export interface OtherProperties extends Downloadable {
46 properties: PictureProperties; 52 type: ItemType.OTHER;
47} 53}
48export interface PlainTextItem extends Item { 54export interface PictureProperties extends Downloadable {
49 properties: PlainTextProperties; 55 type: ItemType.PICTURE;
56 resolution: Resolution;
50} 57}
51export interface MarkdownItem extends Item { 58export interface PlainTextProperties extends Downloadable {
52 properties: MarkdownProperties; 59 type: ItemType.PLAINTEXT;
53} 60}
54export interface PDFItem extends Item { 61export interface MarkdownProperties extends Downloadable {
55 properties: PDFProperties; 62 type: ItemType.MARKDOWN;
56} 63}
57export interface VideoItem extends Item { 64export interface PDFProperties extends Downloadable {
58 properties: VideoProperties; 65 type: ItemType.PDF;
59} 66}
60export interface AudioItem extends Item { 67export interface VideoProperties extends Downloadable {
61 properties: AudioProperties; 68 type: ItemType.VIDEO;
62} 69}
63export interface DirectoryItem extends Item { 70export interface AudioProperties extends Downloadable {
64 properties: DirectoryProperties; 71 type: ItemType.AUDIO;
65} 72}
73export interface DirectoryProperties {
74 type: ItemType.DIRECTORY;
75 // eslint-disable-next-line no-use-before-define
76 items: Item[];
77}
78
79// ---
80
66export interface Item { 81export 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}
83export interface Resolution { 92export interface DownloadableItem extends Item { // Special unknown item type
84 width: number; 93 properties: Downloadable;
85 height: number;
86} 94}
87export interface OtherProperties { 95export interface OtherItem extends Item {
88 type: ItemType.OTHER; 96 properties: OtherProperties;
89 resource: string;
90} 97}
91export interface PictureProperties { 98export interface PictureItem extends Item {
92 type: ItemType.PICTURE; 99 properties: PictureProperties;
93 resource: string;
94 resolution: Resolution;
95} 100}
96export interface PlainTextProperties { 101export interface PlainTextItem extends Item {
97 type: ItemType.PLAINTEXT; 102 properties: PlainTextProperties;
98 resource: string;
99} 103}
100export interface MarkdownProperties { 104export interface MarkdownItem extends Item {
101 type: ItemType.MARKDOWN; 105 properties: MarkdownProperties;
102 resource: string;
103} 106}
104export interface PDFProperties { 107export interface PDFItem extends Item {
105 type: ItemType.PDF; 108 properties: PDFProperties;
106 resource: string;
107} 109}
108export interface VideoProperties { 110export interface VideoItem extends Item {
109 type: ItemType.VIDEO; 111 properties: VideoProperties;
110 resource: string;
111} 112}
112export interface AudioProperties { 113export interface AudioItem extends Item {
113 type: ItemType.AUDIO; 114 properties: AudioProperties;
114 resource: string;
115} 115}
116export interface DirectoryProperties { 116export interface DirectoryItem extends Item {
117 type: ItemType.DIRECTORY; 117 properties: DirectoryProperties;
118 items: Item[];
119} 118}
120 119
121export interface Thumbnail { 120// ---
122 resource: string; 121
123 resolution: Resolution; 122export interface IndexProperties {
123 galleryTitle: string;
124 tagCategories: RawTag[];
125}
126export interface Index {
127 properties: IndexProperties;
128 tree: DirectoryItem;
124} 129}
125export 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
20export enum ItemType { 20export 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