Update emoji stubs for version 1.7 (#7884)

This commit is contained in:
Rens Oliemans
2022-05-22 12:44:01 +02:00
committed by GitHub
parent 54c2e23a55
commit 6e18441a2c
8 changed files with 69 additions and 27 deletions

View File

@@ -1 +1 @@
version = "1.2.*"
version = "1.7.*"

View File

@@ -1,18 +1,28 @@
from .core import (
demojize as demojize,
distinct_emoji_lis as distinct_emoji_lis,
distinct_emoji_list as distinct_emoji_list,
emoji_count as emoji_count,
emoji_lis as emoji_lis,
emoji_list as emoji_list,
emojize as emojize,
get_emoji_regexp as get_emoji_regexp,
replace_emoji as replace_emoji,
version as version,
)
from .unicode_codes import (
EMOJI_ALIAS_UNICODE_ENGLISH as EMOJI_ALIAS_UNICODE_ENGLISH,
EMOJI_DATA as EMOJI_DATA,
EMOJI_UNICODE_ENGLISH as EMOJI_UNICODE_ENGLISH,
EMOJI_UNICODE_FRENCH as EMOJI_UNICODE_FRENCH,
EMOJI_UNICODE_GERMAN as EMOJI_UNICODE_GERMAN,
EMOJI_UNICODE_ITALIAN as EMOJI_UNICODE_ITALIAN,
EMOJI_UNICODE_PORTUGUESE as EMOJI_UNICODE_PORTUGUESE,
EMOJI_UNICODE_SPANISH as EMOJI_UNICODE_SPANISH,
UNICODE_EMOJI_ALIAS_ENGLISH as UNICODE_EMOJI_ALIAS_ENGLISH,
UNICODE_EMOJI_ENGLISH as UNICODE_EMOJI_ENGLISH,
UNICODE_EMOJI_FRENCH as UNICODE_EMOJI_FRENCH,
UNICODE_EMOJI_GERMAN as UNICODE_EMOJI_GERMAN,
UNICODE_EMOJI_ITALIAN as UNICODE_EMOJI_ITALIAN,
UNICODE_EMOJI_PORTUGUESE as UNICODE_EMOJI_PORTUGUESE,
UNICODE_EMOJI_SPANISH as UNICODE_EMOJI_SPANISH,

View File

@@ -1,17 +1,47 @@
from collections.abc import Callable
from typing import Pattern
from typing_extensions import Literal
from typing_extensions import Literal, TypedDict
_DEFAULT_DELIMITER: str
class _DeprecatedParameter: ...
class _EmojiLisReturn(TypedDict):
emoji: str
location: int
class _EmojiListReturn(TypedDict):
emoji: str
match_start: int
match_end: int
def emojize(
string: str,
use_aliases: bool = ...,
use_aliases: bool | type[_DeprecatedParameter] = ...,
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, use_aliases: bool = ..., delimiters: tuple[str, str] = ..., language: str = ...) -> str: ...
def get_emoji_regexp(language: str = ...) -> Pattern[str]: ...
def emoji_lis(string: str, language: str = ...) -> list[dict[str, int | str]]: ...
def distinct_emoji_lis(string: str) -> list[str]: ...
def emoji_count(string: str) -> int: ...
def demojize(
string: str,
use_aliases: bool | type[_DeprecatedParameter] = ...,
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] = ...,
language: str | type[_DeprecatedParameter] = ...,
version: float | None = ...,
) -> str: ...
def get_emoji_regexp(language: str | None = ...) -> Pattern[str]: ...
def emoji_lis(string: str, language: str | type[_DeprecatedParameter] = ...) -> list[_EmojiLisReturn]: ...
def emoji_list(string: str) -> list[_EmojiListReturn]: ...
def distinct_emoji_lis(string: str, language: str | type[_DeprecatedParameter] = ...) -> list[str]: ...
def distinct_emoji_list(string: str) -> list[str]: ...
def emoji_count(string: str, unique: bool = ...) -> int: ...
def version(string: str) -> float: ...

View File

@@ -1,12 +1,24 @@
from .en import (
EMOJI_ALIAS_UNICODE_ENGLISH as EMOJI_ALIAS_UNICODE_ENGLISH,
EMOJI_UNICODE_ENGLISH as EMOJI_UNICODE_ENGLISH,
UNICODE_EMOJI_ALIAS_ENGLISH as UNICODE_EMOJI_ALIAS_ENGLISH,
UNICODE_EMOJI_ENGLISH as UNICODE_EMOJI_ENGLISH,
)
from .es import EMOJI_UNICODE_SPANISH as EMOJI_UNICODE_SPANISH, UNICODE_EMOJI_SPANISH as UNICODE_EMOJI_SPANISH
from .it import EMOJI_UNICODE_ITALIAN as EMOJI_UNICODE_ITALIAN, UNICODE_EMOJI_ITALIAN as UNICODE_EMOJI_ITALIAN
from .pt import EMOJI_UNICODE_PORTUGUESE as EMOJI_UNICODE_PORTUGUESE, UNICODE_EMOJI_PORTUGUESE as UNICODE_EMOJI_PORTUGUESE
EMOJI_ALIAS_UNICODE_ENGLISH: dict[str, str]
EMOJI_UNICODE_ENGLISH: dict[str, str]
UNICODE_EMOJI_ENGLISH: dict[str, str]
UNICODE_EMOJI_ALIAS_ENGLISH: dict[str, str]
EMOJI_UNICODE_GERMAN: dict[str, str]
UNICODE_EMOJI_GERMAN: dict[str, str]
EMOJI_UNICODE_SPANISH: dict[str, str]
UNICODE_EMOJI_SPANISH: dict[str, str]
EMOJI_UNICODE_FRENCH: dict[str, str]
UNICODE_EMOJI_FRENCH: dict[str, str]
EMOJI_UNICODE_ITALIAN: dict[str, str]
UNICODE_EMOJI_ITALIAN: dict[str, str]
EMOJI_UNICODE_PORTUGUESE: dict[str, str]
UNICODE_EMOJI_PORTUGUESE: dict[str, str]
EMOJI_UNICODE: dict[str, dict[str, str]]
UNICODE_EMOJI: dict[str, dict[str, str]]
EMOJI_DATA: dict[str, dict[str, str]]

View File

@@ -1,4 +0,0 @@
EMOJI_ALIAS_UNICODE_ENGLISH: dict[str, str]
EMOJI_UNICODE_ENGLISH: dict[str, str]
UNICODE_EMOJI_ENGLISH: dict[str, str]
UNICODE_EMOJI_ALIAS_ENGLISH: dict[str, str]

View File

@@ -1,2 +0,0 @@
EMOJI_UNICODE_SPANISH: dict[str, str]
UNICODE_EMOJI_SPANISH: dict[str, str]

View File

@@ -1,2 +0,0 @@
EMOJI_UNICODE_ITALIAN: dict[str, str]
UNICODE_EMOJI_ITALIAN: dict[str, str]

View File

@@ -1,2 +0,0 @@
EMOJI_UNICODE_PORTUGUESE: dict[str, str]
UNICODE_EMOJI_PORTUGUESE: dict[str, str]