Last active
April 8, 2023 19:17
-
-
Save naturalwarren/2a24c3de70068f8d564143533b62fea8 to your computer and use it in GitHub Desktop.
SDUI UI Base Component Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UIComponent(BaseModel, ABC): | |
sdui_component_type: ComponentType | |
def __init__(self, **data) -> None: | |
data['sdui_component_type'] = self.component_type() | |
super().__init__(**data) | |
@classmethod | |
@abstractmethod | |
def component_type(cls) -> ComponentType: | |
""" | |
Returns a unique case in the ComponentType enum | |
""" | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment