import typing

from signal import Signals

from gi.repository import GLib

class GLibTask:
    def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: ...
    def set_priority(self, priority: int) -> None: ...
    def get_priority(self) -> int: ...

class GLibEventLoop:
    def __init__(self, main_context: GLib.MainContext) -> None: ...
    def add_signal_handler(
        self,
        sig: Signals,
        callback: typing.Callable[..., typing.Any],
        *args: typing.Any,
    ) -> None: ...
    def remove_signal_handler(self, sig: Signals) -> bool: ...
    def close(self) -> None: ...

class GLibEventLoopPolicy:
    def __init__(self) -> None: ...
    def __enter__(self) -> typing.Self: ...
    def __exit__(self, exc_type, exc_value, traceback) -> None: ...
    def get_event_loop(self) -> GLibEventLoop: ...
    def get_event_loop_for_context(self, ctx: GLib.MainContext) -> GLibEventLoop: ...
    def set_event_loop(self, loop: GLibEventLoop) -> None: ...
