Files
2022-09-26 01:16:33 +01:00

24 lines
463 B
Python
Executable File

from __future__ import annotations
from typing import Literal, TypedDict, Union
__all__ = ("File",)
class SizedMetadata(TypedDict):
type: Literal["Image", "Video"]
height: int
width: int
class SimpleMetadata(TypedDict):
type: Literal["File", "Text", "Audio"]
FileMetadata = Union[SizedMetadata, SimpleMetadata]
class File(TypedDict):
_id: str
tag: str
size: int
filename: str
metadata: FileMetadata
content_type: str