Skip to content

Commit

Permalink
为aapi.py中的部分方法添加类型注解
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyihan0 authored Apr 19, 2024
1 parent 29b0ea7 commit 29a907e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pixivpy3/aapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ class _IllustInfo(TypedDict):
illust_book_style: int


class _SearchIllust(TypedDict):
illusts: List[_IllustInfo]
next_url: Optional[str]
search_span_limit: int
show_ai: bool


class _UserBookmarksIllust(TypedDict):
illusts: List[_IllustInfo]
next_url: Optional[str]
Expand Down Expand Up @@ -758,7 +765,7 @@ def search_illust(
search_ai_type: Literal[0, 1] | None = None,
offset: int | str | None = None,
req_auth: bool = True,
) -> ParsedJson:
) -> _SearchIllust | _PixivErrorInfo:
url = "%s/v1/search/illust" % self.hosts
params: dict[str, Any] = {
"word": word,
Expand Down

0 comments on commit 29a907e

Please sign in to comment.