@mkody/twitch-emoticons 2.7.0 → 2.8.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/.eslintrc.json +143 -143
- package/.github/codeql/codeql-config.yml +4 -4
- package/.github/workflows/codeql.yml +50 -50
- package/.github/workflows/eslint.yml +50 -50
- package/.github/workflows/release.yml +22 -0
- package/.github/workflows/yarn-test.yml +17 -17
- package/.jsdoc.json +39 -39
- package/.nvmrc +1 -0
- package/LICENSE +22 -22
- package/README.md +36 -4
- package/docs/BTTVEmote.html +1641 -1319
- package/docs/Channel.html +823 -823
- package/docs/Collection.html +797 -797
- package/docs/Emote.html +906 -801
- package/docs/EmoteFetcher.html +3680 -2946
- package/docs/EmoteParser.html +811 -811
- package/docs/FFZEmote.html +1795 -1473
- package/docs/SevenTV.html +1190 -1190
- package/docs/SevenTVEmote.html +1705 -1395
- package/docs/TwitchEmote.html +1637 -1315
- package/docs/index.html +230 -206
- package/docs/struct_BTTVEmote.js.html +162 -132
- package/docs/struct_Channel.js.html +127 -127
- package/docs/struct_Emote.js.html +151 -138
- package/docs/struct_EmoteFetcher.js.html +427 -399
- package/docs/struct_EmoteParser.js.html +153 -153
- package/docs/struct_FFZEmote.js.html +185 -146
- package/docs/struct_SevenTVEmote.js.html +178 -141
- package/docs/struct_TwitchEmote.js.html +159 -130
- package/docs/util_Collection.js.html +150 -150
- package/package.json +57 -57
- package/src/index.js +12 -12
- package/src/struct/BTTVEmote.js +90 -60
- package/src/struct/Channel.js +55 -55
- package/src/struct/Emote.js +79 -66
- package/src/struct/EmoteFetcher.js +355 -327
- package/src/struct/EmoteParser.js +81 -81
- package/src/struct/EmoteTypeMapper.js +13 -0
- package/src/struct/FFZEmote.js +113 -74
- package/src/struct/SevenTVEmote.js +106 -69
- package/src/struct/TwitchEmote.js +87 -58
- package/src/util/Collection.js +78 -78
- package/src/util/Constants.js +31 -31
- package/test/index.js +482 -174
- package/typings/index.d.ts +115 -98
package/typings/index.d.ts
CHANGED
|
@@ -1,98 +1,115 @@
|
|
|
1
|
-
declare module '@mkody/twitch-emoticons' {
|
|
2
|
-
export class Channel {
|
|
3
|
-
public constructor(fetcher: EmoteFetcher, id: number);
|
|
4
|
-
|
|
5
|
-
public fetcher: EmoteFetcher;
|
|
6
|
-
public id: number;
|
|
7
|
-
public emotes: Collection<string, Emote>;
|
|
8
|
-
|
|
9
|
-
public fetchBTTVEmotes(): Promise<Collection<string, BTTVEmote>>;
|
|
10
|
-
public fetchFFZEmotes(): Promise<Collection<string, FFZEmote>>;
|
|
11
|
-
public fetchSevenTVEmotes(): Promise<Collection<string, SevenTVEmote>>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export abstract class Emote {
|
|
15
|
-
public constructor(channel: Channel, id: string, data: object);
|
|
16
|
-
|
|
17
|
-
public fetcher: EmoteFetcher;
|
|
18
|
-
public channel: Channel;
|
|
19
|
-
public id: string;
|
|
20
|
-
public type: 'twitch' | 'bttv' | 'ffz' | '7tv';
|
|
21
|
-
public code: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class EmoteFetcher {
|
|
25
|
-
public constructor(clientId?: string, clientSecret?: string);
|
|
26
|
-
|
|
27
|
-
public emotes: Collection<string, Emote>;
|
|
28
|
-
public channels: Collection<string, Channel>;
|
|
29
|
-
|
|
30
|
-
public fetchTwitchEmotes(id?: number): Promise<Collection<string, TwitchEmote>>;
|
|
31
|
-
public fetchBTTVEmotes(id?: number): Promise<Collection<string, BTTVEmote>>;
|
|
32
|
-
public fetchFFZEmotes(id: number): Promise<Collection<string, FFZEmote>>;
|
|
33
|
-
public fetchSevenTVEmotes(id?: number, format?: 'webp' | 'avif'): Promise<Collection<string, SevenTVEmote>>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
public
|
|
51
|
-
public
|
|
52
|
-
public
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
public
|
|
61
|
-
|
|
62
|
-
public
|
|
63
|
-
public
|
|
64
|
-
|
|
65
|
-
public
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
public
|
|
73
|
-
|
|
74
|
-
public
|
|
75
|
-
public
|
|
76
|
-
public
|
|
77
|
-
|
|
78
|
-
public
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
public
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
public
|
|
87
|
-
|
|
88
|
-
public
|
|
89
|
-
|
|
90
|
-
public
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
public
|
|
95
|
-
public
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
1
|
+
declare module '@mkody/twitch-emoticons' {
|
|
2
|
+
export class Channel {
|
|
3
|
+
public constructor(fetcher: EmoteFetcher, id: number);
|
|
4
|
+
|
|
5
|
+
public fetcher: EmoteFetcher;
|
|
6
|
+
public id: number;
|
|
7
|
+
public emotes: Collection<string, Emote>;
|
|
8
|
+
|
|
9
|
+
public fetchBTTVEmotes(): Promise<Collection<string, BTTVEmote>>;
|
|
10
|
+
public fetchFFZEmotes(): Promise<Collection<string, FFZEmote>>;
|
|
11
|
+
public fetchSevenTVEmotes(): Promise<Collection<string, SevenTVEmote>>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export abstract class Emote {
|
|
15
|
+
public constructor(channel: Channel, id: string, data: object);
|
|
16
|
+
|
|
17
|
+
public fetcher: EmoteFetcher;
|
|
18
|
+
public channel: Channel;
|
|
19
|
+
public id: string;
|
|
20
|
+
public type: 'twitch' | 'bttv' | 'ffz' | '7tv';
|
|
21
|
+
public code: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class EmoteFetcher {
|
|
25
|
+
public constructor(clientId?: string, clientSecret?: string);
|
|
26
|
+
|
|
27
|
+
public emotes: Collection<string, Emote>;
|
|
28
|
+
public channels: Collection<string, Channel>;
|
|
29
|
+
|
|
30
|
+
public fetchTwitchEmotes(id?: number): Promise<Collection<string, TwitchEmote>>;
|
|
31
|
+
public fetchBTTVEmotes(id?: number): Promise<Collection<string, BTTVEmote>>;
|
|
32
|
+
public fetchFFZEmotes(id: number): Promise<Collection<string, FFZEmote>>;
|
|
33
|
+
public fetchSevenTVEmotes(id?: number, format?: 'webp' | 'avif'): Promise<Collection<string, SevenTVEmote>>;
|
|
34
|
+
public fromObject(json: EmoteObject[]): Emote[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class EmoteParser {
|
|
38
|
+
public constructor(fetcher: EmoteFetcher, options: {
|
|
39
|
+
template?: string,
|
|
40
|
+
type?: string,
|
|
41
|
+
match?: RegExp
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
public parse(text: string, size?: number): string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class TwitchEmote extends Emote {
|
|
48
|
+
public constructor(channel: Channel, id: string, data: object);
|
|
49
|
+
|
|
50
|
+
public set?: string;
|
|
51
|
+
public animated: boolean;
|
|
52
|
+
public imageType: 'png' | 'gif';
|
|
53
|
+
public readonly owner: Channel;
|
|
54
|
+
|
|
55
|
+
public toLink(size: number): string;
|
|
56
|
+
public toObject(): EmoteObject;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class BTTVEmote extends Emote {
|
|
60
|
+
public constructor(channel: Channel, id: string, data: any);
|
|
61
|
+
|
|
62
|
+
public ownerName: string | null;
|
|
63
|
+
public animated: boolean;
|
|
64
|
+
public imageType: 'webp';
|
|
65
|
+
public readonly owner?: Channel;
|
|
66
|
+
|
|
67
|
+
public toLink(size: number): string;
|
|
68
|
+
public toObject(): EmoteObject;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class FFZEmote extends Emote {
|
|
72
|
+
public constructor(channel: Channel, id: string, data: object);
|
|
73
|
+
|
|
74
|
+
public ownerName: string | null;
|
|
75
|
+
public sizes: string[];
|
|
76
|
+
public animated: boolean;
|
|
77
|
+
public imageType: 'png' | 'webp';
|
|
78
|
+
public modifier: boolean;
|
|
79
|
+
public readonly owner?: Channel;
|
|
80
|
+
|
|
81
|
+
public toLink(size: number): string;
|
|
82
|
+
public toObject(): EmoteObject;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class SevenTVEmote extends Emote {
|
|
86
|
+
public constructor(channel: Channel, id: string, data: object);
|
|
87
|
+
|
|
88
|
+
public ownerName: string | null;
|
|
89
|
+
public sizes: string[];
|
|
90
|
+
public animated: boolean;
|
|
91
|
+
public imageType: 'webp' | 'avif';
|
|
92
|
+
public readonly owner?: Channel;
|
|
93
|
+
|
|
94
|
+
public toLink(size: number): string;
|
|
95
|
+
public toObject(): EmoteObject;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface EmoteObject {
|
|
99
|
+
code: string,
|
|
100
|
+
id: string,
|
|
101
|
+
channel_id: string,
|
|
102
|
+
type: 'twitch' | 'bttv' | 'ffz' | '7tv'
|
|
103
|
+
animated?: boolean,
|
|
104
|
+
ownerName?: string,
|
|
105
|
+
sizes?: string[],
|
|
106
|
+
set?: string,
|
|
107
|
+
imageType?: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class Collection<K, V> extends Map<K, V> {
|
|
111
|
+
public find(propOrFunc: string | ((item: K, index: number, coll: this) => boolean), value?: any): K;
|
|
112
|
+
public filter(func: (item: K, index: number, coll: this) => boolean): Collection<K, V>;
|
|
113
|
+
public map(func: (item: K, index: number, coll: this) => any): Array<any>;
|
|
114
|
+
}
|
|
115
|
+
}
|