2023-09-11 10:29:48 +03:00
|
|
|
import sys
|
2024-02-27 13:55:40 +03:00
|
|
|
from typing import Any, AsyncGenerator, Generator, AsyncIterator, Iterator, NewType, Tuple, Union, List, Dict, Type, IO, Optional
|
2024-01-29 20:14:46 +03:00
|
|
|
|
2024-01-26 09:54:13 +03:00
|
|
|
try:
|
|
|
|
from PIL.Image import Image
|
|
|
|
except ImportError:
|
2024-01-29 20:14:46 +03:00
|
|
|
from typing import Type as Image
|
2023-09-11 10:29:48 +03:00
|
|
|
|
|
|
|
if sys.version_info >= (3, 8):
|
|
|
|
from typing import TypedDict
|
|
|
|
else:
|
|
|
|
from typing_extensions import TypedDict
|
2023-06-24 04:47:00 +03:00
|
|
|
|
2023-08-27 18:37:44 +03:00
|
|
|
SHA256 = NewType('sha_256_hash', str)
|
2024-02-27 13:55:40 +03:00
|
|
|
CreateResult = Iterator[str]
|
|
|
|
AsyncResult = AsyncIterator[str]
|
2024-05-17 19:43:17 +03:00
|
|
|
Messages = List[Dict[str, Union[str,List[Dict[str,Union[str,Dict[str,str]]]]]]]
|
2024-01-29 20:14:46 +03:00
|
|
|
Cookies = Dict[str, str]
|
2024-01-13 17:37:36 +03:00
|
|
|
ImageType = Union[str, bytes, IO, Image, None]
|
2023-07-28 13:07:17 +03:00
|
|
|
|
|
|
|
__all__ = [
|
2023-08-27 18:37:44 +03:00
|
|
|
'Any',
|
|
|
|
'AsyncGenerator',
|
|
|
|
'Generator',
|
2024-02-27 13:55:40 +03:00
|
|
|
'AsyncIterator',
|
|
|
|
'Iterator'
|
2023-08-27 18:37:44 +03:00
|
|
|
'Tuple',
|
2024-01-21 04:20:23 +03:00
|
|
|
'Union',
|
|
|
|
'List',
|
|
|
|
'Dict',
|
|
|
|
'Type',
|
2024-01-24 02:46:35 +03:00
|
|
|
'IO',
|
|
|
|
'Optional',
|
2023-08-27 18:37:44 +03:00
|
|
|
'TypedDict',
|
2023-09-18 00:23:54 +03:00
|
|
|
'SHA256',
|
|
|
|
'CreateResult',
|
2024-01-21 04:20:23 +03:00
|
|
|
'AsyncResult',
|
|
|
|
'Messages',
|
2024-01-29 20:14:46 +03:00
|
|
|
'Cookies',
|
|
|
|
'Image',
|
2024-01-21 04:20:23 +03:00
|
|
|
'ImageType'
|
2023-09-11 10:29:48 +03:00
|
|
|
]
|