import ctypes
from collections.abc import Iterable
from typing import Self
import numpy as np
from pyautd3.derive import builder
from pyautd3.derive import datagram
from pyautd3.derive import gain
from pyautd3.derive.derive_datagram import datagram_with_segment
from pyautd3.driver.geometry import Geometry
from pyautd3.gain.holo.amplitude import Amplitude
from pyautd3.gain.holo.backend import Backend
from pyautd3.gain.holo.constraint import EmissionConstraint
from pyautd3.gain.holo.holo import HoloWithBackend
from pyautd3.native_methods.autd3capi_driver import GainPtr
from pyautd3.native_methods.structs import Vector3
from pyautd3.gain.cache import Cache
from datetime import timedelta
from pyautd3.driver.datagram.with_timeout import DatagramWithTimeout
from pyautd3.driver.datagram.with_parallel_threshold import DatagramWithParallelThreshold
from pyautd3.native_methods.autd3capi_driver import Segment, TransitionModeWrap
from pyautd3.driver.datagram.with_segment import DatagramWithSegment



class LM(HoloWithBackend[LM]):
    def __init__(self: LM, backend: Backend, iterable: Iterable[tuple[np.ndarray, Amplitude]]) -> None: ...
    def _gain_ptr(self: LM, _: Geometry) -> GainPtr: ...
    def with_eps1(self: LM, eps1: float) -> LM: ...
    def with_eps2(self: LM, eps2: float) -> LM: ...
    def with_tau(self: LM, tau: float) -> LM: ...
    def with_kmax(self: LM, kmax: int) -> LM: ...
    def with_initial(self: LM, initial: np.ndarray) -> LM: ...
    def with_cache(self: LM, ) -> Cache[LM]: ...
    def with_timeout(self: LM, timeout: timedelta | None) -> DatagramWithTimeout[LM]: ...
    def with_parallel_threshold(self: LM, threshold: int | None) -> DatagramWithParallelThreshold[LM]: ...
    def with_segment(self: LM, segment: Segment, transition_mode: TransitionModeWrap | None) -> DatagramWithSegment[LM]: ...
    @property
    def eps1(self: LM) -> float: ...
    @property
    def eps2(self: LM) -> float: ...
    @property
    def tau(self: LM) -> float: ...
    @property
    def kmax(self: LM) -> int: ...
    @property
    def initial(self: LM) -> np.ndarray: ...
