2021-12-16 18:04:16 +01:00
|
|
|
import { PickWith } from '@shared/typescript-utils'
|
2021-05-11 11:15:29 +02:00
|
|
|
import { ActorFollowModel } from '../../../models/actor/actor-follow'
|
2019-08-20 13:52:49 +02:00
|
|
|
import {
|
|
|
|
MActor,
|
|
|
|
MActorChannelAccountActor,
|
|
|
|
MActorDefault,
|
2019-11-15 15:06:03 +01:00
|
|
|
MActorDefaultAccountChannel,
|
2021-04-06 17:01:35 +02:00
|
|
|
MActorDefaultChannelId,
|
2019-08-20 19:05:31 +02:00
|
|
|
MActorFormattable,
|
2019-08-20 13:52:49 +02:00
|
|
|
MActorHost,
|
|
|
|
MActorUsername
|
|
|
|
} from './actor'
|
|
|
|
|
|
|
|
type Use<K extends keyof ActorFollowModel, M> = PickWith<ActorFollowModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
2019-08-15 11:53:26 +02:00
|
|
|
|
|
|
|
export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollowing'>
|
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
// ############################################################################
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowFollowingHost =
|
|
|
|
MActorFollow &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ActorFollowing', MActorUsername & MActorHost>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// With actors or actors default
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowActors =
|
|
|
|
MActorFollow &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ActorFollower', MActor> &
|
|
|
|
Use<'ActorFollowing', MActor>
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowActorsDefault =
|
|
|
|
MActorFollow &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ActorFollower', MActorDefault> &
|
|
|
|
Use<'ActorFollowing', MActorDefault>
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowFull =
|
|
|
|
MActorFollow &
|
2019-08-30 16:50:12 +02:00
|
|
|
Use<'ActorFollower', MActorDefaultAccountChannel> &
|
|
|
|
Use<'ActorFollowing', MActorDefaultAccountChannel>
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// For subscriptions
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowActorsDefaultSubscription =
|
|
|
|
MActorFollow &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ActorFollower', MActorDefault> &
|
2021-04-06 17:01:35 +02:00
|
|
|
Use<'ActorFollowing', MActorDefaultChannelId>
|
2019-08-20 13:52:49 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowSubscriptions =
|
|
|
|
MActorFollow &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ActorFollowing', MActorChannelAccountActor>
|
2019-08-20 19:05:31 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MActorFollowFormattable =
|
|
|
|
Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &
|
2019-08-20 19:05:31 +02:00
|
|
|
Use<'ActorFollower', MActorFormattable> &
|
|
|
|
Use<'ActorFollowing', MActorFormattable>
|