pyqt6-scaffold/pyqt6_scaffold/core/objects.py
2026-03-06 16:05:24 +03:00

35 lines
No EOL
831 B
Python

# SPDX-License-Identifier: LGPL-3.0-or-later
from typing import Any, Dict
from dataclasses import dataclass, field
@dataclass
class BaseUser:
"""
Minimal user representation.
id and role are typed as Any to support different
authentication schemes (integer PK, UUID, custom role objects).
"""
id: Any
name: str
role: Any
@dataclass
class NavigationContext:
"""
Container for data passed between windows during navigation.
"""
data: Dict[str, Any] = field(default_factory=dict)
@dataclass
class NavigateRequest:
"""
Navigation event emitted by windows to request a screen transition.
Attributes:
target: Registered name of the destination window.
context: Data to pass to the destination window.
"""
target: str
context: NavigationContext