Implement existing API types

This commit is contained in:
Melody Becker 2024-11-20 15:39:24 +01:00
parent e76490f637
commit a6291fd098
14 changed files with 108 additions and 21 deletions

View file

@ -0,0 +1,26 @@
import Model, { attr, hasMany, type AsyncHasMany } from '@ember-data/model'
import type RemoteServerModel from './remote-server'
import type AccountModel from './account'
import type MediaMetadataModel from './media-metadata'
export default class NoteModel extends Model {
@attr declare content: string
@attr declare originServer: RemoteServerModel
@attr declare originServerId: number
@attr declare reactionCount: number
@attr declare createdAt: Date
@attr declare updatedAt: Date
@attr declare author: AccountModel
@attr declare authorId: string
@attr declare contentWarning?: string
@attr declare inReplyToId?: string
@attr declare quotesId?: string
@attr declare emoteIds?: Array<string>
@hasMany('media-metadata')
declare attachments: AsyncHasMany<MediaMetadataModel>
@attr declare attachmentIds: Array<string>
@attr declare accessLevel: number
@hasMany('account') declare pings?: AsyncHasMany<AccountModel>
@attr declare pingIds?: Array<string>
@attr declare reactionIds: Array<number>
}