feat: add models package

This commit is contained in:
Karol Sójko
2022-07-05 20:47:11 +02:00
parent 60d1554ff7
commit b614c71e79
199 changed files with 8772 additions and 22 deletions

View 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)
}
}