Datalynk Client
    Preparing search index...

    Class OfflineVault

    Index

    Constructors

    Properties

    enabled: boolean

    False when offline login is disabled or the environment lacks WebCrypto/IndexedDB/localStorage

    ready: Promise<void>

    Resolves once startup key loading has finished

    unlocked$: BehaviorSubject<boolean> = ...

    True once the data key is available in memory

    Accessors

    • get needsPassword(): boolean

      A saved offline login exists, but this session has not unlocked it yet

      Returns boolean

    • get unlocked(): boolean

      Returns boolean

    Methods

    • Remove offline login completely; anything sealed becomes unreadable

      Returns Promise<void>

    • Read the cached user profile; null while locked

      Type Parameters

      • T = any

      Returns Promise<null | T>

    • Saved offline login matches this user

      Parameters

      • realm: string
      • uid: number

      Returns boolean

    • Drop the in-memory and device keys but keep the password copy (queued work stays recoverable)

      Returns Promise<void>

    • Decrypt a value from IndexedDB. Unreadable values (old key / other user) return undefined.

      Type Parameters

      • T

      Parameters

      • value: any

      Returns Promise<undefined | T>

    • Called after a successful online password login. Wraps the data key with the password so this user can sign in offline later.

      Parameters

      • realm: string
      • login: string
      • uid: number
      • password: string

      Returns Promise<void>

    • Encrypt a value for IndexedDB (passes through when disabled)

      Type Parameters

      • T

      Parameters

      • value: T

      Returns Promise<Sealed | T>

    • Save the cached user profile (sealed when enabled)

      Parameters

      • user: any

      Returns Promise<void>

    • The server confirmed this user's session: restart the offline window

      Parameters

      • realm: undefined | string
      • uid: undefined | number

      Returns void

    • Try to unlock offline with a password

      Parameters

      • realm: string
      • login: string
      • uid: undefined | number
      • password: string

      Returns Promise<OfflineUnlockResult>

    • Wait until the data key is available (resolves immediately when the vault is disabled)

      Returns Promise<boolean>