mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
Add KDoc to the single-interface library and service API modules
Cover the last remaining interfaces across libraries/audio, libraries/cachestore, libraries/indicator, libraries/slashcommands, libraries/voiceplayer and services/apperror, with their members and parameters. This completes the effort: all 222 in-scope interfaces and their 820 members in the 60 api modules that hold any now carry documentation. Notable points: CacheStore applies no expiry of its own and only records when each entry was written, leaving staleness to the caller; SlashCommandService.parse never throws, returning NotACommand for ordinary text and an error case for a malformed command. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+16
@@ -11,10 +11,26 @@ package io.element.android.services.apperror.api
|
||||
import androidx.annotation.StringRes
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
/**
|
||||
* Surfaces app-wide error dialogs from anywhere, for the failures that are not tied to the screen the user is on.
|
||||
*/
|
||||
interface AppErrorStateService {
|
||||
/** The error to display, if any; observed once at the top of the app rather than per screen. */
|
||||
val appErrorStateFlow: StateFlow<AppErrorState>
|
||||
|
||||
/**
|
||||
* Shows an error dialog with already resolved text.
|
||||
*
|
||||
* @param title the dialog title.
|
||||
* @param body the dialog message; never put user content or secrets in it.
|
||||
*/
|
||||
fun showError(title: String, body: String)
|
||||
|
||||
/**
|
||||
* Shows an error dialog from string resources, which is the preferred form since it stays localised.
|
||||
*
|
||||
* @param titleRes resource id of the dialog title.
|
||||
* @param bodyRes resource id of the dialog message.
|
||||
*/
|
||||
fun showError(@StringRes titleRes: Int, @StringRes bodyRes: Int)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user