chore: replace generated enums with actual types (#17463)

This commit is contained in:
Jason Rasmussen 2025-04-08 11:13:46 -04:00 committed by GitHub
parent b6c5a03533
commit 2c31a11e41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
server/src/db.d.ts vendored
View File

@ -4,7 +4,7 @@
*/
import type { ColumnType } from 'kysely';
import { AssetFileType, AssetType, MemoryType, Permission, SyncEntityType } from 'src/enum';
import { AssetFileType, AssetStatus, AssetType, MemoryType, Permission, SourceType, SyncEntityType } from 'src/enum';
import { UserTable } from 'src/schema/tables/user.table';
import { OnThisDayData } from 'src/types';
@ -12,8 +12,6 @@ export type ArrayType<T> = ArrayTypeImpl<T> extends (infer U)[] ? U[] : ArrayTyp
export type ArrayTypeImpl<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S[], I[], U[]> : T[];
export type AssetsStatusEnum = 'active' | 'deleted' | 'trashed';
export type Generated<T> =
T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
@ -31,8 +29,6 @@ export type JsonPrimitive = boolean | number | string | null;
export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
export type Sourcetype = 'exif' | 'machine-learning' | 'manual';
export type Timestamp = ColumnType<Date, Date | string, Date | string>;
export interface Activity {
@ -98,7 +94,7 @@ export interface AssetFaces {
imageHeight: Generated<number>;
imageWidth: Generated<number>;
personId: string | null;
sourceType: Generated<Sourcetype>;
sourceType: Generated<SourceType>;
}
export interface AssetFiles {
@ -152,7 +148,7 @@ export interface Assets {
ownerId: string;
sidecarPath: string | null;
stackId: string | null;
status: Generated<AssetsStatusEnum>;
status: Generated<AssetStatus>;
thumbhash: Buffer | null;
type: AssetType;
updatedAt: Generated<Timestamp>;