@@ -26,8 +26,8 @@ import androidx.compose.ui.unit.dp
2626import com.sebastianneubauer.jsontree.CollapsableType
2727import com.sebastianneubauer.jsontree.JsonTreeElement
2828import com.sebastianneubauer.jsontree.diff.JsonTreeDifferState.JsonDiffElement
29- import com.sebastianneubauer.jsontree.diff.JsonTreeDiffError .OriginalJsonError
30- import com.sebastianneubauer.jsontree.diff.JsonTreeDiffError .RevisedJsonError
29+ import com.sebastianneubauer.jsontree.diff.DiffError .OriginalJsonError
30+ import com.sebastianneubauer.jsontree.diff.DiffError .RevisedJsonError
3131import kotlinx.coroutines.Dispatchers
3232
3333/* *
@@ -36,8 +36,8 @@ import kotlinx.coroutines.Dispatchers
3636 * @param originalJson The original JSON data as a string.
3737 * @param revisedJson The revised JSON data as a string which is compared with [originalJson].
3838 * @param onLoading A Composable which is show while the diff is being calculated.
39- * @param onError A Composable which is shown if an error occurs. Receives an [Error ] object with more information.
40- * @param onSuccess A callback which is called when the diff calculation succeeded. Receives an [Success ] object with more information.
39+ * @param onError A Composable which is shown if an error occurs. Receives an [JsonTreeDiffError ] object with more information.
40+ * @param onSuccess A callback which is called when the diff calculation succeeded. Receives an [JsonTreeDiffSuccess ] object with more information.
4141 * @param modifier The Modifier which is applied on the side-by-side diff. Not applied on the [onLoading] and [onError] slots.
4242 * @param showInlineDiffs If true, the diff shows partial changes within the text of a line.
4343 * @param contentPadding The content padding which is applied on the LazyColumn of the side-by-side diff.
@@ -49,8 +49,8 @@ public fun JsonTreeDiff(
4949 originalJson : String ,
5050 revisedJson : String ,
5151 onLoading : @Composable () -> Unit ,
52- onError : @Composable (Error ) -> Unit ,
53- onSuccess : (Success ) -> Unit = {},
52+ onError : @Composable (JsonTreeDiffError ) -> Unit ,
53+ onSuccess : (JsonTreeDiffSuccess ) -> Unit = {},
5454 modifier : Modifier = Modifier ,
5555 showInlineDiffs : Boolean = false,
5656 contentPadding : PaddingValues = PaddingValues (0.dp),
@@ -76,7 +76,7 @@ public fun JsonTreeDiff(
7676 when (val state = jsonTreeDiffer.state.value) {
7777 is JsonTreeDifferState .Loading -> onLoading()
7878 is JsonTreeDifferState .Ready -> {
79- onSuccess(Success (state.diffInfo))
79+ onSuccess(JsonTreeDiffSuccess (state.diffInfo))
8080
8181 Box (modifier = modifier) {
8282 SideBySideDiff (
@@ -87,8 +87,8 @@ public fun JsonTreeDiff(
8787 )
8888 }
8989 }
90- is JsonTreeDifferState .Error .OriginalJsonError -> onError(Error (OriginalJsonError (state.throwable)))
91- is JsonTreeDifferState .Error .RevisedJsonError -> onError(Error (RevisedJsonError (state.throwable)))
90+ is JsonTreeDifferState .Error .OriginalJsonError -> onError(JsonTreeDiffError (OriginalJsonError (state.throwable)))
91+ is JsonTreeDifferState .Error .RevisedJsonError -> onError(JsonTreeDiffError (RevisedJsonError (state.throwable)))
9292 }
9393}
9494
0 commit comments