@mkody/twitch-emoticons 2.6.2 → 2.7.0
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.
- package/README.md +13 -8
- package/docs/BTTVEmote.html +1319 -1241
- package/docs/Channel.html +823 -823
- package/docs/Collection.html +797 -797
- package/docs/Emote.html +801 -801
- package/docs/EmoteFetcher.html +2946 -2694
- package/docs/EmoteParser.html +811 -811
- package/docs/FFZEmote.html +1473 -1317
- package/docs/SevenTVEmote.html +1395 -1317
- package/docs/TwitchEmote.html +1315 -1237
- package/docs/index.html +206 -201
- package/docs/struct_BTTVEmote.js.html +79 -73
- package/docs/struct_Channel.js.html +72 -72
- package/docs/struct_Emote.js.html +73 -72
- package/docs/struct_EmoteFetcher.js.html +121 -77
- package/docs/struct_EmoteParser.js.html +73 -72
- package/docs/struct_FFZEmote.js.html +87 -74
- package/docs/struct_SevenTVEmote.js.html +79 -73
- package/docs/struct_TwitchEmote.js.html +79 -73
- package/docs/util_Collection.js.html +72 -72
- package/package.json +4 -4
- package/src/struct/BTTVEmote.js +7 -1
- package/src/struct/Emote.js +1 -0
- package/src/struct/EmoteFetcher.js +49 -5
- package/src/struct/EmoteParser.js +1 -0
- package/src/struct/FFZEmote.js +15 -2
- package/src/struct/SevenTVEmote.js +7 -1
- package/src/struct/TwitchEmote.js +7 -1
- package/src/util/Constants.js +9 -3
- package/test/index.js +18 -10
- package/typings/index.d.ts +9 -4
package/test/index.js
CHANGED
|
@@ -84,9 +84,9 @@ Promise.all([
|
|
|
84
84
|
]).then(() => {
|
|
85
85
|
const text = bttvParser.parse(':SourPls:\n:tppUrn:\n:MODS:');
|
|
86
86
|
assert.strictEqual(text, [
|
|
87
|
-
'',
|
|
88
|
-
'',
|
|
89
|
-
''
|
|
87
|
+
'',
|
|
88
|
+
'',
|
|
89
|
+
''
|
|
90
90
|
].join('\n'));
|
|
91
91
|
}).then(() => {
|
|
92
92
|
console.log('BTTV emotes test was successful.');
|
|
@@ -101,11 +101,15 @@ Promise.all([
|
|
|
101
101
|
*
|
|
102
102
|
* Tests:
|
|
103
103
|
* - Fetch emotes
|
|
104
|
-
* - FFZ
|
|
104
|
+
* - FFZ Global
|
|
105
|
+
* - FFZ Channel (0kody)
|
|
105
106
|
* - FFZ Channel (shizuka_natsume)
|
|
106
107
|
* - Parse to Markdown
|
|
107
|
-
* - FFZ emote
|
|
108
|
-
* - FFZ emote
|
|
108
|
+
* - FFZ Global emote (CatBag)
|
|
109
|
+
* - FFZ Channel emote (5Head)
|
|
110
|
+
* - FFZ Channel animated emote (MikuSway)
|
|
111
|
+
* - FFZ Channel emote (SanaeSip)
|
|
112
|
+
* - FFZ modifier (ffzHyper)
|
|
109
113
|
*/
|
|
110
114
|
const ffzFetcher = new EmoteFetcher();
|
|
111
115
|
const ffzParser = new EmoteParser(ffzFetcher, {
|
|
@@ -114,13 +118,17 @@ const ffzParser = new EmoteParser(ffzFetcher, {
|
|
|
114
118
|
});
|
|
115
119
|
|
|
116
120
|
Promise.all([
|
|
117
|
-
ffzFetcher.fetchFFZEmotes(
|
|
121
|
+
ffzFetcher.fetchFFZEmotes(),
|
|
122
|
+
ffzFetcher.fetchFFZEmotes(44317909),
|
|
118
123
|
ffzFetcher.fetchFFZEmotes(13638332)
|
|
119
124
|
]).then(() => {
|
|
120
|
-
const text = ffzParser.parse(':
|
|
125
|
+
const text = ffzParser.parse(':CatBag:\n:5Head:\n:MikuSway:\n:SanaeSip: :ffzHyper:');
|
|
121
126
|
assert.strictEqual(text, [
|
|
122
|
-
'',
|
|
128
|
+
'',
|
|
129
|
+
'',
|
|
130
|
+
// Note the trailing space as ffZHyper is removed but not the space before
|
|
131
|
+
' '
|
|
124
132
|
].join('\n'));
|
|
125
133
|
}).then(() => {
|
|
126
134
|
console.log('FFZ emotes test was successful.');
|
package/typings/index.d.ts
CHANGED
|
@@ -47,7 +47,8 @@ declare module '@mkody/twitch-emoticons' {
|
|
|
47
47
|
public constructor(channel: Channel, id: string, data: object);
|
|
48
48
|
|
|
49
49
|
public set?: string;
|
|
50
|
-
public
|
|
50
|
+
public animated: boolean;
|
|
51
|
+
public imageType: 'png' | 'gif';
|
|
51
52
|
public readonly owner: Channel;
|
|
52
53
|
|
|
53
54
|
public toLink(size: number): string;
|
|
@@ -57,7 +58,8 @@ declare module '@mkody/twitch-emoticons' {
|
|
|
57
58
|
public constructor(channel: Channel, id: string, data: any);
|
|
58
59
|
|
|
59
60
|
public ownerName: string;
|
|
60
|
-
public
|
|
61
|
+
public animated: boolean;
|
|
62
|
+
public imageType: 'webp';
|
|
61
63
|
public readonly owner?: Channel;
|
|
62
64
|
|
|
63
65
|
public toLink(size: number): string;
|
|
@@ -68,7 +70,9 @@ declare module '@mkody/twitch-emoticons' {
|
|
|
68
70
|
|
|
69
71
|
public ownerName: string;
|
|
70
72
|
public sizes: string[];
|
|
71
|
-
public
|
|
73
|
+
public animated: boolean;
|
|
74
|
+
public imageType: 'png' | 'webp';
|
|
75
|
+
public modifier: boolean;
|
|
72
76
|
public readonly owner?: Channel;
|
|
73
77
|
|
|
74
78
|
public toLink(size: number): string;
|
|
@@ -79,7 +83,8 @@ declare module '@mkody/twitch-emoticons' {
|
|
|
79
83
|
|
|
80
84
|
public ownerName: string;
|
|
81
85
|
public sizes: string[];
|
|
82
|
-
public
|
|
86
|
+
public animated: boolean;
|
|
87
|
+
public imageType: 'webp' | 'avif';
|
|
83
88
|
public readonly owner?: Channel;
|
|
84
89
|
|
|
85
90
|
public toLink(size: number): string;
|