# THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT MANUALLY.

from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Union

from argparse import ArgumentParser
from pathlib import Path

import ast

__version__ = ...  # type: str

def extract_signature(docstring: str) -> Optional[str]: ...
def _split_types(decl: str) -> List[str]: ...
def parse_signature(signature: str) -> Tuple[List[str], str, Set[str]]: ...
def print_import_from(
    mod: str, names: Set[str], *, indent: str = ..., **config: Dict[str, Any]
) -> None: ...

class StubNode:
    parent = ...  # type: Optional[StubNode]
    children = ...  # type: List[StubNode]
    def __init__(self) -> None: ...
    def add_child(self, node: StubNode) -> None: ...
    def get_code(self) -> List[str]: ...

class VariableNode(StubNode):
    name = ...  # type: str
    type_ = ...  # type: str
    def __init__(self, name: str, type_: str) -> None: ...
    def get_code(self) -> List[str]: ...

class FunctionNode(StubNode):
    name = ...  # type: str
    async_ = ...  # type: bool
    parameters = ...  # type: Sequence[Tuple[str, str, bool]]
    rtype = ...  # type: str
    decorators = ...  # type: Sequence[str]
    def __init__(
        self,
        name: str,
        parameters: Sequence[Tuple[str, str, bool]],
        rtype: str,
        *,
        decorators: Optional[Sequence[str]] = ...,
    ) -> None: ...
    def get_code(self) -> List[str]: ...

class ClassNode(StubNode):
    name = ...  # type: str
    bases = ...  # type: Sequence[str]
    signature = ...  # type: Optional[str]
    def __init__(
        self, name: str, *, bases: Sequence[str], signature: Optional[str] = ...
    ) -> None: ...
    def get_code(self) -> List[str]: ...

def get_aliases(lines: Sequence[str]) -> Dict[str, str]: ...

class StubGenerator(ast.NodeVisitor):
    root = ...  # type: StubNode
    generic = ...  # type: bool
    imported_namespaces = ...  # type: Dict[str, str]
    imported_names = ...  # type: Dict[str, str]
    defined_types = ...  # type: Set[str]
    required_types = ...  # type: Set[str]
    aliases = ...  # type: Dict[str, str]
    _parents = ...  # type: List[StubNode]
    _code_lines = ...  # type: List[str]
    def __init__(self, source: str, *, generic: bool = ...) -> None: ...
    def collect_aliases(self) -> None: ...
    def get_function_node(
        self, node: Union[ast.FunctionDef, ast.AsyncFunctionDef]
    ) -> FunctionNode: ...
    def analyze_types(self) -> Dict[str, Set[str]]: ...
    def print_stub(self) -> str: ...

def get_stub(source: str, *, generic: bool = ...) -> str: ...
def get_mod_paths(mod_name: str) -> Tuple[Path, Path]: ...
def get_pkg_paths(pkg_name: str) -> List[Tuple[Path, Path]]: ...
def _make_parser(prog: str) -> ArgumentParser: ...
def _collect_sources(files: List[str], modules: List[str]) -> List[Path]: ...
def run(argv: Optional[List[str]] = ...) -> None: ...
