1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-29 01:18:52 +00:00

cleanup types

This commit is contained in:
Alexey Molchan 2022-04-30 01:34:13 +03:00 committed by Justine De Caires
parent 47db606d06
commit fb4a4dd9dd

6
index.d.ts vendored
View File

@ -9,7 +9,9 @@
*/
type ParseCallback = (icon: string, options: object, variant: string) => string | false;
type Replacer = (substring: string, ...args: any[]) => string;
type ReplacerFunction = (substring: string, ...args: any[]) => string;
type Replacer = string | ReplacerFunction;
interface TwemojiOptions {
/**
@ -85,7 +87,7 @@ type Twemoji = {
toCodePoint(utf16surrogatePairs: string, sep?: string): string;
};
parse<T extends string | HTMLElement>(node: T, options?: TwemojiOptions | ParseCallback): T;
replace(text: string, replacer: string | Replacer): string;
replace(text: string, replacer: Replacer): string;
test(text: string): boolean;
onerror(): void;
};