]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/account/actor-follow.ts
Cleanup model types
[github/Chocobozzz/PeerTube.git] / server / typings / models / account / actor-follow.ts
CommitLineData
453e83ea 1import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
0283eaac
C
2import {
3 MActor,
4 MActorAccount,
5 MActorAccountChannel,
6 MActorChannel,
7 MActorChannelAccountActor,
8 MActorDefault,
9 MActorHost,
10 MActorUsername
11} from './actor'
453e83ea 12import { PickWith } from '../../utils'
0283eaac
C
13import { ActorModel } from '@server/models/activitypub/actor'
14
15type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M>
16
17// ############################################################################
453e83ea
C
18
19export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollowing'>
20
0283eaac
C
21// ############################################################################
22
23export type MActorFollowFollowingHost = MActorFollow &
24 Use<'ActorFollowing', MActorUsername & MActorHost>
25
26// ############################################################################
27
28// With actors or actors default
29
453e83ea 30export type MActorFollowActors = MActorFollow &
0283eaac
C
31 Use<'ActorFollower', MActor> &
32 Use<'ActorFollowing', MActor>
453e83ea
C
33
34export type MActorFollowActorsDefault = MActorFollow &
0283eaac
C
35 Use<'ActorFollower', MActorDefault> &
36 Use<'ActorFollowing', MActorDefault>
453e83ea
C
37
38export type MActorFollowFull = MActorFollow &
0283eaac
C
39 Use<'ActorFollower', MActorAccountChannel> &
40 Use<'ActorFollowing', MActorAccountChannel>
453e83ea 41
0283eaac
C
42// ############################################################################
43
44// For subscriptions
45
46export type MActorFollowActorsDefaultSubscription = MActorFollow &
47 Use<'ActorFollower', MActorDefault> &
48 Use<'ActorFollowing', MActorDefault & MActorChannel>
49
50export type MActorFollowFollowingFullFollowerAccount = MActorFollow &
51 Use<'ActorFollower', MActorAccount> &
52 Use<'ActorFollowing', MActorAccountChannel>
453e83ea
C
53
54export type MActorFollowSubscriptions = MActorFollow &
0283eaac 55 Use<'ActorFollowing', MActorChannelAccountActor>