ios/TestHarnessShared/Core/Platform/ServiceContainer.swift
2025-11-21 16:36:58 -03:00

41 lines
1.2 KiB
Swift

import BitwardenKit
import Foundation
/// The services provided by the `ServiceContainer`.
typealias Services = HasErrorReportBuilder
/// The default implementation of a container that provides the services used by the application.
///
public class ServiceContainer: Services {
// MARK: Properties
/// A helper for building an error report containing the details of an error that occurred.
public let errorReportBuilder: ErrorReportBuilder
// MARK: Initialization
/// Initialize a `ServiceContainer`.
///
/// - Parameters:
/// - errorReportBuilder: A helper for building an error report containing the details of an
public init(
errorReportBuilder: ErrorReportBuilder,
) {
self.errorReportBuilder = errorReportBuilder
}
public convenience init() {
let appInfoService = DefaultAppInfoService()
let stateService = DefaultStateService()
let errorReportBuilder = DefaultErrorReportBuilder(
activeAccountStateProvider: stateService,
appInfoService: appInfoService,
)
self.init(
errorReportBuilder: errorReportBuilder,
)
}
}