@mkody/twitch-emoticons 2.7.0 → 2.7.1

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.
Files changed (43) hide show
  1. package/.eslintrc.json +143 -143
  2. package/.github/codeql/codeql-config.yml +4 -4
  3. package/.github/workflows/codeql.yml +50 -50
  4. package/.github/workflows/eslint.yml +50 -50
  5. package/.github/workflows/release.yml +22 -0
  6. package/.github/workflows/yarn-test.yml +17 -17
  7. package/.jsdoc.json +39 -39
  8. package/.nvmrc +1 -0
  9. package/LICENSE +22 -22
  10. package/docs/BTTVEmote.html +1319 -1319
  11. package/docs/Channel.html +823 -823
  12. package/docs/Collection.html +797 -797
  13. package/docs/Emote.html +801 -801
  14. package/docs/EmoteFetcher.html +2946 -2946
  15. package/docs/EmoteParser.html +811 -811
  16. package/docs/FFZEmote.html +1473 -1473
  17. package/docs/SevenTV.html +1190 -1190
  18. package/docs/SevenTVEmote.html +1395 -1395
  19. package/docs/TwitchEmote.html +1315 -1315
  20. package/docs/index.html +206 -206
  21. package/docs/struct_BTTVEmote.js.html +132 -132
  22. package/docs/struct_Channel.js.html +127 -127
  23. package/docs/struct_Emote.js.html +138 -138
  24. package/docs/struct_EmoteFetcher.js.html +395 -399
  25. package/docs/struct_EmoteParser.js.html +153 -153
  26. package/docs/struct_FFZEmote.js.html +146 -146
  27. package/docs/struct_SevenTVEmote.js.html +141 -141
  28. package/docs/struct_TwitchEmote.js.html +130 -130
  29. package/docs/util_Collection.js.html +150 -150
  30. package/package.json +57 -57
  31. package/src/index.js +12 -12
  32. package/src/struct/BTTVEmote.js +60 -60
  33. package/src/struct/Channel.js +55 -55
  34. package/src/struct/Emote.js +66 -66
  35. package/src/struct/EmoteFetcher.js +323 -327
  36. package/src/struct/EmoteParser.js +81 -81
  37. package/src/struct/FFZEmote.js +74 -74
  38. package/src/struct/SevenTVEmote.js +69 -69
  39. package/src/struct/TwitchEmote.js +58 -58
  40. package/src/util/Collection.js +78 -78
  41. package/src/util/Constants.js +31 -31
  42. package/test/index.js +174 -174
  43. package/typings/index.d.ts +98 -98
@@ -1,98 +1,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
- }
35
-
36
- export class EmoteParser {
37
- public constructor(fetcher: EmoteFetcher, options: {
38
- template?: string,
39
- type?: string,
40
- match?: RegExp
41
- });
42
-
43
- public parse(text: string, size?: number): string;
44
- }
45
-
46
- export class TwitchEmote extends Emote {
47
- public constructor(channel: Channel, id: string, data: object);
48
-
49
- public set?: string;
50
- public animated: boolean;
51
- public imageType: 'png' | 'gif';
52
- public readonly owner: Channel;
53
-
54
- public toLink(size: number): string;
55
- }
56
-
57
- export class BTTVEmote extends Emote {
58
- public constructor(channel: Channel, id: string, data: any);
59
-
60
- public ownerName: string;
61
- public animated: boolean;
62
- public imageType: 'webp';
63
- public readonly owner?: Channel;
64
-
65
- public toLink(size: number): string;
66
- }
67
-
68
- export class FFZEmote extends Emote {
69
- public constructor(channel: Channel, id: string, data: object);
70
-
71
- public ownerName: string;
72
- public sizes: string[];
73
- public animated: boolean;
74
- public imageType: 'png' | 'webp';
75
- public modifier: boolean;
76
- public readonly owner?: Channel;
77
-
78
- public toLink(size: number): string;
79
- }
80
-
81
- export class SevenTVEmote extends Emote {
82
- public constructor(channel: Channel, id: string, data: object);
83
-
84
- public ownerName: string;
85
- public sizes: string[];
86
- public animated: boolean;
87
- public imageType: 'webp' | 'avif';
88
- public readonly owner?: Channel;
89
-
90
- public toLink(size: number): string;
91
- }
92
-
93
- export class Collection<K, V> extends Map<K, V> {
94
- public find(propOrFunc: string | ((item: K, index: number, coll: this) => boolean), value?: any): K;
95
- public filter(func: (item: K, index: number, coll: this) => boolean): Collection<K, V>;
96
- public map(func: (item: K, index: number, coll: this) => any): Array<any>;
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
+ }
35
+
36
+ export class EmoteParser {
37
+ public constructor(fetcher: EmoteFetcher, options: {
38
+ template?: string,
39
+ type?: string,
40
+ match?: RegExp
41
+ });
42
+
43
+ public parse(text: string, size?: number): string;
44
+ }
45
+
46
+ export class TwitchEmote extends Emote {
47
+ public constructor(channel: Channel, id: string, data: object);
48
+
49
+ public set?: string;
50
+ public animated: boolean;
51
+ public imageType: 'png' | 'gif';
52
+ public readonly owner: Channel;
53
+
54
+ public toLink(size: number): string;
55
+ }
56
+
57
+ export class BTTVEmote extends Emote {
58
+ public constructor(channel: Channel, id: string, data: any);
59
+
60
+ public ownerName: string | null;
61
+ public animated: boolean;
62
+ public imageType: 'webp';
63
+ public readonly owner?: Channel;
64
+
65
+ public toLink(size: number): string;
66
+ }
67
+
68
+ export class FFZEmote extends Emote {
69
+ public constructor(channel: Channel, id: string, data: object);
70
+
71
+ public ownerName: string | null;
72
+ public sizes: string[];
73
+ public animated: boolean;
74
+ public imageType: 'png' | 'webp';
75
+ public modifier: boolean;
76
+ public readonly owner?: Channel;
77
+
78
+ public toLink(size: number): string;
79
+ }
80
+
81
+ export class SevenTVEmote extends Emote {
82
+ public constructor(channel: Channel, id: string, data: object);
83
+
84
+ public ownerName: string | null;
85
+ public sizes: string[];
86
+ public animated: boolean;
87
+ public imageType: 'webp' | 'avif';
88
+ public readonly owner?: Channel;
89
+
90
+ public toLink(size: number): string;
91
+ }
92
+
93
+ export class Collection<K, V> extends Map<K, V> {
94
+ public find(propOrFunc: string | ((item: K, index: number, coll: this) => boolean), value?: any): K;
95
+ public filter(func: (item: K, index: number, coll: this) => boolean): Collection<K, V>;
96
+ public map(func: (item: K, index: number, coll: this) => any): Array<any>;
97
+ }
98
+ }