Files
ios/BitwardenShared/UI/Tools/Generator/GeneratorModule.swift
2025-11-04 08:23:55 -06:00

35 lines
1.1 KiB
Swift

import BitwardenKit
// MARK: - Generator Module
/// An object that builds coordinators for the generator tab.
///
@MainActor
protocol GeneratorModule {
/// Initializes a coordinator for navigating between `GeneratorRoute`s.
///
/// - Parameters:
/// - delegate: An optional delegate for the coordinator.
/// - stackNavigator: The stack navigator that will be used to navigate between routes.
/// - Returns: A coordinator that can navigate to `GeneratorRoute`s.
///
func makeGeneratorCoordinator(
delegate: GeneratorCoordinatorDelegate?,
stackNavigator: StackNavigator,
) -> AnyCoordinator<GeneratorRoute, Void>
}
extension DefaultAppModule: GeneratorModule {
func makeGeneratorCoordinator(
delegate: GeneratorCoordinatorDelegate?,
stackNavigator: StackNavigator,
) -> AnyCoordinator<GeneratorRoute, Void> {
GeneratorCoordinator(
delegate: delegate,
module: self,
services: services,
stackNavigator: stackNavigator,
).asAnyCoordinator()
}
}