Files
immich-magic-proxy/app/src/types.ts
T

92 lines
1.8 KiB
TypeScript

import { Request } from 'express-serve-static-core'
export enum AssetType {
image = 'IMAGE',
video = 'VIDEO'
}
export enum KeyType {
key = 'key',
slug = 'slug'
}
export interface ExifInfo {
description?: string;
exifImageWidth?: number;
exifImageHeight?: number;
// EXIF orientation string ("1".."8") or null. Values 5-8 indicate the image
// is rotated 90°/270°, so the displayed aspect ratio swaps width/height.
orientation?: string | null;
}
export enum AlbumType {
album = 'ALBUM',
individual = 'INDIVIDUAL'
}
export interface Asset {
id: string;
key: string;
keyType: KeyType;
originalFileName?: string;
originalMimeType: string;
password?: string;
fileCreatedAt?: string; // May not exist - see https://github.com/alangrainger/immich-public-proxy/issues/61
type: AssetType;
isTrashed: boolean;
exifInfo?: ExifInfo;
// Base64-encoded thumbhash for tasteful blur placeholders during lazy-load
thumbhash?: string;
}
export interface Album {
id: string;
assets: Asset[];
}
export interface SharedLink {
key: string;
keyType: KeyType;
type: string;
description?: string;
assets: Asset[];
allowDownload?: boolean;
password?: string;
album?: {
id: string;
albumName?: string;
order?: string;
description?: string;
}
expiresAt: string | null;
}
export interface SharedLinkResult {
valid: boolean;
key?: string;
passwordRequired?: boolean;
link?: SharedLink;
}
export enum ImageSize {
thumbnail = 'thumbnail',
preview = 'preview',
original = 'original'
}
export interface IncomingShareRequest {
req: Request;
key: string;
keyType?: KeyType;
password?: string;
mode?: string;
size?: ImageSize;
range?: string;
}
export enum DownloadAll {
disabled,
perImmich,
always
}