UNPKG

1.45 kBTypeScriptView Raw
1type EmojifyFormat = (name: string, part?: string, input?: string) => string;
2interface EmojifyOptions {
3 fallback?: ((part: string) => string) | string;
4 format?: EmojifyFormat;
5}
6declare const emojify: (input: string, { fallback, format }?: EmojifyOptions) => string;
7
8declare const find: (codeOrName: string) => {
9 emoji: string;
10 key: string;
11} | undefined;
12
13declare const get: (codeOrName: string) => string | undefined;
14
15declare const has: (codeOrName: string) => boolean;
16
17declare const random: () => {
18 emoji: string;
19 name: string;
20};
21
22interface Emoji {
23 emoji: string;
24 key: string;
25}
26
27type ReplaceReplacement = (emoji: Emoji, index: number, string: string) => string;
28declare const replace: (input: string, replacement: ReplaceReplacement | string, { preserveSpaces }?: {
29 preserveSpaces?: boolean | undefined;
30}) => string;
31
32declare const search: (keyword: string) => {
33 emoji: string;
34 name: string;
35}[];
36
37interface StripOptions {
38 preserveSpaces?: boolean;
39}
40declare const strip: (input: string, { preserveSpaces }?: StripOptions) => string;
41
42declare const unemojify: (input: string) => string;
43
44interface WhichOptions {
45 markdown?: boolean;
46}
47declare const which: (emoji: string, { markdown }?: WhichOptions) => string | undefined;
48
49export { EmojifyFormat, EmojifyOptions, ReplaceReplacement, StripOptions, WhichOptions, emojify, find, get, has, random, replace, search, strip, unemojify, which };