Skip to content

Commit

Permalink
Add package compatibility for dev.enro.core.synthetic
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-udy committed Sep 19, 2023
1 parent a023420 commit 5da8c40
Showing 1 changed file with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<KeyType> = SyntheticNavigationBinding<KeyType>

@Deprecated("use dev.enro.destination.synthetic")
public fun <T : NavigationKey> createSyntheticNavigationBinding(
navigationKeyType: Class<T>,
destination: () -> SyntheticDestination<T>
): NavigationBinding<T, SyntheticDestination<*>> =
dev.enro.destination.synthetic.createSyntheticNavigationBinding(navigationKeyType, destination)

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey> createSyntheticNavigationBinding(
noinline destination: () -> SyntheticDestination<KeyType>
): NavigationBinding<KeyType, SyntheticDestination<*>> =
dev.enro.destination.synthetic.createSyntheticNavigationBinding(destination)

@Deprecated("use dev.enro.destination.synthetic")
public fun <T : NavigationKey> createSyntheticNavigationBinding(
navigationKeyType: Class<T>,
provider: SyntheticDestinationProvider<T>,
): NavigationBinding<T, SyntheticDestination<*>> =
dev.enro.destination.synthetic.createSyntheticNavigationBinding(navigationKeyType, provider)

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey> createSyntheticNavigationBinding(
provider: SyntheticDestinationProvider<KeyType>,
): NavigationBinding<KeyType, SyntheticDestination<*>> =
dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider)

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey, reified DestinationType : SyntheticDestination<KeyType>> createSyntheticNavigationBinding(): NavigationBinding<KeyType, SyntheticDestination<*>> =
dev.enro.destination.synthetic.createSyntheticNavigationBinding()

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey, reified DestinationType : SyntheticDestination<KeyType>> NavigationModuleScope.syntheticDestination() {
binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding<KeyType, DestinationType>())
}

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey> NavigationModuleScope.syntheticDestination(
noinline destination: () -> SyntheticDestination<KeyType>
) {
binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(destination))
}

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey> NavigationModuleScope.syntheticDestination(
noinline block: SyntheticDestinationScope<KeyType>.() -> Unit
) {
val provider: SyntheticDestinationProvider<KeyType> =
dev.enro.destination.synthetic.syntheticDestination(block)
binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider))
}

@Deprecated("use dev.enro.destination.synthetic")
public inline fun <reified KeyType : NavigationKey> NavigationModuleScope.syntheticDestination(
provider: SyntheticDestinationProvider<KeyType>
) {
binding(dev.enro.destination.synthetic.createSyntheticNavigationBinding(provider))
}

0 comments on commit 5da8c40

Please sign in to comment.