From 5da8c40913918a0f65c7ad8977bae7b607b9eb6f Mon Sep 17 00:00:00 2001 From: Isaac Udy Date: Tue, 19 Sep 2023 19:25:15 +1200 Subject: [PATCH] Add package compatibility for dev.enro.core.synthetic --- .../compatability/dev.enro.core.synthetic.kt | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 enro-core/src/main/java/dev/enro/compatability/dev.enro.core.synthetic.kt diff --git a/enro-core/src/main/java/dev/enro/compatability/dev.enro.core.synthetic.kt b/enro-core/src/main/java/dev/enro/compatability/dev.enro.core.synthetic.kt new file mode 100644 index 00000000..4db65e6e --- /dev/null +++ b/enro-core/src/main/java/dev/enro/compatability/dev.enro.core.synthetic.kt @@ -0,0 +1,72 @@ +@file:Suppress("PackageDirectoryMismatch") + +package dev.enro.core.synthetic + +import dev.enro.core.NavigationBinding +import dev.enro.core.NavigationKey +import dev.enro.core.controller.NavigationModuleScope +import dev.enro.destination.synthetic.SyntheticDestination +import dev.enro.destination.synthetic.SyntheticDestinationProvider +import dev.enro.destination.synthetic.SyntheticDestinationScope +import dev.enro.destination.synthetic.SyntheticNavigationBinding + +@Deprecated("use dev.enro.destination.synthetic") +public typealias SyntheticNavigationBinding = SyntheticNavigationBinding + +@Deprecated("use dev.enro.destination.synthetic") +public fun createSyntheticNavigationBinding( + navigationKeyType: Class, + destination: () -> SyntheticDestination +): NavigationBinding> = + dev.enro.destination.synthetic.createSyntheticNavigationBinding(navigationKeyType, destination) + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun createSyntheticNavigationBinding( + noinline destination: () -> SyntheticDestination +): NavigationBinding> = + dev.enro.destination.synthetic.createSyntheticNavigationBinding(destination) + +@Deprecated("use dev.enro.destination.synthetic") +public fun createSyntheticNavigationBinding( + navigationKeyType: Class, + provider: SyntheticDestinationProvider, +): NavigationBinding> = + dev.enro.destination.synthetic.createSyntheticNavigationBinding(navigationKeyType, provider) + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun createSyntheticNavigationBinding( + provider: SyntheticDestinationProvider, +): NavigationBinding> = + dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider) + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun > createSyntheticNavigationBinding(): NavigationBinding> = + dev.enro.destination.synthetic.createSyntheticNavigationBinding() + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun > NavigationModuleScope.syntheticDestination() { + binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding()) +} + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun NavigationModuleScope.syntheticDestination( + noinline destination: () -> SyntheticDestination +) { + binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(destination)) +} + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun NavigationModuleScope.syntheticDestination( + noinline block: SyntheticDestinationScope.() -> Unit +) { + val provider: SyntheticDestinationProvider = + dev.enro.destination.synthetic.syntheticDestination(block) + binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider)) +} + +@Deprecated("use dev.enro.destination.synthetic") +public inline fun NavigationModuleScope.syntheticDestination( + provider: SyntheticDestinationProvider +) { + binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider)) +}