From 74c1c5e34787ac57299c8cbd874e9dcc56da406d Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 22 May 2020 04:14:48 +0200 Subject: viewer: Enumerated item types --- viewer/src/@types/gallery.d.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'viewer/src/@types/gallery.d.ts') diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index 2407f98..151ae92 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts @@ -60,44 +60,44 @@ declare namespace Gallery { path: string, thumbnail?: Thumbnail properties: OtherProperties - | PictureProperties - | PlainTextProperties - | PDFProperties - | VideoProperties - | AudioProperties - | DirectoryProperties, + | PictureProperties + | PlainTextProperties + | PDFProperties + | VideoProperties + | AudioProperties + | DirectoryProperties, } interface Resolution { width: number, height: number, } interface OtherProperties { - type: "other", + type: import("./ItemType").ItemType.OTHER, resource: string } interface PictureProperties { - type: "picture", + type: import("./ItemType").ItemType.PICTURE, resource: string, resolution: Resolution } interface PlainTextProperties { - type: "plaintext", + type: import("./ItemType").ItemType.PLAINTEXT, resource: string, } interface PDFProperties { - type: "pdf", + type: import("./ItemType").ItemType.PDF, resource: string, } interface VideoProperties { - type: "video", + type: import("./ItemType").ItemType.VIDEO, resource: string, } interface AudioProperties { - type: "audio", + type: import("./ItemType").ItemType.AUDIO, resource: string, } interface DirectoryProperties { - type: "directory", + type: import("./ItemType").ItemType.DIRECTORY, items: Item[] } interface Thumbnail { @@ -105,5 +105,4 @@ declare namespace Gallery { resolution: Resolution } type RawTag = string; - type ItemType = "other" | "picture" | "plaintext" | "pdf" | "video" | "audio" | "directory"; } -- cgit v1.2.3