Package-level declarations

Types

Link copied to clipboard

One-time Android setup for AndroidCryptoContextHolder and io.github.jdbenitez94.criollo.kmp.foundation.kryptostore.serializers.KryptostorePaths when creating crypto stacks and stores from commonMain (not required for Context property delegates).

Functions

Link copied to clipboard
fun encryptedPreferencesDataStore(name: String, cipher: () -> Cipher, options: EncryptedStoreOptions.() -> Unit = {}, produceMigrations: (Context) -> List<DataMigration<Preferences>> = { emptyList() }, corruptionHandler: ReplaceFileCorruptionHandler<Preferences>? = null, registry: StoreRegistry? = null): ReadOnlyProperty<Context, DataStore<Preferences>>

Singleton encrypted Preferences DataStore (REQ-AND-02). File is stored as {name}.preferences_pb; name is the web/localStorage id.

Link copied to clipboard
fun <T : Any> encryptedProtoDataStore(fileName: String, kSerializer: KSerializer<T>, defaultValue: T, cipher: () -> Cipher, options: EncryptedStoreOptions.() -> Unit = {}, produceMigrations: (Context) -> List<DataMigration<T>> = { emptyList() }, corruptionHandler: ReplaceFileCorruptionHandler<T>? = null, registry: StoreRegistry? = null): ReadOnlyProperty<Context, DataStore<T>>

Singleton encrypted proto DataStore per fileName (REQ-AND-01).

Link copied to clipboard
fun plainPreferencesDataStore(name: String, produceMigrations: (Context) -> List<DataMigration<Preferences>> = { emptyList() }, corruptionHandler: ReplaceFileCorruptionHandler<Preferences>? = null): ReadOnlyProperty<Context, DataStore<Preferences>>

Singleton plain Preferences DataStore (REQ-AND-03).

Link copied to clipboard
fun <T : Any> plainProtoDataStore(fileName: String, kSerializer: KSerializer<T>, defaultValue: T, produceMigrations: (Context) -> List<DataMigration<T>> = { emptyList() }, corruptionHandler: ReplaceFileCorruptionHandler<T>? = null): ReadOnlyProperty<Context, DataStore<T>>

Singleton plain proto DataStore for non-sensitive typed settings. fileName is both the on-disk file and the web store id.