# rftools/calculators/unit_conversion.py
# AUTO-GENERATED by scripts/generate_stubs.py — DO NOT EDIT
# Regenerate with: python scripts/generate_stubs.py --frontend-dir /path/to/frontend
"""
Typed stubs for the 'unit-conversion' category (17 calculators).

Functions:
    frequency_wavelength(...) -> CalculatorResult
    dbm_watts(...) -> CalculatorResult
    temperature_converter(...) -> CalculatorResult
    awg_wire(...) -> CalculatorResult
    capacitor_code(...) -> CalculatorResult
    inductance_units(...) -> CalculatorResult
    capacitance_units(...) -> CalculatorResult
    resistance_units(...) -> CalculatorResult
    current_units(...) -> CalculatorResult
    voltage_units(...) -> CalculatorResult
    time_units(...) -> CalculatorResult
    magnetic_flux_units(...) -> CalculatorResult
    data_rate_units(...) -> CalculatorResult
    angle_units(...) -> CalculatorResult
    energy_units(...) -> CalculatorResult
    torque_units(...) -> CalculatorResult
    illuminance_units(...) -> CalculatorResult
"""
from __future__ import annotations
import rftools as _rftools
from rftools.types import CalculatorResult


def _client() -> _rftools.Client:
    return _rftools._get_default_client()


def frequency_wavelength(frequency: float = 2400.0, velocityFactor: float = 1.0) -> CalculatorResult:
    """
    Frequency to Wavelength Converter

    Category: unit-conversion

    Convert frequency to wavelength in any medium. Calculates full, half, and quarter wavelengths for antenna design, transmission line, and RF system planning.

    Parameters
    ----------
    frequency : float
        Frequency (MHz) (default: 2400.0)
    velocityFactor : float
        Velocity Factor (default: 1.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'wavelength', 'wavelengthCm', 'wavelengthMm', 'halfWave', 'quarterWave'
    """
    inputs = {"frequency": frequency, "velocityFactor": velocityFactor}
    return _client().calculate('frequency-wavelength', inputs)


def dbm_watts(dbm: float = 0.0) -> CalculatorResult:
    """
    dBm to Watts Power Converter

    Category: unit-conversion

    Convert RF power between dBm, Watts, milliwatts, dBW, dBμV, and RMS volts into 50Ω. Essential for link budgets, amplifier analysis, and RF system design.

    Parameters
    ----------
    dbm : float
        Power (dBm) (default: 0.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'watts', 'milliwatts', 'dBW', 'dBuV', 'volts'
    """
    inputs = {"dbm": dbm}
    return _client().calculate('dbm-watts', inputs)


def temperature_converter(celsius: float = 25.0) -> CalculatorResult:
    """
    Temperature Unit Converter

    Category: unit-conversion

    Convert temperature between Celsius, Fahrenheit, Kelvin, Rankine, and Réaumur scales. Useful for thermal analysis, datasheet comparison, and engineering calculations.

    Parameters
    ----------
    celsius : float
        Temperature (°C) (default: 25.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'fahrenheit', 'kelvin', 'rankine', 'reaumur'
    """
    inputs = {"celsius": celsius}
    return _client().calculate('temperature-converter', inputs)


def awg_wire(awg: float = 24.0) -> CalculatorResult:
    """
    AWG Wire Gauge Calculator

    Category: unit-conversion

    Convert AWG wire gauge to diameter (mm/inches), cross-sectional area (mm²), resistance per meter, and approximate current carrying capacity.

    Parameters
    ----------
    awg : float
        AWG Gauge (AWG) (default: 24.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'diameterMm', 'diameterIn', 'areaMm2', 'resistance20C', 'currentCapacity'
    """
    inputs = {"awg": awg}
    return _client().calculate('awg-wire', inputs)


def capacitor_code(code: float = 104.0) -> CalculatorResult:
    """
    Capacitor Code Decoder

    Category: unit-conversion

    Decode 3-digit capacitor code (e.g., 104 = 100nF) to capacitance in pF, nF, and μF. Works with ceramic, film, and tantalum capacitor markings.

    Parameters
    ----------
    code : float
        Capacitor Code (default: 104.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'picofarads', 'nanofarads', 'microfarads', 'voltageCode'
    """
    inputs = {"code": code}
    return _client().calculate('capacitor-code', inputs)


def inductance_units(henry: float = 1e-06) -> CalculatorResult:
    """
    Inductance Unit Converter

    Category: unit-conversion

    Convert inductance between henries, millihenries, microhenries, nanohenries, and picohenries.

    Parameters
    ----------
    henry : float
        Inductance (H) (default: 1e-06)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'millihenry', 'microhenry', 'nanohenry', 'picohenry'
    """
    inputs = {"henry": henry}
    return _client().calculate('inductance-units', inputs)


def capacitance_units(farad: float = 1e-07) -> CalculatorResult:
    """
    Capacitance Unit Converter

    Category: unit-conversion

    Convert capacitance between farads, millifarads, microfarads, nanofarads, and picofarads.

    Parameters
    ----------
    farad : float
        Capacitance (F) (default: 1e-07)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'millifarad', 'microfarad', 'nanofarad', 'picofarad'
    """
    inputs = {"farad": farad}
    return _client().calculate('capacitance-units', inputs)


def resistance_units(ohm: float = 1000.0) -> CalculatorResult:
    """
    Resistance Unit Converter

    Category: unit-conversion

    Convert resistance between milliohms, ohms, kilohms, megaohms, and gigaohms.

    Parameters
    ----------
    ohm : float
        Resistance (Ω) (default: 1000.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'milliohm', 'kilohm', 'megaohm', 'gigaohm'
    """
    inputs = {"ohm": ohm}
    return _client().calculate('resistance-units', inputs)


def current_units(ampere: float = 0.01) -> CalculatorResult:
    """
    Current Unit Converter

    Category: unit-conversion

    Convert electric current between amperes, milliamperes, microamperes, nanoamperes, and picoamperes.

    Parameters
    ----------
    ampere : float
        Current (A) (default: 0.01)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'milliampere', 'microampere', 'nanoampere', 'picoampere'
    """
    inputs = {"ampere": ampere}
    return _client().calculate('current-units', inputs)


def voltage_units(volt: float = 1.0) -> CalculatorResult:
    """
    Voltage Unit Converter

    Category: unit-conversion

    Convert voltage between microvolts, millivolts, volts, kilovolts, and megavolts.

    Parameters
    ----------
    volt : float
        Voltage (V) (default: 1.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'microvolt', 'millivolt', 'kilovolt', 'megavolt'
    """
    inputs = {"volt": volt}
    return _client().calculate('voltage-units', inputs)


def time_units(second: float = 1e-06) -> CalculatorResult:
    """
    Time Unit Converter

    Category: unit-conversion

    Convert time between seconds, milliseconds, microseconds, nanoseconds, picoseconds, and femtoseconds for digital and RF applications.

    Parameters
    ----------
    second : float
        Time (s) (default: 1e-06)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'millisecond', 'microsecond', 'nanosecond', 'picosecond', 'femtosecond'
    """
    inputs = {"second": second}
    return _client().calculate('time-units', inputs)


def magnetic_flux_units(tesla: float = 0.001) -> CalculatorResult:
    """
    Magnetic Flux Density Converter

    Category: unit-conversion

    Convert magnetic flux density between Tesla, milliTesla, microTesla, Gauss, and nanoTesla for sensor and motor applications.

    Parameters
    ----------
    tesla : float
        Magnetic Flux Density (T) (default: 0.001)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'millitesla', 'microtesla', 'nanotesla', 'gauss'
    """
    inputs = {"tesla": tesla}
    return _client().calculate('magnetic-flux-units', inputs)


def data_rate_units(bps: float = 1000000.0) -> CalculatorResult:
    """
    Data Rate Unit Converter

    Category: unit-conversion

    Convert data rates between bits per second (bps), kbps, Mbps, Gbps, and bytes per second.

    Parameters
    ----------
    bps : float
        Data Rate (bps) (default: 1000000.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'kbps', 'mbps', 'gbps', 'bytesPerSecond', 'kBps', 'mBps'
    """
    inputs = {"bps": bps}
    return _client().calculate('data-rate-units', inputs)


def angle_units(degree: float = 90.0) -> CalculatorResult:
    """
    Angle Unit Converter

    Category: unit-conversion

    Convert angles between degrees, radians, gradians, arcminutes, arcseconds, and turns for motor, antenna, and RF applications.

    Parameters
    ----------
    degree : float
        Angle (°) (default: 90.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'radian', 'gradian', 'arcminute', 'arcsecond', 'turn'
    """
    inputs = {"degree": degree}
    return _client().calculate('angle-units', inputs)


def energy_units(joule: float = 1.0) -> CalculatorResult:
    """
    Energy Unit Converter

    Category: unit-conversion

    Convert energy between joules, millijoules, electron-volts, kilowatt-hours, calories, and BTU.

    Parameters
    ----------
    joule : float
        Energy (J) (default: 1.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'millijoule', 'microjoule', 'electronvolt', 'kwh', 'calorie', 'btu'
    """
    inputs = {"joule": joule}
    return _client().calculate('energy-units', inputs)


def torque_units(nm: float = 1.0) -> CalculatorResult:
    """
    Torque Unit Converter (N·m/lb·ft/oz·in)

    Category: unit-conversion

    Convert torque between Newton-metres, pound-feet, pound-inches, oz·in, kg·cm, kg·m, and dyne·cm.

    Parameters
    ----------
    nm : float
        Torque (N·m) (default: 1.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'lbFt', 'lbIn', 'ozIn', 'kgCm', 'kgM', 'dyneCm'
    """
    inputs = {"nm": nm}
    return _client().calculate('torque-units', inputs)


def illuminance_units(lux: float = 500.0) -> CalculatorResult:
    """
    Illuminance Unit Converter

    Category: unit-conversion

    Convert illuminance between lux, foot-candles, millilux, kilolux, and phot for ambient light sensor and LED design.

    Parameters
    ----------
    lux : float
        Illuminance (lux) (default: 500.0)

    Returns
    -------
    CalculatorResult
        ``values`` dict keys: 'footcandle', 'millilux', 'kilolux', 'phot'
    """
    inputs = {"lux": lux}
    return _client().calculate('illuminance-units', inputs)

