summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-12 20:06:10 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-12 20:06:10 +0900
commita71682f6f0639bcedcc664f89615a54cbe397b68 (patch)
treed019c849a931871161f0fd31844bf91700b761e4
parentrefactor: fix types (diff)
downloadsharkey-a71682f6f0639bcedcc664f89615a54cbe397b68.tar.gz
sharkey-a71682f6f0639bcedcc664f89615a54cbe397b68.tar.bz2
sharkey-a71682f6f0639bcedcc664f89615a54cbe397b68.zip
refactor: fix types
-rw-r--r--packages/backend/src/core/activitypub/ApRendererService.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts
index b87aee8804..996ff625e8 100644
--- a/packages/backend/src/core/activitypub/ApRendererService.ts
+++ b/packages/backend/src/core/activitypub/ApRendererService.ts
@@ -24,7 +24,7 @@ import type { UsersRepository, UserProfilesRepository, NotesRepository, DriveFil
import { bindThis } from '@/decorators.js';
import { LdSignatureService } from './LdSignatureService.js';
import { ApMfmService } from './ApMfmService.js';
-import type { IAccept, IActivity, IAdd, IAnnounce, IApDocument, IApEmoji, IApHashtag, IApImage, IApMention, IBlock, ICreate, IDelete, IFlag, IFollow, IKey, ILike, IObject, IQuestion, IRead, IReject, IRemove, ITombstone, IUndo, IUpdate } from './type.js';
+import type { IAccept, IActivity, IAdd, IAnnounce, IApDocument, IApEmoji, IApHashtag, IApImage, IApMention, IBlock, ICreate, IDelete, IFlag, IFollow, IKey, ILike, IObject, IPost, IQuestion, IRead, IReject, IRemove, ITombstone, IUndo, IUpdate } from './type.js';
import type { IIdentifier } from './models/identifier.js';
@Injectable()
@@ -293,7 +293,7 @@ export class ApRendererService {
}
@bindThis
- public async renderNote(note: Note, dive = true, isTalk = false): Promise<IObject> {
+ public async renderNote(note: Note, dive = true, isTalk = false): Promise<IPost> {
const getPromisedFiles = async (ids: string[]) => {
if (!ids || ids.length === 0) return [];
const items = await this.driveFilesRepository.findBy({ id: In(ids) });
@@ -406,11 +406,11 @@ export class ApRendererService {
totalItems: poll!.votes[i],
},
})),
- } : {};
+ } as const : {};
const asTalk = isTalk ? {
_misskey_talk: true,
- } : {};
+ } as const : {};
return {
id: `${this.config.url}/notes/${note.id}`,
@@ -515,7 +515,7 @@ export class ApRendererService {
}
@bindThis
- public async renderQuestion(user: { id: User['id'] }, note: Note, poll: Poll): IQuestion {
+ public renderQuestion(user: { id: User['id'] }, note: Note, poll: Poll): IQuestion {
return {
type: 'Question',
id: `${this.config.url}/questions/${note.id}`,