From 50a6a0de4781fe33f5fefd084f650d8747569c13 Mon Sep 17 00:00:00 2001 From: Alexey Molchan Date: Sat, 30 Apr 2022 00:24:10 +0300 Subject: [PATCH] update types --- index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.d.ts b/index.d.ts index ffed054a..df58914f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -9,6 +9,8 @@ */ declare type ParseCallback = (icon: string, options: object, variant: string) => string | false; +declare type Replacer = (substring: string, ...args: any[]) => string; + declare interface TwemojiOptions { /** * Default: MaxCDN @@ -45,6 +47,10 @@ declare interface TwemojiOptions { } declare type Twemoji = { + base: string; + ext: string; + className: string; + size: string | number; convert: { /** * Given an HEX codepoint, returns UTF16 surrogate pairs. @@ -79,6 +85,9 @@ declare type Twemoji = { toCodePoint(utf16surrogatePairs: string, sep?: string): string; }; parse(node: T, options?: TwemojiOptions | ParseCallback): T; + replace(text: string, replacer: string | Replacer): string; + test(test: string): boolean; + onerror(): void; }; declare module 'twemoji' {