Files
swift-manual-s/Sources/ManualS/ManualS.swift
Michael Housh 5b2e20921c
Some checks failed
CI / Ubuntu (push) Failing after 23m10s
feat: Adds proposed kw interpolation.
2025-03-13 12:38:42 -04:00

51 lines
1.7 KiB
Swift

import Dependencies
import DependenciesMacros
import Models
public extension DependencyValues {
var manualS: ManualS {
get { self[ManualS.self] }
set { self[ManualS.self] = newValue }
}
}
@DependencyClient
public struct ManualS: Sendable {
public var balancePoint: @Sendable (BalancePoint.Request) async throws -> BalancePoint.Response
public var derating: @Sendable (Derating.Request) async throws -> Derating.Response
public var interpolate: Interpolations
public var requiredKW: @Sendable (RequiredKW.Request) async throws -> RequiredKW.Response
public var sizingLimits: @Sendable (SizingLimits.Request) async throws -> SizingLimits.Response
}
@DependencyClient
public struct Interpolations: Sendable {
public var cooling: @Sendable (CoolingInterpolation.Request) async throws -> CoolingInterpolation.Response
public var furnace: @Sendable (FurnaceInterpolation.Request) async throws -> FurnaceInterpolation.Response
public var heatPumpHeating:
@Sendable (HeatPumpHeatingInterpolation.Request) async throws -> HeatPumpHeatingInterpolation.Response
public var proposeKW: @Sendable (ProposedKWInterpolation.Request) async throws -> ProposedKWInterpolation.Response
}
extension ManualS: DependencyKey {
public static let liveValue = Self(
balancePoint: { try await $0.respond() },
derating: { try await $0.respond() },
interpolate: .init(
cooling: { try await $0.respond() },
furnace: { try await $0.respond() },
heatPumpHeating: { try await $0.respond() },
proposeKW: { try await $0.respond() }
),
requiredKW: { try await $0.respond() },
sizingLimits: { try await $0.respond() }
)
}
extension ManualS: TestDependencyKey {
public static let testValue: ManualS = Self(interpolate: .init())
}