Skip to content

Commit

Permalink
chore(typescript): adds definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
goooseman authored and Justine De Caires committed Mar 5, 2021
1 parent 8e5c8c7 commit a10463b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit a10463b

Please sign in to comment.