@tiptap/extension-emoji 3.20.3 → 3.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,80 @@
1
+ import { Node } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { SuggestionOptions } from '@tiptap/suggestion';
4
+
5
+ declare module '@tiptap/core' {
6
+ interface Commands<ReturnType> {
7
+ emoji: {
8
+ /**
9
+ * Add an emoji
10
+ */
11
+ setEmoji: (shortcode: string) => ReturnType;
12
+ };
13
+ }
14
+ interface Storage {
15
+ emoji: EmojiStorage;
16
+ }
17
+ }
18
+ type EmojiItem = {
19
+ /**
20
+ * A unique name of the emoji which will be stored as attribute
21
+ */
22
+ name: string;
23
+ /**
24
+ * The emoji unicode character
25
+ */
26
+ emoji?: string;
27
+ /**
28
+ * A list of unique shortcodes that are used by input rules to find the emoji
29
+ */
30
+ shortcodes: string[];
31
+ /**
32
+ * A list of tags that can help for searching emojis
33
+ */
34
+ tags: string[];
35
+ /**
36
+ * A name that can help to group emojis
37
+ */
38
+ group?: string;
39
+ /**
40
+ * A list of unique emoticons
41
+ */
42
+ emoticons?: string[];
43
+ /**
44
+ * The unicode version the emoji was introduced
45
+ */
46
+ version?: number;
47
+ /**
48
+ * A fallback image if the current system doesn't support the emoji or for custom emojis
49
+ */
50
+ fallbackImage?: string;
51
+ /**
52
+ * Store some custom data
53
+ */
54
+ [key: string]: any;
55
+ };
56
+ type EmojiOptions = {
57
+ HTMLAttributes: Record<string, any>;
58
+ emojis: EmojiItem[];
59
+ enableEmoticons: boolean;
60
+ forceFallbackImages: boolean;
61
+ suggestion: Omit<SuggestionOptions, 'editor'>;
62
+ };
63
+ type EmojiStorage = {
64
+ emojis: EmojiItem[];
65
+ isSupported: (item: EmojiItem) => boolean;
66
+ };
67
+ declare const EmojiSuggestionPluginKey: PluginKey<any>;
68
+ declare const inputRegex: RegExp;
69
+ declare const pasteRegex: RegExp;
70
+ declare const Emoji: Node<EmojiOptions, EmojiStorage>;
71
+
72
+ declare const emojis: EmojiItem[];
73
+ declare const gitHubCustomEmojis: EmojiItem[];
74
+ declare const gitHubEmojis: EmojiItem[];
75
+
76
+ declare function emojiToShortcode(emoji: string, emojis: EmojiItem[]): string | undefined;
77
+
78
+ declare function shortcodeToEmoji(shortcode: string, emojis: EmojiItem[]): EmojiItem | undefined;
79
+
80
+ export { Emoji, type EmojiItem, type EmojiOptions, type EmojiStorage, EmojiSuggestionPluginKey, Emoji as default, emojiToShortcode, emojis, gitHubCustomEmojis, gitHubEmojis, inputRegex, pasteRegex, shortcodeToEmoji };
@@ -0,0 +1,80 @@
1
+ import { Node } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { SuggestionOptions } from '@tiptap/suggestion';
4
+
5
+ declare module '@tiptap/core' {
6
+ interface Commands<ReturnType> {
7
+ emoji: {
8
+ /**
9
+ * Add an emoji
10
+ */
11
+ setEmoji: (shortcode: string) => ReturnType;
12
+ };
13
+ }
14
+ interface Storage {
15
+ emoji: EmojiStorage;
16
+ }
17
+ }
18
+ type EmojiItem = {
19
+ /**
20
+ * A unique name of the emoji which will be stored as attribute
21
+ */
22
+ name: string;
23
+ /**
24
+ * The emoji unicode character
25
+ */
26
+ emoji?: string;
27
+ /**
28
+ * A list of unique shortcodes that are used by input rules to find the emoji
29
+ */
30
+ shortcodes: string[];
31
+ /**
32
+ * A list of tags that can help for searching emojis
33
+ */
34
+ tags: string[];
35
+ /**
36
+ * A name that can help to group emojis
37
+ */
38
+ group?: string;
39
+ /**
40
+ * A list of unique emoticons
41
+ */
42
+ emoticons?: string[];
43
+ /**
44
+ * The unicode version the emoji was introduced
45
+ */
46
+ version?: number;
47
+ /**
48
+ * A fallback image if the current system doesn't support the emoji or for custom emojis
49
+ */
50
+ fallbackImage?: string;
51
+ /**
52
+ * Store some custom data
53
+ */
54
+ [key: string]: any;
55
+ };
56
+ type EmojiOptions = {
57
+ HTMLAttributes: Record<string, any>;
58
+ emojis: EmojiItem[];
59
+ enableEmoticons: boolean;
60
+ forceFallbackImages: boolean;
61
+ suggestion: Omit<SuggestionOptions, 'editor'>;
62
+ };
63
+ type EmojiStorage = {
64
+ emojis: EmojiItem[];
65
+ isSupported: (item: EmojiItem) => boolean;
66
+ };
67
+ declare const EmojiSuggestionPluginKey: PluginKey<any>;
68
+ declare const inputRegex: RegExp;
69
+ declare const pasteRegex: RegExp;
70
+ declare const Emoji: Node<EmojiOptions, EmojiStorage>;
71
+
72
+ declare const emojis: EmojiItem[];
73
+ declare const gitHubCustomEmojis: EmojiItem[];
74
+ declare const gitHubEmojis: EmojiItem[];
75
+
76
+ declare function emojiToShortcode(emoji: string, emojis: EmojiItem[]): string | undefined;
77
+
78
+ declare function shortcodeToEmoji(shortcode: string, emojis: EmojiItem[]): EmojiItem | undefined;
79
+
80
+ export { Emoji, type EmojiItem, type EmojiOptions, type EmojiStorage, EmojiSuggestionPluginKey, Emoji as default, emojiToShortcode, emojis, gitHubCustomEmojis, gitHubEmojis, inputRegex, pasteRegex, shortcodeToEmoji };