diff --git a/src/misc/schema.ts b/src/misc/schema.ts index d27c9eff99..52fbbca43b 100644 --- a/src/misc/schema.ts +++ b/src/misc/schema.ts @@ -47,6 +47,8 @@ export const refs = { GalleryPost: packedGalleryPostSchema, }; +export type Packed = SchemaType + export interface Schema extends SimpleSchema { items?: Schema; properties?: Obj; @@ -92,7 +94,7 @@ export type SchemaType

= p['type'] extends 'array' ? NullOrUndefined>[]> : p['type'] extends 'object' ? ( p['ref'] extends keyof typeof refs - ? NullOrUndefined> + ? NullOrUndefined> : NullOrUndefined>> ) : p['type'] extends 'any' ? NullOrUndefined : diff --git a/src/models/repositories/note.ts b/src/models/repositories/note.ts index 376a09d0c6..3a821e9d22 100644 --- a/src/models/repositories/note.ts +++ b/src/models/repositories/note.ts @@ -3,14 +3,14 @@ import * as mfm from 'mfm-js'; import { Note } from '@/models/entities/note'; import { User } from '@/models/entities/user'; import { Users, PollVotes, DriveFiles, NoteReactions, Followings, Polls, Channels } from '../index'; -import { SchemaType } from '@/misc/schema'; +import { Packed } from '@/misc/schema'; import { nyaize } from '@/misc/nyaize'; import { awaitAll } from '@/prelude/await-all'; import { convertLegacyReaction, convertLegacyReactions, decodeReaction } from '@/misc/reaction-lib'; import { NoteReaction } from '@/models/entities/note-reaction'; import { aggregateNoteEmojis, populateEmojis, prefetchEmojis } from '@/misc/populate-emojis'; -export type PackedNote = SchemaType; +export type PackedNote = Packed<'Note'>; @EntityRepository(Note) export class NoteRepository extends Repository {