"""
This type stub file was generated by pyright.
"""
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
"""
Result classes for C4A-Script compilation
Clean API design with no exceptions
"""
class ErrorType(Enum):
SYNTAX = ...
SEMANTIC = ...
RUNTIME = ...
class Severity(Enum):
ERROR = ...
WARNING = ...
INFO = ...
@dataclass
class Suggestion:
"""A suggestion for fixing an error"""
message: str
fix: Optional[str] = ...
def to_dict(self) -> dict:
...
@dataclass
class ErrorDetail:
"""Detailed information about a compilation error"""
type: ErrorType
code: str
severity: Severity
message: str
line: int
column: int
source_line: str
end_line: Optional[int] = ...
end_column: Optional[int] = ...
line_before: Optional[str] = ...
line_after: Optional[str] = ...
suggestions: List[Suggestion] = ...
documentation_url: Optional[str] = ...
def to_dict(self) -> dict:
"""Convert to dictionary for JSON serialization"""
...
def to_json(self) -> str:
"""Convert to JSON string"""
...
@property
def formatted_message(self) -> str:
"""Returns the nice text format for terminals"""
...
@property
def simple_message(self) -> str:
"""Returns just the error message without formatting"""
...
@dataclass
class WarningDetail:
"""Information about a compilation warning"""
code: str
message: str
line: int
column: int
def to_dict(self) -> dict:
...
@dataclass
class CompilationResult:
"""Result of C4A-Script compilation"""
success: bool
js_code: Optional[List[str]] = ...
errors: List[ErrorDetail] = ...
warnings: List[WarningDetail] = ...
metadata: Dict[str, Any] = ...
def to_dict(self) -> dict:
"""Convert to dictionary for JSON serialization"""
...
def to_json(self) -> str:
"""Convert to JSON string"""
...
@property
def has_errors(self) -> bool:
"""Check if there are any errors"""
...
@property
def has_warnings(self) -> bool:
"""Check if there are any warnings"""
...
@property
def first_error(self) -> Optional[ErrorDetail]:
"""Get the first error if any"""
...
def __str__(self) -> str:
"""String representation for debugging"""
...
@dataclass
class ValidationResult:
"""Result of script validation"""
valid: bool
errors: List[ErrorDetail] = ...
warnings: List[WarningDetail] = ...
def to_dict(self) -> dict:
...
def to_json(self) -> str:
...
@property
def first_error(self) -> Optional[ErrorDetail]:
...