feat: improve types
This commit is contained in:
@ -5,4 +5,6 @@ export const PRIORITIES = {
|
||||
'HIGH': 3,
|
||||
'URGENT': 4,
|
||||
'DO_NOW': 5,
|
||||
} as const
|
||||
} as const
|
||||
|
||||
export type Priority = typeof PRIORITIES[keyof typeof PRIORITIES]
|
@ -6,6 +6,7 @@ import AttachmentModel from './attachment'
|
||||
import SubscriptionModel from '@/models/subscription'
|
||||
import {parseDateOrNull} from '@/helpers/parseDateOrNull'
|
||||
import type ListModel from './list'
|
||||
import type { Priority } from './constants/priorities'
|
||||
|
||||
const SUPPORTS_TRIGGERED_NOTIFICATION = 'Notification' in window && 'showTrigger' in Notification.prototype
|
||||
export const TASK_DEFAULT_COLOR = '#1973ff'
|
||||
@ -29,7 +30,7 @@ export default class TaskModel extends AbstractModel {
|
||||
description: string
|
||||
done: boolean
|
||||
doneAt: Date | null
|
||||
priority: 0
|
||||
priority: Priority
|
||||
labels: LabelModel[]
|
||||
assignees: UserModel[]
|
||||
|
||||
|
@ -2,18 +2,20 @@ import AbstractModel from './abstractModel'
|
||||
import UserModel from './user'
|
||||
import type TaskModel from './task'
|
||||
|
||||
export const RELATION_KINDS = [
|
||||
'subtask',
|
||||
'parenttask',
|
||||
'related',
|
||||
'duplicates',
|
||||
'blocking',
|
||||
'blocked',
|
||||
'precedes',
|
||||
'follows',
|
||||
'copiedfrom',
|
||||
'copiedto',
|
||||
] as const
|
||||
export const RELATION_KIND = {
|
||||
'SUBTASK': 'subtask',
|
||||
'PARENTTASK': 'parenttask',
|
||||
'RELATED': 'related',
|
||||
'DUPLICATES': 'duplicates',
|
||||
'BLOCKING': 'blocking',
|
||||
'BLOCKED': 'blocked',
|
||||
'PROCEDES': 'precedes',
|
||||
'FOLLOWS': 'follows',
|
||||
'COPIEDFROM': 'copiedfrom',
|
||||
'COPIEDTO': 'copiedto',
|
||||
} as const
|
||||
|
||||
export const RELATION_KINDS = [...Object.values(RELATION_KIND)] as const
|
||||
|
||||
export type RelationKind = typeof RELATION_KINDS[number]
|
||||
|
||||
|
Reference in New Issue
Block a user