| // Signature format: 4.0 |
| package androidx.datastore.core { |
| |
| public final class CorruptionException extends java.io.IOException { |
| ctor public CorruptionException(String message, optional Throwable? cause); |
| } |
| |
| public interface DataMigration<T> { |
| method public suspend Object? cleanUp(kotlin.coroutines.Continuation<? super kotlin.Unit>); |
| method public suspend Object? migrate(T? currentData, kotlin.coroutines.Continuation<? super T>); |
| method public suspend Object? shouldMigrate(T? currentData, kotlin.coroutines.Continuation<? super java.lang.Boolean>); |
| } |
| |
| public interface DataStore<T> { |
| method public kotlinx.coroutines.flow.Flow<T> getData(); |
| method public suspend Object? updateData(kotlin.jvm.functions.Function2<? super T,? super kotlin.coroutines.Continuation<? super T>,?> transform, kotlin.coroutines.Continuation<? super T>); |
| property public abstract kotlinx.coroutines.flow.Flow<T> data; |
| } |
| |
| public final class DataStoreFactory { |
| method public <T> androidx.datastore.core.DataStore<T> create(androidx.datastore.core.Serializer<T> serializer, optional androidx.datastore.core.handlers.ReplaceFileCorruptionHandler<T>? corruptionHandler, optional java.util.List<? extends androidx.datastore.core.DataMigration<T>> migrations, optional kotlinx.coroutines.CoroutineScope scope, kotlin.jvm.functions.Function0<? extends java.io.File> produceFile); |
| method public <T> androidx.datastore.core.DataStore<T> create(androidx.datastore.core.Serializer<T> serializer, optional androidx.datastore.core.handlers.ReplaceFileCorruptionHandler<T>? corruptionHandler, optional java.util.List<? extends androidx.datastore.core.DataMigration<T>> migrations, kotlin.jvm.functions.Function0<? extends java.io.File> produceFile); |
| method public <T> androidx.datastore.core.DataStore<T> create(androidx.datastore.core.Serializer<T> serializer, optional androidx.datastore.core.handlers.ReplaceFileCorruptionHandler<T>? corruptionHandler, kotlin.jvm.functions.Function0<? extends java.io.File> produceFile); |
| method public <T> androidx.datastore.core.DataStore<T> create(androidx.datastore.core.Serializer<T> serializer, kotlin.jvm.functions.Function0<? extends java.io.File> produceFile); |
| field public static final androidx.datastore.core.DataStoreFactory INSTANCE; |
| } |
| |
| public interface Serializer<T> { |
| method public T! getDefaultValue(); |
| method public suspend Object? readFrom(java.io.InputStream input, kotlin.coroutines.Continuation<? super T>); |
| method public suspend Object? writeTo(T? t, java.io.OutputStream output, kotlin.coroutines.Continuation<? super kotlin.Unit>); |
| property public abstract T! defaultValue; |
| } |
| |
| } |
| |
| package androidx.datastore.core.handlers { |
| |
| public final class ReplaceFileCorruptionHandler<T> { |
| ctor public ReplaceFileCorruptionHandler(kotlin.jvm.functions.Function1<? super androidx.datastore.core.CorruptionException,? extends T> produceNewData); |
| method @kotlin.jvm.Throws(exceptionClasses=IOException::class) public suspend Object? handleCorruption(androidx.datastore.core.CorruptionException ex, kotlin.coroutines.Continuation<? super T>) throws java.io.IOException; |
| } |
| |
| } |
| |