Add better typing for ArkhamDBDeck
This commit is contained in:
parent
a091d2110e
commit
e535eb6bcf
27
arkhamdb.py
27
arkhamdb.py
@ -1,12 +1,33 @@
|
|||||||
import asyncio
|
from typing import TypedDict, Optional, Union
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
ARKHAMDB_ORIGIN = 'https://arkhamdb.adamgoldsmith.name'
|
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:
|
class ArkhamDBClient:
|
||||||
_session: aiohttp.ClientSession
|
_session: aiohttp.ClientSession
|
||||||
|
Loading…
Reference in New Issue
Block a user