feat: add models package
This commit is contained in:
20
packages/models/src/Domain/Syncable/UserPrefs/UserPrefs.ts
Normal file
20
packages/models/src/Domain/Syncable/UserPrefs/UserPrefs.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { DecryptedItem } from '../../Abstract/Item/Implementations/DecryptedItem'
|
||||
import { ContentType } from '@standardnotes/common'
|
||||
import { Predicate } from '../../Runtime/Predicate/Predicate'
|
||||
import { PrefKey, PrefValue } from './PrefKey'
|
||||
|
||||
export class SNUserPrefs extends DecryptedItem {
|
||||
static singletonPredicate = new Predicate('content_type', '=', ContentType.UserPrefs)
|
||||
|
||||
override get isSingleton(): true {
|
||||
return true
|
||||
}
|
||||
|
||||
override singletonPredicate(): Predicate<SNUserPrefs> {
|
||||
return SNUserPrefs.singletonPredicate
|
||||
}
|
||||
|
||||
getPref<K extends PrefKey>(key: K): PrefValue[K] | undefined {
|
||||
return this.getAppDomainValue(key)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user