mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added helper type definitions
This commit is contained in:
parent
521d8ed9ec
commit
9d629eca2f
1 changed files with 20 additions and 1 deletions
|
|
@ -6,14 +6,33 @@ import json
|
|||
import copy
|
||||
import warnings
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, Optional
|
||||
import typing
|
||||
from typing import Any, Optional, List, TypedDict
|
||||
|
||||
import clique
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from typing import Union
|
||||
# Global variable which store attribute definitions by type
|
||||
# - default types are registered on import
|
||||
_attr_defs_by_type = {}
|
||||
|
||||
# Type hint helpers
|
||||
IntFloatType = "Union[int, float]"
|
||||
|
||||
|
||||
class EnumItemDict(TypedDict):
|
||||
label: str
|
||||
value: Any
|
||||
|
||||
|
||||
class FileDefItemDict(TypedDict):
|
||||
directory: str
|
||||
filenames: List[str]
|
||||
frames: Optional[List[int]]
|
||||
template: Optional[str]
|
||||
is_sequence: Optional[bool]
|
||||
|
||||
|
||||
class AbstractAttrDefMeta(ABCMeta):
|
||||
"""Metaclass to validate the existence of 'key' attribute.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue