+
import { FunctionProperties, PickWith, PickWithOpt } from '@shared/core-utils'
import { ActorModel } from '../../../models/activitypub/actor'
import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server'
import { MActorImage, MActorImageFormattable } from './actor-image'
type Use<K extends keyof ActorModel, M> = PickWith<ActorModel, K, M>
+type UseOpt<K extends keyof ActorModel, M> = PickWithOpt<ActorModel, K, M>
// ############################################################################
// Complex actor associations
+export type MActorImages =
+ MActor &
+ Use<'Avatar', MActorImage> &
+ UseOpt<'Banner', MActorImage>
+
export type MActorDefault =
MActor &
Use<'Server', MServer> &
Use<'Avatar', MActorImage>
+export type MActorDefaultChannelId =
+ MActorDefault &
+ Use<'VideoChannel', MChannelId>
+
+export type MActorDefaultBanner =
+ MActor &
+ Use<'Server', MServer> &
+ Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage>
+
// Actor with channel that is associated to an account and its actor
// Actor -> VideoChannel -> Account -> Actor
export type MActorChannelAccountActor =
MActor &
Use<'Server', MServer> &
Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage> &
Use<'Account', MAccount> &
Use<'VideoChannel', MChannelAccountActor>
MActor &
Use<'Server', MServer> &
Use<'Avatar', MActorImage> &
+ Use<'Banner', MActorImage> &
Use<'Account', MAccountDefault> &
Use<'VideoChannel', MChannelAccountDefault>
export type MActorFormattable =
MActorSummaryFormattable &
- Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> &
- Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>>
+ Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'bannerId' | 'avatarId'> &
+ Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> &
+ UseOpt<'Banner', MActorImageFormattable>
-export type MActorAP =
+type MActorAPBase =
MActor &
Use<'Avatar', MActorImage>
+
+export type MActorAPAccount =
+ MActorAPBase
+
+export type MActorAPChannel =
+ MActorAPBase &
+ Use<'Banner', MActorImage>