From 7d9ba5c08999c6482f0bc5e0c09c6f55b7724090 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 May 2021 11:15:29 +0200 Subject: Cleanup models directory organization --- server/types/models/actor/actor-follow.ts | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 server/types/models/actor/actor-follow.ts (limited to 'server/types/models/actor/actor-follow.ts') diff --git a/server/types/models/actor/actor-follow.ts b/server/types/models/actor/actor-follow.ts new file mode 100644 index 000000000..98a6ca8a5 --- /dev/null +++ b/server/types/models/actor/actor-follow.ts @@ -0,0 +1,65 @@ +import { PickWith } from '@shared/core-utils' +import { ActorFollowModel } from '../../../models/actor/actor-follow' +import { + MActor, + MActorChannelAccountActor, + MActorDefault, + MActorDefaultAccountChannel, + MActorDefaultChannelId, + MActorFormattable, + MActorHost, + MActorUsername +} from './actor' + +type Use = PickWith + +// ############################################################################ + +export type MActorFollow = Omit + +// ############################################################################ + +export type MActorFollowFollowingHost = + MActorFollow & + Use<'ActorFollowing', MActorUsername & MActorHost> + +// ############################################################################ + +// With actors or actors default + +export type MActorFollowActors = + MActorFollow & + Use<'ActorFollower', MActor> & + Use<'ActorFollowing', MActor> + +export type MActorFollowActorsDefault = + MActorFollow & + Use<'ActorFollower', MActorDefault> & + Use<'ActorFollowing', MActorDefault> + +export type MActorFollowFull = + MActorFollow & + Use<'ActorFollower', MActorDefaultAccountChannel> & + Use<'ActorFollowing', MActorDefaultAccountChannel> + +// ############################################################################ + +// For subscriptions + +export type MActorFollowActorsDefaultSubscription = + MActorFollow & + Use<'ActorFollower', MActorDefault> & + Use<'ActorFollowing', MActorDefaultChannelId> + +export type MActorFollowSubscriptions = + MActorFollow & + Use<'ActorFollowing', MActorChannelAccountActor> + +// ############################################################################ + +// Format for API or AP object + +export type MActorFollowFormattable = + Pick & + Use<'ActorFollower', MActorFormattable> & + Use<'ActorFollowing', MActorFormattable> -- cgit v1.2.3