Improve typing

This commit is contained in:
tamaina
2020-05-26 14:33:55 +09:00
parent 05c7cacdd1
commit 9bee9d20f7
9 changed files with 24 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import { Note } from './note';
import { FollowRequest } from './follow-request';
import { UserGroupInvitation } from './user-group-invitation';
import { AccessToken } from './access-token';
import { notificationTypes } from '../../types';
@Entity()
export class Notification {
@@ -66,10 +67,10 @@ export class Notification {
*/
@Index()
@Column('enum', {
enum: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'],
enum: notificationTypes,
comment: 'The type of the Notification.'
})
public type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollVote' | 'receiveFollowRequest' | 'followRequestAccepted' | 'groupInvited' | 'app';
public type: typeof notificationTypes[number];
/**
* 通知が読まれたかどうか