Make classes more generic
This commit is contained in:
parent
f4c0416398
commit
052bbfb6d2
5 changed files with 265 additions and 0 deletions
17
cheuph/element.py
Normal file
17
cheuph/element.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from dataclasses import dataclass
|
||||
from typing import Hashable, Optional
|
||||
|
||||
__all__ = ["Id", "Element", "RenderedElement"]
|
||||
|
||||
Id = Hashable
|
||||
|
||||
@dataclass
|
||||
class Element:
|
||||
id: Id
|
||||
parent_id: Optional[Id]
|
||||
|
||||
@dataclass
|
||||
class RenderedElement:
|
||||
id: Id
|
||||
meta: AttributedText
|
||||
lines: List[AttributedText]
|
||||
Loading…
Add table
Add a link
Reference in a new issue