No default values for expect functions 4

This commit is contained in:
Syer10
2022-11-18 20:53:15 -05:00
parent 5ee31013ae
commit aeddd51430
9 changed files with 29 additions and 23 deletions

View File

@@ -22,7 +22,7 @@ import cafe.adriel.voyager.core.screen.Screen
actual interface ViewModelComponent : SharedViewModelComponent
@Composable
actual inline fun <reified VM : ViewModel> Screen.stateViewModel(
actual inline fun <reified VM : ViewModel> Screen.realStateViewModel(
tag: String?,
crossinline factory: @DisallowComposableCalls ViewModelComponent.(SavedStateHandle) -> VM
): VM {

View File

@@ -15,13 +15,13 @@ import androidx.compose.ui.unit.DpOffset
actual interface TooltipPlacement
actual class CursorPoint actual constructor(
actual class CursorPointImpl actual constructor(
offset: DpOffset,
alignment: Alignment,
windowMargin: Dp
) : TooltipPlacement
actual class ComponentRect actual constructor(
actual class ComponentRectImpl actual constructor(
anchor: Alignment,
alignment: Alignment,
offset: DpOffset

View File

@@ -72,9 +72,15 @@ interface SharedViewModelComponent {
expect interface ViewModelComponent : SharedViewModelComponent
@Composable
expect inline fun <reified VM : ViewModel> Screen.stateViewModel(
inline fun <reified VM : ViewModel> Screen.stateViewModel(
tag: String? = null,
crossinline factory: @DisallowComposableCalls ViewModelComponent.(SavedStateHandle) -> VM
): VM = realStateViewModel(tag, factory)
@Composable
expect inline fun <reified VM : ViewModel> Screen.realStateViewModel(
tag: String?,
crossinline factory: @DisallowComposableCalls ViewModelComponent.(SavedStateHandle) -> VM
): VM
@Composable

View File

@@ -17,30 +17,30 @@ import androidx.compose.ui.unit.dp
@ExperimentalFoundationApi
expect interface TooltipPlacement
fun TooltipPlacement.CursorPoint(
fun CursorPoint(
offset: DpOffset = DpOffset.Zero,
alignment: Alignment = Alignment.BottomEnd,
windowMargin: Dp = 4.dp
) = ca.gosyer.jui.ui.base.components.CursorPoint(offset, alignment, windowMargin)
) = CursorPointImpl(offset, alignment, windowMargin)
@ExperimentalFoundationApi
expect class CursorPoint(
offset: DpOffset = DpOffset.Zero,
alignment: Alignment = Alignment.BottomEnd,
windowMargin: Dp = 4.dp
expect class CursorPointImpl(
offset: DpOffset,
alignment: Alignment,
windowMargin: Dp
) : TooltipPlacement
fun TooltipPlacement.ComponentRect(
fun ComponentRect(
anchor: Alignment = Alignment.BottomCenter,
alignment: Alignment = Alignment.BottomCenter,
offset: DpOffset = DpOffset.Zero
) = ca.gosyer.jui.ui.base.components.ComponentRect(anchor, alignment, offset)
) = ca.gosyer.jui.ui.base.components.ComponentRectImpl(anchor, alignment, offset)
@ExperimentalFoundationApi
expect class ComponentRect(
anchor: Alignment = Alignment.BottomCenter,
alignment: Alignment = Alignment.BottomCenter,
offset: DpOffset = DpOffset.Zero
expect class ComponentRectImpl(
anchor: Alignment,
alignment: Alignment,
offset: DpOffset
) : TooltipPlacement
@OptIn(ExperimentalFoundationApi::class)

View File

@@ -21,7 +21,7 @@ actual interface ViewModelComponent : SharedViewModelComponent {
}
@Composable
actual inline fun <reified VM : ViewModel> Screen.stateViewModel(
actual inline fun <reified VM : ViewModel> Screen.realStateViewModel(
tag: String?,
crossinline factory: @DisallowComposableCalls ViewModelComponent.(SavedStateHandle) -> VM
): VM {

View File

@@ -12,9 +12,9 @@ import androidx.compose.ui.Modifier
actual typealias TooltipPlacement = androidx.compose.foundation.TooltipPlacement
actual typealias CursorPoint = androidx.compose.foundation.TooltipPlacement.CursorPoint
actual typealias CursorPointImpl = androidx.compose.foundation.TooltipPlacement.CursorPoint
actual typealias ComponentRect = androidx.compose.foundation.TooltipPlacement.ComponentRect
actual typealias ComponentRectImpl = androidx.compose.foundation.TooltipPlacement.ComponentRect
@OptIn(ExperimentalFoundationApi::class)
@Composable

View File

@@ -18,7 +18,7 @@ import cafe.adriel.voyager.core.screen.Screen
actual interface ViewModelComponent : SharedViewModelComponent
@Composable
actual inline fun <reified VM : ViewModel> Screen.stateViewModel(
actual inline fun <reified VM : ViewModel> Screen.realStateViewModel(
tag: String?,
crossinline factory: @DisallowComposableCalls ViewModelComponent.(SavedStateHandle) -> VM
): VM {

View File

@@ -15,13 +15,13 @@ import androidx.compose.ui.unit.DpOffset
actual interface TooltipPlacement
actual class CursorPoint actual constructor(
actual class CursorPointImpl actual constructor(
offset: DpOffset,
alignment: Alignment,
windowMargin: Dp
) : TooltipPlacement
actual class ComponentRect actual constructor(
actual class ComponentRectImpl actual constructor(
anchor: Alignment,
alignment: Alignment,
offset: DpOffset