vikunja-frontend/src/models/userSettings.ts

38 lines
1,014 B
TypeScript
Raw Normal View History

import AbstractModel from './abstractModel'
2022-07-21 00:42:36 +02:00
import type { IList } from './list'
export interface IUserSettings extends AbstractModel {
2022-06-23 03:22:21 +02:00
name: string
emailRemindersEnabled: boolean
discoverableByName: boolean
discoverableByEmail: boolean
overdueTasksRemindersEnabled: boolean
2022-07-21 00:42:36 +02:00
defaultListId: undefined | IList['id']
2022-06-23 03:22:21 +02:00
weekStart: 0 | 1 | 2 | 3 | 4 | 5 | 6
timezone: string
2022-07-21 00:42:36 +02:00
}
export default class UserSettingsModel extends AbstractModel implements IUserSettings {
declare name: string
declare emailRemindersEnabled: boolean
declare discoverableByName: boolean
declare discoverableByEmail: boolean
declare overdueTasksRemindersEnabled: boolean
declare defaultListId: undefined | IList['id']
declare weekStart: 0 | 1 | 2 | 3 | 4 | 5 | 6
declare timezone: string
2022-06-23 03:22:21 +02:00
defaults() {
return {
name: '',
emailRemindersEnabled: true,
discoverableByName: false,
discoverableByEmail: false,
overdueTasksRemindersEnabled: true,
defaultListId: undefined,
weekStart: 0,
timezone: '',
}
}
}