feat: noteの型をよりよく

pull/65/head
yupix 1 year ago
parent e710cb6c4a
commit e495ed969a
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -54,24 +54,27 @@ class GeoPayload(TypedDict):
speed: int | None
class INoteRequired(TypedDict):
id: str
class IPartialNote(TypedDict):
created_at: str
text: str | None
cw: str | None
user: ILiteUser
user_id: str
reply_id: str
renote_id: str
files: list[IDriveFile]
file_ids: list[str]
visibility: Literal['public', 'home', 'followers', 'specified']
reactions: dict[str, int]
files: list[IDriveFile]
id: str
reaction_acceptance: NotRequired[Literal['likeOnly', 'likeOnlyForRemote']] # v13 only
reaction_emojis: NotRequired[dict[str, str]] # v13 only
renote_id: str | None
renote_count: int
reactions: dict[str, int]
replies_count: int
reply_id: str | None
text: str | None
user: ILiteUser
user_id: str
visibility: Literal['public', 'home', 'followers', 'specified']
tags: NotRequired[list[str]] # タグがついてないとbodyに存在しない
class INote(INoteRequired, total=False):
class INote(IPartialNote, total=False):
"""
note object
"""
@ -86,8 +89,6 @@ class INote(INoteRequired, total=False):
is_hidden: bool
poll: IPoll
emojis: list[ICustomEmojiLite]
reaction_emojis: dict[str, str]
reaction_acceptance: Literal['likeOnly', 'likeOnlyForRemote'] | None
class ICreatedNote(TypedDict):

Loading…
Cancel
Save