Add better typing for ArkhamDBDeck

This commit is contained in:
Adam Goldsmith 2022-03-14 00:40:14 -04:00
parent a091d2110e
commit e535eb6bcf

View File

@ -1,12 +1,33 @@
import asyncio
from typing import Any
from typing import TypedDict, Optional, Union
import aiohttp
ARKHAMDB_ORIGIN = 'https://arkhamdb.adamgoldsmith.name'
ArkhamDBDeck = Any # TODO: better typing
class ArkhamDBDeck(TypedDict):
id: int
name: str
date_creation: str
date_update: str
description_md: str
user_id: Optional[str]
investigator_code: str
investigator_name: str
slots: dict[str, int]
sideSlots: Union[list[str], dict[str, int]]
ignoreDeckLimitSlots: Optional[str]
version: str
xp: int
xp_spent: int
xp_adjustment: int
exile_string: Optional[str]
taboo_id: int
meta: str
tags: str
previous_deck: int
next_deck: int
problem: Optional[str]
class ArkhamDBClient:
_session: aiohttp.ClientSession