From b5fecbf44192144d1ca27c23a0b53922de288c10 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 21 Aug 2019 14:31:57 +0200 Subject: Type toActivityPubObject functions --- server/typings/models/account/account.ts | 4 ++++ server/typings/models/account/actor.ts | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'server/typings/models/account') diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts index cd20fe81b..ec78fece8 100644 --- a/server/typings/models/account/account.ts +++ b/server/typings/models/account/account.ts @@ -1,6 +1,7 @@ import { AccountModel } from '../../../models/account/account' import { MActor, + MActorAP, MActorAPI, MActorAudience, MActorDefault, @@ -89,3 +90,6 @@ export type MAccountSummaryFormattable = FunctionProperties & export type MAccountFormattable = FunctionProperties & Pick & Use<'Actor', MActorFormattable> + +export type MAccountAP = Pick & + Use<'Actor', MActorAP> diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts index 14ab2cd5b..d4bcac4a3 100644 --- a/server/typings/models/account/actor.ts +++ b/server/typings/models/account/actor.ts @@ -1,5 +1,5 @@ import { ActorModel } from '../../../models/activitypub/actor' -import { FunctionProperties, PickWith } from '../../utils' +import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' import { MAccount, MAccountDefault, MAccountId, MAccountIdActor } from './account' import { MServer, MServerHost, MServerHostBlocks, MServerRedundancyAllowed } from '../server' import { MAvatar, MAvatarFormattable } from './avatar' @@ -29,7 +29,7 @@ export type MActorLight = Omit // Some association attributes export type MActorHost = Use<'Server', MServerHost> -export type MActorRedundancyAllowed = Use<'Server', MServerRedundancyAllowed> +export type MActorRedundancyAllowedOpt = PickWithOpt export type MActorDefaultLight = MActorLight & Use<'Server', MServerHost> & @@ -115,4 +115,7 @@ export type MActorSummaryFormattable = FunctionProperties & export type MActorFormattable = MActorSummaryFormattable & Pick & - Use<'Server', MServer> + Use<'Server', MServerHost & Partial>> + +export type MActorAP = MActor & + Use<'Avatar', MAvatar> -- cgit v1.2.3