Files
standardnotes-app-web/packages/snjs/lib/Migrations/StorageReaders/Reader.ts
Karol Sójko 55b1409a80 feat: add subscription manager to handle subscription sharing (#1517)
* feat: add subscription manager to handle subscription sharing

* fix(services): add missing methods to the interface

* fix(services): add subscription manager specs

* feat(snjs): add subscriptions e2e tests

* fix(snjs): add wait in subscription cancelling test

* fix(snjs): checking for canceled invitations in tests

* fix(snjs): add e2e test for restored limit of subscription invitations

* chore(lint): fix linter issues
2022-09-13 10:28:11 +02:00

33 lines
983 B
TypeScript

import { Environment } from '@standardnotes/models'
import { ApplicationIdentifier } from '@standardnotes/common'
import { DeviceInterface } from '@standardnotes/services'
/**
* A storage reader reads storage via a device interface
* given a specific version of SNJS
*/
export abstract class StorageReader {
constructor(
protected deviceInterface: DeviceInterface,
protected identifier: ApplicationIdentifier,
protected environment: Environment,
) {}
public static version(): string {
throw Error('Must override')
}
public abstract getAccountKeyParams(): Promise<unknown | undefined>
/**
* Returns true if the state of storage has account keys present
* in version-specific storage (either keychain or raw storage)
*/
public abstract hasNonWrappedAccountKeys(): Promise<boolean>
public abstract hasPasscode(): Promise<boolean>
/** Whether this version used the keychain to store keys */
public abstract usesKeychain(): boolean
}