From a10463bdbc8d5ffa9aa388d9bad783887083694d Mon Sep 17 00:00:00 2001 From: Alexander Gusev Date: Thu, 13 Feb 2020 16:50:17 +0200 Subject: [PATCH] chore(typescript): adds definitions --- index.d.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 00000000..1c0b4cf0 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,41 @@ +interface TwemojiOptions { + /** + * Default: MaxCDN + */ + base?: string; + /** + * Default: .png + */ + ext?: string; + /** + * Default: emoji + */ + className?: string; + /** + * Default: 72x72 + */ + size?: string | number; + /** + * To render with SVG use `folder: svg, ext: .svg` + */ + folder?: string; + /** + * The function to invoke in order to generate image src(s). + */ + callback?(icon: string, options: TwemojiOptions): void; + /** + * Default () => ({}) + */ + attributes?(): void; +} + +const twemoji: { + convert: { + fromCodePoint(hexCodePoint: string): string; + toCodePoint(utf16surrogatePairs: string): string; + }; + parse(node: HTMLElement | string, options?: TwemojiOptions): void; +}; + +export default twemoji; +