-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from landgrafhomyak/master
Type hints
- Loading branch information
Showing
7 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from .core import ( | ||
demojize as demojize, | ||
distinct_emoji_list as distinct_emoji_list, | ||
emoji_count as emoji_count, | ||
emoji_list as emoji_list, | ||
emojize as emojize, | ||
is_emoji as is_emoji, | ||
replace_emoji as replace_emoji, | ||
version as version, | ||
) | ||
from .unicode_codes import EMOJI_DATA, LANGUAGES, STATUS | ||
|
||
__all__ = [ | ||
"emojize", | ||
"demojize", | ||
"emoji_count", | ||
"emoji_list", | ||
"distinct_emoji_list", | ||
"replace_emoji", | ||
"version", | ||
"is_emoji", | ||
"EMOJI_DATA", | ||
"STATUS", | ||
"LANGUAGES", | ||
] | ||
__version__: str | ||
__author__: str | ||
__email__: str | ||
__source__: str | ||
__license__: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from collections.abc import Callable | ||
from typing_extensions import Literal, TypedDict | ||
|
||
_DEFAULT_DELIMITER: str | ||
|
||
class _EmojiLisReturn(TypedDict): | ||
emoji: str | ||
location: int | ||
|
||
class _EmojiListReturn(TypedDict): | ||
emoji: str | ||
match_start: int | ||
match_end: int | ||
|
||
def emojize( | ||
string: str, | ||
delimiters: tuple[str, str] = ..., | ||
variant: Literal["text_type", "emoji_type", None] = ..., | ||
language: str = ..., | ||
version: float | None = ..., | ||
handle_version: str | Callable[[str, dict[str, str]], str] | None = ..., | ||
) -> str: ... | ||
def demojize( | ||
string: str, | ||
delimiters: tuple[str, str] = ..., | ||
language: str = ..., | ||
version: float | None = ..., | ||
handle_version: str | Callable[[str, dict[str, str]], str] | None = ..., | ||
) -> str: ... | ||
def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = ..., version: float = ...) -> str: ... | ||
def emoji_list(string: str) -> list[_EmojiListReturn]: ... | ||
def distinct_emoji_list(string: str) -> list[str]: ... | ||
def emoji_count(string: str, unique: bool = ...) -> int: ... | ||
def version(string: str) -> float: ... | ||
def is_emoji(string: str) -> bool: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .data_dict import * | ||
|
||
__all__ = ["get_emoji_unicode_dict", "get_aliases_unicode_dict", "EMOJI_DATA", "STATUS", "LANGUAGES"] | ||
|
||
def get_emoji_unicode_dict(lang: str) -> dict[str, str]: ... | ||
def get_aliases_unicode_dict() -> dict[str, str]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from typing import Any | ||
|
||
__all__ = ["EMOJI_DATA", "STATUS", "LANGUAGES"] | ||
|
||
STATUS: dict[str, int] | ||
LANGUAGES: list[str] | ||
EMOJI_DATA: dict[str, dict[str, Any]] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters