I’m searching a way to avoid repeating T[“uuid”] in the following interface declaration:
export interface Foo<T extends { uuid: unknown; name: string } > {
getAll(): Promise<T[]>;
getAllIn(ids: T["uuid"][]): Promise<T[]>;
findOne(id: T["uuid"]): Promise<T | null>;
findOneByName(name: string): Promise<T | null>;
getOne(id: T["uuid"]): Promise<T>;
addOne(item: T): Promise<void>;
deleteOne(id: T["uuid"]): Promise<void>;
updateOne(item: T): Promise<void>;
}