72 lines
2.0 KiB
Python
72 lines
2.0 KiB
Python
"""Type stubs for doc-forge model package."""
|
|
|
|
from typing import Any, Dict, List, Optional, Union
|
|
from pathlib import Path
|
|
|
|
class DocObject:
|
|
"""Represents a Python documentation object (class, function, variable, etc.)."""
|
|
|
|
name: str
|
|
kind: str
|
|
path: str
|
|
signature: Optional[str]
|
|
docstring: Optional[str]
|
|
members: Dict[str, 'DocObject']
|
|
|
|
def __init__(self, name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) -> None: ...
|
|
|
|
def add_member(self, member: 'DocObject') -> None: ...
|
|
|
|
def get_member(self, name: str) -> Optional['DocObject']: ...
|
|
|
|
def is_private(self) -> bool: ...
|
|
|
|
class Module:
|
|
"""Represents a Python module in the documentation model."""
|
|
|
|
path: str
|
|
docstring: Optional[str]
|
|
members: Dict[str, DocObject]
|
|
|
|
def __init__(self, path: str, docstring: Optional[str] = None) -> None: ...
|
|
|
|
def add_object(self, obj: DocObject) -> None: ...
|
|
|
|
def get_object(self, name: str) -> Optional[DocObject]: ...
|
|
|
|
def get_public_objects(self) -> List[DocObject]: ...
|
|
|
|
class Project:
|
|
"""Root container for all documentation in a project."""
|
|
|
|
name: str
|
|
version: Optional[str]
|
|
modules: Dict[str, Module]
|
|
nav: 'Navigation'
|
|
|
|
def __init__(self, name: str, version: Optional[str] = None) -> None: ...
|
|
|
|
def add_module(self, module: Module) -> None: ...
|
|
|
|
def get_module(self, path: str) -> Optional[Module]: ...
|
|
|
|
def get_all_modules(self) -> List[Module]: ...
|
|
|
|
class Navigation:
|
|
"""Navigation structure derived from project modules."""
|
|
|
|
entries: List['NavEntry']
|
|
|
|
def __init__(self) -> None: ...
|
|
|
|
def add_entry(self, entry: 'NavEntry') -> None: ...
|
|
|
|
def get_entry(self, title: str) -> Optional['NavEntry']: ...
|
|
|
|
class NavEntry:
|
|
"""Single navigation entry linking to a module."""
|
|
|
|
title: str
|
|
module: str
|
|
|
|
def __init__(self, title: str, module: str) -> None: ... |