Package-level declarations

Types

Link copied to clipboard
class IndexedDbStorage<T : Any>(serializer: OkioSerializer<T>, name: String) : Storage<T>

Functions

Link copied to clipboard

EncryptedStoreHandle that forces a DataStore rewrite so ciphertext is sealed under the current primary key material after rotation.

Link copied to clipboard
fun <T : Any> createEncryptedProtoDataStore(storage: Storage<T>, migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null, registry: StoreRegistry? = null): DataStore<T>

Creates a DataStore over a caller-supplied storage (Okio, IndexedDB, etc.).

fun <T : Any> createEncryptedProtoDataStore(cipher: Cipher, kSerializer: KSerializer<T>, defaultValue: T, locator: StoreLocator, options: EncryptedStoreOptions = EncryptedStoreOptions(), migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null, registry: StoreRegistry? = null): DataStore<T>

Canonical encrypted typed factory. Prefer StoreLocator.Platform from commonMain (Okio on file targets, IndexedDB on JS/Wasm).

fun <T : Any> createEncryptedProtoDataStore(cipher: Cipher, kSerializer: KSerializer<T>, defaultValue: T, producePath: () -> Path, options: EncryptedStoreOptions = EncryptedStoreOptions(), migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null, registry: StoreRegistry? = null): DataStore<T>

Okio typed path factory with AEAD. Prefer StoreLocator.File / StoreLocator.Platform from shared code.

Link copied to clipboard
fun <T : Any> createPlainProtoDataStore(storage: Storage<T>, migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null): DataStore<T>

Plain (unencrypted) typed DataStore over caller-supplied storage (Okio, IndexedDB, etc.).

fun <T : Any> createPlainProtoDataStore(kSerializer: KSerializer<T>, defaultValue: T, locator: StoreLocator, migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null): DataStore<T>

Canonical plain typed factory. Prefer StoreLocator.Platform from commonMain (Okio on file targets, IndexedDB on JS/Wasm).

fun <T : Any> createPlainProtoDataStore(kSerializer: KSerializer<T>, defaultValue: T, producePath: () -> Path, migrations: List<DataMigration<T>> = emptyList(), corruptionHandler: ReplaceFileCorruptionHandler<T>? = null): DataStore<T>

Okio typed path factory without encryption. Prefer StoreLocator.File from shared code.

Link copied to clipboard
fun <T : Any> encryptedProtoSerializer(cipher: Cipher, kSerializer: KSerializer<T>, defaultValue: T, options: EncryptedStoreOptions = EncryptedStoreOptions()): EncryptedProtoSerializer<T>

Builds an EncryptedProtoSerializer for use with custom Storage (e.g. IndexedDB).

Link copied to clipboard
fun <T : Any> plainProtoSerializer(kSerializer: KSerializer<T>, defaultValue: T): ProtoOkioSerializer<T>

Builds a ProtoOkioSerializer for custom Storage (e.g. IndexedDB) without encryption.