2022-10-18 22:52:54 +00:00
|
|
|
import { VueConstructor } from "vue";
|
|
|
|
|
2022-09-13 01:33:24 +00:00
|
|
|
export type IFileInfo = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Database file ID */
|
|
|
|
fileid: number;
|
|
|
|
/** Full file name, e.g. /pi/test/Qx0dq7dvEXA.jpg */
|
|
|
|
filename: string;
|
|
|
|
/** Original file name, e.g. /files/admin/pi/test/Qx0dq7dvEXA.jpg */
|
|
|
|
originalFilename: string;
|
|
|
|
/** Base name of file e.g. Qx0dq7dvEXA.jpg */
|
|
|
|
basename: string;
|
|
|
|
/** Etag identifier */
|
|
|
|
etag: string;
|
|
|
|
/** File has preview available */
|
|
|
|
hasPreview: boolean;
|
|
|
|
/** File is marked favorite */
|
|
|
|
favorite: boolean;
|
|
|
|
/** Vue flags */
|
|
|
|
flag?: number;
|
|
|
|
};
|
2022-09-13 01:33:24 +00:00
|
|
|
|
|
|
|
export type IDay = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Day ID */
|
|
|
|
dayid: number;
|
|
|
|
/** Number of photos in this day */
|
|
|
|
count: number;
|
|
|
|
/** Rows in the day */
|
|
|
|
rows?: IRow[];
|
|
|
|
/** List of photos for this day */
|
|
|
|
detail?: IPhoto[];
|
|
|
|
};
|
2022-09-13 01:33:24 +00:00
|
|
|
|
|
|
|
export type IPhoto = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Nextcloud ID of file */
|
|
|
|
fileid: number;
|
|
|
|
/** Etag from server */
|
|
|
|
etag?: string;
|
|
|
|
/** Bit flags */
|
|
|
|
flag: number;
|
|
|
|
/** DayID from server */
|
|
|
|
dayid?: number;
|
|
|
|
/** Width of full image */
|
|
|
|
w?: number;
|
|
|
|
/** Height of full image */
|
|
|
|
h?: number;
|
2022-10-18 21:08:27 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Grid display width px */
|
|
|
|
dispW?: number;
|
|
|
|
/** Grid display height px */
|
|
|
|
dispH?: number;
|
|
|
|
/** Grid display X px */
|
|
|
|
dispX?: number;
|
|
|
|
/** Grid display Y px */
|
|
|
|
dispY?: number;
|
|
|
|
/** Grid display row id (relative to head) */
|
|
|
|
dispRowNum?: number;
|
2022-10-18 21:08:27 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Reference to day object */
|
|
|
|
d?: IDay;
|
2022-10-18 21:08:27 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Face dimensions */
|
|
|
|
facerect?: IFaceRect;
|
2022-10-18 21:08:27 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Video flag from server */
|
|
|
|
isvideo?: boolean;
|
|
|
|
/** Favorite flag from server */
|
|
|
|
isfavorite?: boolean;
|
|
|
|
/** Is this a folder */
|
|
|
|
isfolder?: boolean;
|
|
|
|
/** Is this a tag */
|
|
|
|
istag?: boolean;
|
|
|
|
/** Is this an album */
|
|
|
|
isalbum?: boolean;
|
|
|
|
/** Is this a face */
|
|
|
|
isface?: boolean;
|
|
|
|
/** Optional datetaken epoch */
|
|
|
|
datetaken?: number;
|
|
|
|
};
|
2022-09-13 01:33:24 +00:00
|
|
|
|
2022-09-13 01:48:05 +00:00
|
|
|
export interface IFolder extends IPhoto {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Path to folder */
|
|
|
|
path: string;
|
|
|
|
/** FileInfos for preview images */
|
|
|
|
previewFileInfos?: IFileInfo[];
|
|
|
|
/** Name of folder */
|
|
|
|
name: string;
|
2022-09-13 01:48:05 +00:00
|
|
|
}
|
|
|
|
|
2022-10-06 23:28:35 +00:00
|
|
|
export interface ITag extends IPhoto {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Name of tag */
|
|
|
|
name: string;
|
|
|
|
/** Number of images in this tag */
|
|
|
|
count: number;
|
|
|
|
/** User for face if face */
|
|
|
|
user_id?: string;
|
|
|
|
/** Cache of previews */
|
|
|
|
previews?: IPhoto[];
|
2022-10-06 23:28:35 +00:00
|
|
|
}
|
|
|
|
|
2022-10-26 22:48:46 +00:00
|
|
|
export interface IAlbum extends ITag {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** ID of album */
|
|
|
|
album_id: number;
|
|
|
|
/** Owner of album */
|
|
|
|
user: string;
|
|
|
|
/** Created timestamp */
|
|
|
|
created: number;
|
|
|
|
/** Location string */
|
|
|
|
location: string;
|
|
|
|
/** File ID of last added photo */
|
|
|
|
last_added_photo: number;
|
2022-10-26 22:48:46 +00:00
|
|
|
}
|
|
|
|
|
2022-10-18 21:08:27 +00:00
|
|
|
export interface IFaceRect {
|
2022-10-28 19:08:34 +00:00
|
|
|
w: number;
|
|
|
|
h: number;
|
|
|
|
x: number;
|
|
|
|
y: number;
|
2022-10-18 21:08:27 +00:00
|
|
|
}
|
|
|
|
|
2022-09-13 01:33:24 +00:00
|
|
|
export type IRow = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Vue Recycler identifier */
|
|
|
|
id?: string;
|
|
|
|
/** Row ID from head */
|
|
|
|
num: number;
|
|
|
|
/** Day ID */
|
|
|
|
dayId: number;
|
|
|
|
/** Refrence to day object */
|
|
|
|
day: IDay;
|
|
|
|
/** Whether this is a head row */
|
|
|
|
type: IRowType;
|
|
|
|
/** [Head only] Title of the header */
|
|
|
|
name?: string;
|
|
|
|
/** [Head only] Boolean if the entire day is selected */
|
|
|
|
selected?: boolean;
|
|
|
|
/** Main list of photo items */
|
|
|
|
photos?: IPhoto[];
|
|
|
|
/** Height in px of the row */
|
|
|
|
size?: number;
|
|
|
|
/** Count of placeholders to create */
|
|
|
|
pct?: number;
|
|
|
|
};
|
2022-09-15 17:49:51 +00:00
|
|
|
export type IHeadRow = IRow & {
|
2022-10-28 19:08:34 +00:00
|
|
|
type: IRowType.HEAD;
|
|
|
|
selected: boolean;
|
|
|
|
super?: string;
|
|
|
|
};
|
2022-09-15 03:52:58 +00:00
|
|
|
export enum IRowType {
|
2022-10-28 19:08:34 +00:00
|
|
|
HEAD = 0,
|
|
|
|
PHOTOS = 1,
|
|
|
|
FOLDERS = 2,
|
2022-09-15 03:52:58 +00:00
|
|
|
}
|
2022-09-13 01:33:24 +00:00
|
|
|
|
|
|
|
export type ITick = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Day ID */
|
|
|
|
dayId: number;
|
|
|
|
/** Display top position */
|
|
|
|
topF: number;
|
|
|
|
/** Display top position (truncated to 1 decimal pt) */
|
|
|
|
top: number;
|
|
|
|
/** Y coordinate on recycler */
|
|
|
|
y: number;
|
|
|
|
/** Cumulative number of photos before this tick */
|
|
|
|
count: number;
|
|
|
|
/** Is a new month */
|
|
|
|
isMonth: boolean;
|
|
|
|
/** Text if any (e.g. year) */
|
|
|
|
text?: string | number;
|
|
|
|
/** Whether this tick should be shown */
|
|
|
|
s?: boolean;
|
|
|
|
/** Key for vue component */
|
|
|
|
key?: number;
|
|
|
|
};
|
2022-09-25 08:31:52 +00:00
|
|
|
|
|
|
|
export type TopMatter = {
|
2022-10-28 19:08:34 +00:00
|
|
|
type: TopMatterType;
|
|
|
|
};
|
2022-09-25 08:31:52 +00:00
|
|
|
export enum TopMatterType {
|
2022-10-28 19:08:34 +00:00
|
|
|
NONE = 0,
|
|
|
|
FOLDER = 1,
|
|
|
|
TAG = 2,
|
|
|
|
FACE = 3,
|
|
|
|
ALBUM = 4,
|
2022-09-25 08:31:52 +00:00
|
|
|
}
|
|
|
|
export type TopMatterFolder = TopMatter & {
|
2022-10-28 19:08:34 +00:00
|
|
|
type: TopMatterType.FOLDER;
|
|
|
|
list: {
|
|
|
|
text: string;
|
|
|
|
path: string;
|
|
|
|
}[];
|
|
|
|
};
|
2022-10-18 22:52:54 +00:00
|
|
|
|
|
|
|
export type ISelectionAction = {
|
2022-10-28 19:08:34 +00:00
|
|
|
/** Display text */
|
|
|
|
name: string;
|
|
|
|
/** Icon component */
|
|
|
|
icon: VueConstructor;
|
|
|
|
/** Action to perform */
|
|
|
|
callback: (selection: Map<number, IPhoto>) => Promise<void>;
|
|
|
|
/** Condition to check for including */
|
|
|
|
if?: (self?: any) => boolean;
|
|
|
|
};
|