mirror of
https://github.com/twitter/twemoji.git
synced 2025-04-29 02:47:25 +09:00
cleanup types
This commit is contained in:
parent
47db606d06
commit
fb4a4dd9dd
6
index.d.ts
vendored
6
index.d.ts
vendored
@ -9,7 +9,9 @@
|
|||||||
*/
|
*/
|
||||||
type ParseCallback = (icon: string, options: object, variant: string) => string | false;
|
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 {
|
interface TwemojiOptions {
|
||||||
/**
|
/**
|
||||||
@ -85,7 +87,7 @@ type Twemoji = {
|
|||||||
toCodePoint(utf16surrogatePairs: string, sep?: string): string;
|
toCodePoint(utf16surrogatePairs: string, sep?: string): string;
|
||||||
};
|
};
|
||||||
parse<T extends string | HTMLElement>(node: T, options?: TwemojiOptions | ParseCallback): T;
|
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;
|
test(text: string): boolean;
|
||||||
onerror(): void;
|
onerror(): void;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user