mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 22:05:11 +00:00
Compare commits
554 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64647e8ab6 | ||
|
|
dd93f27499 | ||
|
|
432c045044 | ||
|
|
ce33a15bcb | ||
|
|
75352feacc | ||
|
|
3caed057f6 | ||
|
|
9ef41602c5 | ||
|
|
4a2c23ea24 | ||
|
|
483d564782 | ||
|
|
ae49ac4067 | ||
|
|
de98079c65 | ||
|
|
355b78a52d | ||
|
|
f261a75cd5 | ||
|
|
d99b84c7ce | ||
|
|
4f629294c3 | ||
|
|
0f74e798d4 | ||
|
|
189c00f014 | ||
|
|
46d41059b8 | ||
|
|
96b194fcad | ||
|
|
6590bf32bb | ||
|
|
8e04e1ac40 | ||
|
|
8e0ac73745 | ||
|
|
0c7b3f1a8e | ||
|
|
15e92a49a1 | ||
|
|
c6e0ef1a11 | ||
|
|
12da7a08fb | ||
|
|
a6b624a77d | ||
|
|
0e7757666d | ||
|
|
710c391697 | ||
|
|
bf799f79b6 | ||
|
|
dc25c8f046 | ||
|
|
5fc677bb26 | ||
|
|
38c490533b | ||
|
|
f9c404c229 | ||
|
|
50c5124e1c | ||
|
|
00728074a2 | ||
|
|
07d63e31ad | ||
|
|
61b916cab3 | ||
|
|
e40189e365 | ||
|
|
3d4cf25659 | ||
|
|
577407bab9 | ||
|
|
dc27c4da76 | ||
|
|
1515319b96 | ||
|
|
0799be1b62 | ||
|
|
22e9730888 | ||
|
|
3a000a5705 | ||
|
|
41116f75b4 | ||
|
|
0126090c8f | ||
|
|
38a9f12296 | ||
|
|
d86423cae3 | ||
|
|
781a2f7c60 | ||
|
|
816243e702 | ||
|
|
d8dbbf0c81 | ||
|
|
2ffa14fe2b | ||
|
|
f32b68e373 | ||
|
|
b9640433c8 | ||
|
|
8ecae352fd | ||
|
|
cdff1ae79e | ||
|
|
fbfc38a1a6 | ||
|
|
1e284c7cdf | ||
|
|
e03bb9a6e6 | ||
|
|
28b40534d1 | ||
|
|
cd03aee484 | ||
|
|
575421f4d0 | ||
|
|
702a71dee8 | ||
|
|
8c81e5d27e | ||
|
|
44bdb60bb6 | ||
|
|
799ecc38dd | ||
|
|
e70747ce39 | ||
|
|
ca5c58bfa8 | ||
|
|
1047f5b24e | ||
|
|
8b4a2afeee | ||
|
|
5c7a90c05f | ||
|
|
353a699481 | ||
|
|
58815b642e | ||
|
|
98a38642c7 | ||
|
|
658ff5b216 | ||
|
|
d4d3514dcc | ||
|
|
f9d8c07055 | ||
|
|
a3c64d90c3 | ||
|
|
b4eff3b62b | ||
|
|
ad491a370c | ||
|
|
1af7eb62f1 | ||
|
|
5d56820a5d | ||
|
|
5b7b033df7 | ||
|
|
819bee2a88 | ||
|
|
de019f7f17 | ||
|
|
f7152a3982 | ||
|
|
525f596826 | ||
|
|
ed1acc3baa | ||
|
|
eb1edef868 | ||
|
|
2fb549457b | ||
|
|
c123efd659 | ||
|
|
58ef6585af | ||
|
|
3e036d1612 | ||
|
|
fcb8276a81 | ||
|
|
746f31e412 | ||
|
|
d70d05b6c7 | ||
|
|
a018e9fa95 | ||
|
|
2d51b7cc40 | ||
|
|
ce8e48bb6d | ||
|
|
e5df9b394e | ||
|
|
59eb057995 | ||
|
|
bfc356b69e | ||
|
|
ea271496a3 | ||
|
|
bf3edaed6a | ||
|
|
a819d35ac3 | ||
|
|
5f5e7c34f8 | ||
|
|
74f106c9fc | ||
|
|
16f343be52 | ||
|
|
e8fd3dc3ef | ||
|
|
dc03ab9e82 | ||
|
|
21e61784bc | ||
|
|
a95ec43a99 | ||
|
|
e94ea48a8b | ||
|
|
4398665b9a | ||
|
|
6827b8a3a6 | ||
|
|
ad173d7003 | ||
|
|
5b369dbed1 | ||
|
|
40b0976c35 | ||
|
|
b910b3d147 | ||
|
|
b0115598ba | ||
|
|
c36c750106 | ||
|
|
6662647472 | ||
|
|
4c8a734233 | ||
|
|
6e11973a30 | ||
|
|
d716727e45 | ||
|
|
dd9a14a4ad | ||
|
|
6b64cf38b0 | ||
|
|
e28f86a979 | ||
|
|
c8ccf4bfb7 | ||
|
|
57091cfa02 | ||
|
|
7098f41c5b | ||
|
|
960f49bab6 | ||
|
|
ed51391efc | ||
|
|
fa46c4c4d2 | ||
|
|
45ba135034 | ||
|
|
941e11b6fd | ||
|
|
5fc903d323 | ||
|
|
9aa3f38033 | ||
|
|
192d6a2237 | ||
|
|
3ea80c254a | ||
|
|
b07db6c500 | ||
|
|
b8ab6a7470 | ||
|
|
d8fe9f0c76 | ||
|
|
0718b56f59 | ||
|
|
ef0d85a367 | ||
|
|
5f1a4db7e1 | ||
|
|
a824452333 | ||
|
|
eb5a42dd87 | ||
|
|
52e76a9cfc | ||
|
|
f87a513150 | ||
|
|
ed1060b400 | ||
|
|
bb3f333ac8 | ||
|
|
f91c6d983a | ||
|
|
ddc1b34150 | ||
|
|
3452a722b4 | ||
|
|
78a2add1a5 | ||
|
|
6afcce39dd | ||
|
|
40fe13feda | ||
|
|
9c3163da5e | ||
|
|
fb3d927f8c | ||
|
|
efe6f5c697 | ||
|
|
b3c070bca2 | ||
|
|
e90b31e717 | ||
|
|
ed1baadac3 | ||
|
|
00ae603884 | ||
|
|
c9ebece84d | ||
|
|
6bbc4783cd | ||
|
|
7c708acf0b | ||
|
|
44a75e4e94 | ||
|
|
3992f971d0 | ||
|
|
b6d727607f | ||
|
|
cf8db5df6f | ||
|
|
6f16f1312c | ||
|
|
0f258731db | ||
|
|
556a27704a | ||
|
|
ebe2b2769c | ||
|
|
e9fd7db6e6 | ||
|
|
db5e507951 | ||
|
|
8eb252ad1e | ||
|
|
9918bff479 | ||
|
|
f4cb4ed39e | ||
|
|
b1edb6c156 | ||
|
|
647c824d93 | ||
|
|
9c5eebe583 | ||
|
|
40e67ad7a6 | ||
|
|
dcefa49d34 | ||
|
|
dfbffd1342 | ||
|
|
b881b60ff7 | ||
|
|
c1556f0949 | ||
|
|
cc01bb70cb | ||
|
|
732f7dd4b4 | ||
|
|
e8ea561e71 | ||
|
|
4486d3a4b8 | ||
|
|
61c32a9deb | ||
|
|
ba0f39a7ba | ||
|
|
ae65883335 | ||
|
|
db077f307b | ||
|
|
6b66856b5c | ||
|
|
54813f2dc3 | ||
|
|
8ea9a08c70 | ||
|
|
d77fa7c206 | ||
|
|
66a8eb4854 | ||
|
|
18af2e1148 | ||
|
|
061cac08dd | ||
|
|
887911c1d3 | ||
|
|
467da909d6 | ||
|
|
163e716dca | ||
|
|
1d1e5f3756 | ||
|
|
a748ad2085 | ||
|
|
7aa1d47193 | ||
|
|
fd461045b9 | ||
|
|
c26fb03849 | ||
|
|
b1cdf7a35d | ||
|
|
8943c90cb0 | ||
|
|
f040133412 | ||
|
|
631c763fc4 | ||
|
|
79c5cf5304 | ||
|
|
c5a1bbd7db | ||
|
|
7c839be64f | ||
|
|
cb845b5224 | ||
|
|
746c824020 | ||
|
|
228b85a0c8 | ||
|
|
2e9d67f0b4 | ||
|
|
edd68fe08e | ||
|
|
80872f4ab9 | ||
|
|
8c2dc84f3b | ||
|
|
3005906a28 | ||
|
|
56d25b03f9 | ||
|
|
fbc2dbe781 | ||
|
|
9c0af5adee | ||
|
|
479d01a1b9 | ||
|
|
8eabb11125 | ||
|
|
98058f0cae | ||
|
|
50eb62045a | ||
|
|
4e8d22b4d5 | ||
|
|
51c23ff796 | ||
|
|
dc72ee3809 | ||
|
|
4c7acbbbc7 | ||
|
|
0f29eab3ea | ||
|
|
c38aac23fd | ||
|
|
84957b0e88 | ||
|
|
a4e1d026ea | ||
|
|
b225f2ec6c | ||
|
|
efecbae75b | ||
|
|
1cfc3fb8f8 | ||
|
|
26074b7f18 | ||
|
|
e857f6806f | ||
|
|
b6e96a4d3b | ||
|
|
1d00ba4161 | ||
|
|
77b016de36 | ||
|
|
b7f19bbe37 | ||
|
|
9700ec9cd2 | ||
|
|
65c85a5222 | ||
|
|
8789973bf5 | ||
|
|
4ff3614dc0 | ||
|
|
5c69d340d9 | ||
|
|
75a2506c51 | ||
|
|
9b0ae0fd90 | ||
|
|
f0f75aa918 | ||
|
|
8ebfd9a190 | ||
|
|
17b90beee1 | ||
|
|
8807564053 | ||
|
|
aca30bcb9a | ||
|
|
67aff64fed | ||
|
|
c5888c25f7 | ||
|
|
19c1eaed18 | ||
|
|
5dee746986 | ||
|
|
76a60e07e9 | ||
|
|
abe910d80d | ||
|
|
4a35cf1769 | ||
|
|
643656d798 | ||
|
|
0bb2ed6b72 | ||
|
|
330c3cead7 | ||
|
|
93294673de | ||
|
|
204f916b2a | ||
|
|
f356f647ff | ||
|
|
aad88fe9cd | ||
|
|
72329f901c | ||
|
|
27b2e97e3f | ||
|
|
d9e2732a8d | ||
|
|
0c89314d49 | ||
|
|
4403aee3c1 | ||
|
|
7e028267f1 | ||
|
|
c7e799e935 | ||
|
|
98efe13b97 | ||
|
|
164fd43cc4 | ||
|
|
fe2ed0776f | ||
|
|
74d78d89ed | ||
|
|
6a66b7f54f | ||
|
|
36c15d619e | ||
|
|
a2253cb4ae | ||
|
|
6380111f32 | ||
|
|
1ebd412392 | ||
|
|
a02d1afdf0 | ||
|
|
38e46f89cf | ||
|
|
22d3fb10e9 | ||
|
|
fa672a347d | ||
|
|
cb36cf5706 | ||
|
|
29a2bcbf07 | ||
|
|
03fe7d15cf | ||
|
|
6fb685b959 | ||
|
|
8b36013264 | ||
|
|
50e2ad776b | ||
|
|
4ab084c0ac | ||
|
|
113a1f4b86 | ||
|
|
25cd6b7069 | ||
|
|
f6f0624e52 | ||
|
|
cdda1224ff | ||
|
|
d0869c41cd | ||
|
|
828358bd2e | ||
|
|
3f51ee1b2a | ||
|
|
a33e81d1cb | ||
|
|
f3874d0a26 | ||
|
|
ad810df978 | ||
|
|
1a98d54e3a | ||
|
|
5dd6722528 | ||
|
|
6787e98003 | ||
|
|
18f083b7e6 | ||
|
|
19f4d7cdac | ||
|
|
8e446e44ab | ||
|
|
a17803c1c4 | ||
|
|
dc9064326b | ||
|
|
c55833d95f | ||
|
|
44f7ccafcb | ||
|
|
643122e323 | ||
|
|
310d8e6140 | ||
|
|
1142cab05c | ||
|
|
c653e36137 | ||
|
|
93f28fe984 | ||
|
|
4b0ff3ee5f | ||
|
|
43ba1a4a5e | ||
|
|
23eb85e898 | ||
|
|
9e22ab305c | ||
|
|
1b2bc07592 | ||
|
|
18274e4f0e | ||
|
|
468b290d28 | ||
|
|
f6d92e5024 | ||
|
|
a25d26e921 | ||
|
|
65f41cb7bd | ||
|
|
864ee7c7ad | ||
|
|
decb49fc0a | ||
|
|
b6ffb33adc | ||
|
|
9b24535d44 | ||
|
|
658a62860e | ||
|
|
f6bfd18816 | ||
|
|
ba76c43a26 | ||
|
|
96516f113a | ||
|
|
e4b1a196ae | ||
|
|
7779e5a1ec | ||
|
|
0444831073 | ||
|
|
a6c1f97d12 | ||
|
|
8d97863db6 | ||
|
|
3a1e17e04d | ||
|
|
78d3330ccf | ||
|
|
2a398985cf | ||
|
|
b35b72c066 | ||
|
|
a366693e96 | ||
|
|
ed5ed4b80a | ||
|
|
7f2c4a3566 | ||
|
|
7112caaedd | ||
|
|
18f2b49b67 | ||
|
|
b19bb2b7af | ||
|
|
6d47a340b1 | ||
|
|
a386736dcc | ||
|
|
bf68a8a3e8 | ||
|
|
bb106b7c49 | ||
|
|
3a2a16a09c | ||
|
|
5f21eaabf8 | ||
|
|
4436e6d81d | ||
|
|
47856a26f1 | ||
|
|
9430803f36 | ||
|
|
c19827a0e5 | ||
|
|
fae15dbdfe | ||
|
|
e7076f5aee | ||
|
|
0ce7772500 | ||
|
|
503c90c201 | ||
|
|
db0bcf7da3 | ||
|
|
0e90bda3c7 | ||
|
|
f0fcaf734e | ||
|
|
eafbc0d15a | ||
|
|
2a4314efc9 | ||
|
|
b706d53998 | ||
|
|
76b1fe9a87 | ||
|
|
a9dc81e600 | ||
|
|
0985d2c8cd | ||
|
|
600a95f751 | ||
|
|
d7e6fcd3ae | ||
|
|
f030937bfa | ||
|
|
6ea960cf90 | ||
|
|
1fdfd6f305 | ||
|
|
bbeaa461e5 | ||
|
|
bd4519a816 | ||
|
|
e487529f06 | ||
|
|
a7eb3cd072 | ||
|
|
eeec088354 | ||
|
|
b4dddfda47 | ||
|
|
e447dec67b | ||
|
|
c7f3889713 | ||
|
|
c1074cb8f7 | ||
|
|
88c4dab0c9 | ||
|
|
94b258af4d | ||
|
|
8023b1be95 | ||
|
|
c2e5dcc384 | ||
|
|
cb8e8bd407 | ||
|
|
c1f19d5288 | ||
|
|
707d688887 | ||
|
|
98b1b11dfa | ||
|
|
8473b593a7 | ||
|
|
59ddf55b99 | ||
|
|
8c7225d106 | ||
|
|
d542095993 | ||
|
|
e69575f273 | ||
|
|
92ff9c1ca4 | ||
|
|
690574376b | ||
|
|
a8b2b0ca64 | ||
|
|
97af9f8d98 | ||
|
|
89ef26e719 | ||
|
|
9a3c66abfd | ||
|
|
73f68fe0b7 | ||
|
|
133e924425 | ||
|
|
0a2d4a2ab2 | ||
|
|
b0b616d92a | ||
|
|
235bdee061 | ||
|
|
578aa5f107 | ||
|
|
15fa0ff7a7 | ||
|
|
34269e2339 | ||
|
|
8aa92873b9 | ||
|
|
3b53ad0c91 | ||
|
|
59974a162e | ||
|
|
bebf3dd068 | ||
|
|
838a90831f | ||
|
|
b954bf3c9d | ||
|
|
096f848385 | ||
|
|
9fa91c193d | ||
|
|
dad69e0d0f | ||
|
|
700b971e7d | ||
|
|
cf78ddcfe2 | ||
|
|
e99e89e964 | ||
|
|
524202e49d | ||
|
|
82f9cd1d3a | ||
|
|
0f4d3dfd3a | ||
|
|
a8c01a2a05 | ||
|
|
fe0309ffaa | ||
|
|
1fa6181f7e | ||
|
|
77bed92c57 | ||
|
|
6f23c9e67a | ||
|
|
3dd58c2551 | ||
|
|
8ad33db6c2 | ||
|
|
64dadcce4c | ||
|
|
e5f6605c01 | ||
|
|
d753478097 | ||
|
|
0e7d7541bb | ||
|
|
ab38e59550 | ||
|
|
4f11316a8b | ||
|
|
71f352a611 | ||
|
|
9d2f2460e1 | ||
|
|
094a7852b1 | ||
|
|
cdd8f30962 | ||
|
|
7eeb719eac | ||
|
|
c8b54234fa | ||
|
|
7450ecd6f3 | ||
|
|
7246bface3 | ||
|
|
8d0256bde8 | ||
|
|
478699d1b0 | ||
|
|
eeea8d9291 | ||
|
|
96ee0c1351 | ||
|
|
22b50f03ca | ||
|
|
599c33769c | ||
|
|
93f98cee2c | ||
|
|
dcb31ca849 | ||
|
|
dcd4531327 | ||
|
|
188fd48659 | ||
|
|
1126dc6e66 | ||
|
|
f075fed236 | ||
|
|
cef806a243 | ||
|
|
95bd8c831c | ||
|
|
8ca91354ac | ||
|
|
b980320d0a | ||
|
|
d563b66842 | ||
|
|
d62be1b94a | ||
|
|
b3bff83dd5 | ||
|
|
7eec2e5d5b | ||
|
|
d178dcc480 | ||
|
|
16910c95ad | ||
|
|
94ee0c518a | ||
|
|
c4fc9ac8e0 | ||
|
|
48868f01fe | ||
|
|
dcb7a593e5 | ||
|
|
6f5fd5d0b6 | ||
|
|
4391fcc21b | ||
|
|
c5300713b2 | ||
|
|
5eb4435463 | ||
|
|
c32680100e | ||
|
|
678da62723 | ||
|
|
721aca6e1a | ||
|
|
0f384419d5 | ||
|
|
11715da9e0 | ||
|
|
3de661585c | ||
|
|
e88af36be9 | ||
|
|
8f65d3cae9 | ||
|
|
aab09ac249 | ||
|
|
ff82532a18 | ||
|
|
8d0f312122 | ||
|
|
4e32126e5d | ||
|
|
421ff83276 | ||
|
|
45c0fc48ed | ||
|
|
b5ef858e71 | ||
|
|
3e524f9d92 | ||
|
|
dd714ff3c2 | ||
|
|
71ade7d658 | ||
|
|
edf6480b8f | ||
|
|
05566aed15 | ||
|
|
6adae20449 | ||
|
|
1f0635ffc8 | ||
|
|
1f67203183 | ||
|
|
f91e2ca874 | ||
|
|
6b0c02daa6 | ||
|
|
8dfbb5f9d8 | ||
|
|
5ec564558e | ||
|
|
94d45780f9 | ||
|
|
8773d057bc | ||
|
|
f9cc400757 | ||
|
|
fad2f1e5b4 | ||
|
|
146a2ac77d | ||
|
|
591751449e | ||
|
|
205e07d2c5 | ||
|
|
5196c2adc0 | ||
|
|
306890aa13 | ||
|
|
5d482ff3bf | ||
|
|
e8639e2e16 | ||
|
|
fcf8690d26 | ||
|
|
e4380632e0 | ||
|
|
4a447c74ef | ||
|
|
848c2299d2 | ||
|
|
1e426b4253 | ||
|
|
971e186335 | ||
|
|
949aad8cc7 | ||
|
|
70ce6ff2d6 | ||
|
|
a73074b69f | ||
|
|
ae98cfb637 | ||
|
|
6cccb54ffc | ||
|
|
4f5ebec4bb | ||
|
|
7b9f0a36ba | ||
|
|
fc4e95806d | ||
|
|
1eff1a02bd | ||
|
|
414539f45e | ||
|
|
b2d5c00a23 | ||
|
|
a492f7657b | ||
|
|
e280ed2683 | ||
|
|
8fccda4a24 | ||
|
|
68662c9625 | ||
|
|
7d45862023 |
631 changed files with 25711 additions and 14680 deletions
42
.github/ISSUE_TEMPLATE/blank.yml
vendored
42
.github/ISSUE_TEMPLATE/blank.yml
vendored
|
|
@ -2,30 +2,24 @@ name: Blank Issue
|
|||
description: Create a blank issue. ALWAYS FIRST USE OUR SUPPORT CHANNEL! ONLY USE THIS FORM IF YOU ARE A CONTRIBUTOR OR WERE TOLD TO DO SO IN THE SUPPORT CHANNEL.
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
# READ THIS BEFORE OPENING AN ISSUE
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||

|
||||
|
||||
This form is ONLY FOR DEVELOPERS. YOUR ISSUE WILL BE CLOSED AND YOU WILL POSSIBLY BE BLOCKED FROM THE REPOSITORY IF YOU IGNORE THIS.
|
||||
|
||||
DO NOT USE THIS FORM, unless
|
||||
- you are a vencord contributor
|
||||
- you were given explicit permission to use this form by a moderator in our support server
|
||||
|
||||
DO NOT USE THIS FORM FOR SECURITY RELATED ISSUES. [CREATE A SECURITY ADVISORY INSTEAD.](https://github.com/Vendicated/Vencord/security/advisories/new)
|
||||
GitHub Issues are for development, not support! Please use our [support server](https://vencord.dev/discord) unless you are a Vencord Developer.
|
||||
|
||||
- type: textarea
|
||||
id: content
|
||||
attributes:
|
||||
label: Content
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: agreement-check
|
||||
attributes:
|
||||
label: Request Agreement
|
||||
options:
|
||||
- label: I have read the requirements for opening an issue above
|
||||
- type: textarea
|
||||
id: content
|
||||
attributes:
|
||||
label: Content
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
id: agreement-check
|
||||
attributes:
|
||||
label: Request Agreement
|
||||
options:
|
||||
- label: I have read the requirements for opening an issue above
|
||||
required: true
|
||||
|
|
|
|||
127
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
127
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -4,78 +4,63 @@ labels: [bug]
|
|||
title: "[Bug] <title>"
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
# READ THIS BEFORE OPENING AN ISSUE
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||

|
||||
|
||||
This form is ONLY FOR DEVELOPERS. YOUR ISSUE WILL BE CLOSED AND YOU WILL POSSIBLY BE BLOCKED FROM THE REPOSITORY IF YOU IGNORE THIS.
|
||||
|
||||
DO NOT USE THIS FORM, unless
|
||||
- you are a vencord contributor
|
||||
- you were given explicit permission to use this form by a moderator in our support server
|
||||
|
||||
DO NOT USE THIS FORM FOR SECURITY RELATED ISSUES. [CREATE A SECURITY ADVISORY INSTEAD.](https://github.com/Vendicated/Vencord/security/advisories/new)
|
||||
|
||||
- type: input
|
||||
id: discord
|
||||
attributes:
|
||||
label: Discord Account
|
||||
description: Who on Discord is making this request? Not required but encouraged for easier follow-up
|
||||
placeholder: username#0000
|
||||
validations:
|
||||
required: false
|
||||
GitHub Issues are for development, not support! Please use our [support server](https://vencord.dev/discord) unless you are a Vencord Developer.
|
||||
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: What happens when the bug or crash occurs?
|
||||
description: Where does this bug or crash occur, when does it occur, etc.
|
||||
placeholder: The bug/crash happens sometimes when I do ..., causing this to not work/the app to crash. I think it happens because of ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected-behaviour
|
||||
attributes:
|
||||
label: What is the expected behaviour?
|
||||
description: Simply detail what the expected behaviour is.
|
||||
placeholder: I expect Vencord/Discord to open the ... page instead of ..., it prevents me from doing ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps-to-take
|
||||
attributes:
|
||||
label: How do you recreate this bug or crash?
|
||||
description: Give us a list of steps in order to recreate the bug or crash.
|
||||
placeholder: |
|
||||
1. Do ...
|
||||
2. Then ...
|
||||
3. Do this ..., ... and then ...
|
||||
4. Observe "the bug" or "the crash"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: crash-log
|
||||
attributes:
|
||||
label: Errors
|
||||
description: Open the Developer Console with Ctrl/Cmd + Shift + i. Then look for any red errors (Ignore network errors like Failed to load resource) and paste them between the "```".
|
||||
value: |
|
||||
```
|
||||
Replace this text with your crash-log.
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
id: agreement-check
|
||||
attributes:
|
||||
label: Request Agreement
|
||||
description: We only accept reports for bugs that happen on Discord Stable. Canary and PTB are Development branches and may be unstable
|
||||
options:
|
||||
- label: I am using Discord Stable or tried on Stable and this bug happens there as well
|
||||
- type: textarea
|
||||
id: bug-description
|
||||
attributes:
|
||||
label: What happens when the bug or crash occurs?
|
||||
description: Where does this bug or crash occur, when does it occur, etc.
|
||||
placeholder: The bug/crash happens sometimes when I do ..., causing this to not work/the app to crash. I think it happens because of ...
|
||||
validations:
|
||||
required: true
|
||||
- label: I have read the requirements for opening an issue above
|
||||
|
||||
- type: textarea
|
||||
id: expected-behaviour
|
||||
attributes:
|
||||
label: What is the expected behaviour?
|
||||
description: Simply detail what the expected behaviour is.
|
||||
placeholder: I expect Vencord/Discord to open the ... page instead of ..., it prevents me from doing ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps-to-take
|
||||
attributes:
|
||||
label: How do you recreate this bug or crash?
|
||||
description: Give us a list of steps in order to recreate the bug or crash.
|
||||
placeholder: |
|
||||
1. Do ...
|
||||
2. Then ...
|
||||
3. Do this ..., ... and then ...
|
||||
4. Observe "the bug" or "the crash"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: crash-log
|
||||
attributes:
|
||||
label: Errors
|
||||
description: Open the Developer Console with Ctrl/Cmd + Shift + i. Then look for any red errors (Ignore network errors like Failed to load resource) and paste them between the "```".
|
||||
value: |
|
||||
```
|
||||
Replace this text with your crash-log.
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
id: agreement-check
|
||||
attributes:
|
||||
label: Request Agreement
|
||||
description: We only accept reports for bugs that happen on Discord Stable. Canary and PTB are Development branches and may be unstable
|
||||
options:
|
||||
- label: I am using Discord Stable or tried on Stable and this bug happens there as well
|
||||
required: true
|
||||
- label: I am a Vencord Developer
|
||||
required: true
|
||||
|
|
|
|||
BIN
.github/ISSUE_TEMPLATE/developer-banner.png
vendored
Normal file
BIN
.github/ISSUE_TEMPLATE/developer-banner.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -42,7 +42,7 @@ jobs:
|
|||
|
||||
- name: Clean up obsolete files
|
||||
run: |
|
||||
rm -rf dist/*-unpacked dist/monaco Vencord.user.css vencordDesktopRenderer.css vencordDesktopRenderer.css.map
|
||||
rm -rf dist/*-unpacked dist/vendor Vencord.user.css vencordDesktopRenderer.css vencordDesktopRenderer.css.map
|
||||
|
||||
- name: Get some values needed for the release
|
||||
id: release_values
|
||||
|
|
|
|||
74
.github/workflows/reportBrokenPlugins.yml
vendored
74
.github/workflows/reportBrokenPlugins.yml
vendored
|
|
@ -1,9 +1,22 @@
|
|||
name: Test Patches
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Every day at midnight
|
||||
- cron: 0 0 * * *
|
||||
inputs:
|
||||
discord_branch:
|
||||
type: choice
|
||||
description: "Discord Branch to test patches on"
|
||||
options:
|
||||
- both
|
||||
- stable
|
||||
- canary
|
||||
default: both
|
||||
webhook_url:
|
||||
type: string
|
||||
description: "Webhook URL that the report will be posted to. This will be visible for everyone, so DO NOT pass sensitive webhooks like discord webhook. This is meant to be used by Venbot."
|
||||
required: false
|
||||
# schedule:
|
||||
# # Every day at midnight
|
||||
# - cron: 0 0 * * *
|
||||
|
||||
jobs:
|
||||
TestPlugins:
|
||||
|
|
@ -31,37 +44,46 @@ jobs:
|
|||
run: |
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Google Chrome
|
||||
id: setup-chrome
|
||||
uses: browser-actions/setup-chrome@82b9ce628cc5595478a9ebadc480958a36457dc2
|
||||
with:
|
||||
chrome-version: stable
|
||||
|
||||
- name: Build Vencord Reporter Version
|
||||
run: pnpm buildReporter
|
||||
|
||||
- name: Create Report
|
||||
- name: Run Reporter
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
|
||||
export CHROMIUM_BIN=/usr/bin/google-chrome
|
||||
|
||||
esbuild scripts/generateReport.ts > dist/report.mjs
|
||||
node dist/report.mjs >> $GITHUB_STEP_SUMMARY
|
||||
env:
|
||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
- name: Create Report (Canary)
|
||||
timeout-minutes: 10
|
||||
if: success() || failure() # even run if previous one failed
|
||||
run: |
|
||||
export PATH="$PWD/node_modules/.bin:$PATH"
|
||||
export CHROMIUM_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
|
||||
export USE_CANARY=true
|
||||
stable_output_file=$(mktemp)
|
||||
canary_output_file=$(mktemp)
|
||||
|
||||
esbuild scripts/generateReport.ts > dist/report.mjs
|
||||
node dist/report.mjs >> $GITHUB_STEP_SUMMARY
|
||||
pids=""
|
||||
|
||||
branch="${{ inputs.discord_branch }}"
|
||||
if [[ "${{ github.event_name }}" = "schedule" ]]; then
|
||||
branch="both"
|
||||
fi
|
||||
|
||||
if [[ "$branch" = "both" || "$branch" = "stable" ]]; then
|
||||
node dist/report.mjs > "$stable_output_file" &
|
||||
pids+=" $!"
|
||||
fi
|
||||
|
||||
if [[ "$branch" = "both" || "$branch" = "canary" ]]; then
|
||||
USE_CANARY=true node dist/report.mjs > "$canary_output_file" &
|
||||
pids+=" $!"
|
||||
fi
|
||||
|
||||
exit_code=0
|
||||
for pid in $pids; do
|
||||
if ! wait "$pid"; then
|
||||
exit_code=1
|
||||
fi
|
||||
done
|
||||
|
||||
cat "$stable_output_file" "$canary_output_file" >> $GITHUB_STEP_SUMMARY
|
||||
exit $exit_code
|
||||
env:
|
||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
WEBHOOK_URL: ${{ inputs.webhook_url || secrets.DISCORD_WEBHOOK }}
|
||||
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
|
||||
|
|
|
|||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -8,6 +8,7 @@ vencord_installer
|
|||
.DS_Store
|
||||
|
||||
yarn.lock
|
||||
bun.lock
|
||||
package-lock.json
|
||||
|
||||
*.log
|
||||
|
|
@ -21,4 +22,4 @@ lerna-debug.log*
|
|||
src/userplugins
|
||||
|
||||
ExtensionCache/
|
||||
settings/
|
||||
/settings
|
||||
|
|
|
|||
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
|
|
@ -13,11 +13,14 @@
|
|||
"typescript.format.semicolons": "insert",
|
||||
"typescript.preferences.quoteStyle": "double",
|
||||
"javascript.preferences.quoteStyle": "double",
|
||||
|
||||
"gitlens.remotes": [
|
||||
{
|
||||
"domain": "codeberg.org",
|
||||
"type": "Gitea"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"css.format.spaceAroundSelectorSeparator": true,
|
||||
"[css]": {
|
||||
"editor.defaultFormatter": "vscode.css-language-features"
|
||||
}
|
||||
}
|
||||
14
README.md
14
README.md
|
|
@ -1,23 +1,21 @@
|
|||
# Vencord
|
||||
|
||||

|
||||
[](https://codeberg.org/Vee/cord)
|
||||
|
||||
The cutest Discord client mod
|
||||
|
||||
|  |
|
||||
| :--------------------------------------------------------------------------------------------------: |
|
||||
| A screenshot of vencord showcasing the [vencord-theme](https://github.com/synqat/vencord-theme) |
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- Super easy to install (Download Installer, open, click install button, done)
|
||||
- 100+ plugins built in: [See a list](https://vencord.dev/plugins)
|
||||
- Some highlights: SpotifyControls, MessageLogger, Experiments, GameActivityToggle, Translate, NoTrack, QuickReply, Free Emotes/Stickers, PermissionsViewer, CustomCommands, ShowHiddenChannels, PronounDB
|
||||
- Easy to install
|
||||
- [100+ built in plugins](https://vencord.dev/plugins)
|
||||
- Fairly lightweight despite the many inbuilt plugins
|
||||
- Excellent Browser Support: Run Vencord in your Browser via extension or UserScript
|
||||
- Works on any Discord branch: Stable, Canary or PTB all work (though for the best experience I recommend stable!)
|
||||
- Works on any Discord branch: Stable, Canary or PTB all work
|
||||
- Custom CSS and Themes: Inbuilt css editor with support to import any css files (including BetterDiscord themes)
|
||||
- Privacy friendly, blocks Discord analytics & crash reporting out of the box and has no telemetry
|
||||
- Privacy friendly: blocks Discord analytics & crash reporting out of the box and has no telemetry
|
||||
- Maintained very actively, broken plugins are usually fixed within 12 hours
|
||||
- Settings sync: Keep your plugins and their settings synchronised between devices / apps (optional)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@
|
|||
*/
|
||||
|
||||
function parseHeaders(headers) {
|
||||
const result = new Headers();
|
||||
if (!headers)
|
||||
return {};
|
||||
const result = {};
|
||||
return result;
|
||||
|
||||
const headersArr = headers.trim().split("\n");
|
||||
for (var i = 0; i < headersArr.length; i++) {
|
||||
var row = headersArr[i];
|
||||
|
|
@ -27,13 +28,7 @@ function parseHeaders(headers) {
|
|||
, key = row.slice(0, index).trim().toLowerCase()
|
||||
, value = row.slice(index + 1).trim();
|
||||
|
||||
if (result[key] === undefined) {
|
||||
result[key] = value;
|
||||
} else if (Array.isArray(result[key])) {
|
||||
result[key].push(value);
|
||||
} else {
|
||||
result[key] = [result[key], value];
|
||||
}
|
||||
result.append(key, value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,17 +19,16 @@
|
|||
/// <reference path="../src/modules.d.ts" />
|
||||
/// <reference path="../src/globals.d.ts" />
|
||||
|
||||
// Be very careful with imports in this file to avoid circular dependency issues.
|
||||
// Only import pure modules that don't import other parts of Vencord.
|
||||
import monacoHtmlLocal from "file://monacoWin.html?minify";
|
||||
import monacoHtmlCdn from "file://../src/main/monacoWin.html?minify";
|
||||
import * as DataStore from "../src/api/DataStore";
|
||||
import { debounce } from "../src/utils";
|
||||
import { EXTENSION_BASE_URL } from "../src/utils/web-metadata";
|
||||
import { getTheme, Theme } from "../src/utils/discord";
|
||||
import { getThemeInfo } from "../src/main/themes";
|
||||
import { Settings } from "../src/Vencord";
|
||||
|
||||
// Discord deletes this so need to store in variable
|
||||
const { localStorage } = window;
|
||||
import * as DataStore from "@api/DataStore";
|
||||
import type { Settings } from "@api/Settings";
|
||||
import { getThemeInfo } from "@main/themes";
|
||||
import { debounce } from "@shared/debounce";
|
||||
import { localStorage } from "@utils/localStorage";
|
||||
import { getStylusWebStoreUrl } from "@utils/web";
|
||||
import { EXTENSION_BASE_URL, metaReady, RENDERER_CSS_URL } from "@utils/web-metadata";
|
||||
|
||||
// listeners for ipc.on
|
||||
const cssListeners = new Set<(css: string) => void>();
|
||||
|
|
@ -45,17 +44,29 @@ window.VencordNative = {
|
|||
themes: {
|
||||
uploadTheme: (fileName: string, fileData: string) => DataStore.set(fileName, fileData, themeStore),
|
||||
deleteTheme: (fileName: string) => DataStore.del(fileName, themeStore),
|
||||
getThemesDir: async () => "",
|
||||
getThemesList: () => DataStore.entries(themeStore).then(entries =>
|
||||
entries.map(([name, css]) => getThemeInfo(css, name.toString()))
|
||||
),
|
||||
getThemeData: (fileName: string) => DataStore.get(fileName, themeStore),
|
||||
getSystemValues: async () => ({}),
|
||||
|
||||
openFolder: async () => Promise.reject("themes:openFolder is not supported on web"),
|
||||
},
|
||||
|
||||
native: {
|
||||
getVersions: () => ({}),
|
||||
openExternal: async (url) => void open(url, "_blank")
|
||||
openExternal: async (url) => void open(url, "_blank"),
|
||||
getRendererCss: async () => {
|
||||
if (IS_USERSCRIPT)
|
||||
// need to wait for next tick for _vcUserScriptRendererCss to be set
|
||||
return Promise.resolve().then(() => window._vcUserScriptRendererCss);
|
||||
|
||||
await metaReady;
|
||||
|
||||
return fetch(RENDERER_CSS_URL)
|
||||
.then(res => res.text());
|
||||
},
|
||||
onRendererCssUpdate: NOOP,
|
||||
},
|
||||
|
||||
updater: {
|
||||
|
|
@ -77,6 +88,14 @@ window.VencordNative = {
|
|||
addThemeChangeListener: NOOP,
|
||||
openFile: NOOP_ASYNC,
|
||||
async openEditor() {
|
||||
if (IS_USERSCRIPT) {
|
||||
const shouldOpenWebStore = confirm("QuickCSS is not supported on the Userscript. You can instead use the Stylus extension.\n\nDo you want to open the Stylus web store page?");
|
||||
if (shouldOpenWebStore) {
|
||||
window.open(getStylusWebStoreUrl(), "_blank");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const features = `popup,width=${Math.min(window.innerWidth, 1000)},height=${Math.min(window.innerHeight, 1000)}`;
|
||||
const win = open("about:blank", "VencordQuickCss", features);
|
||||
if (!win) {
|
||||
|
|
@ -87,13 +106,17 @@ window.VencordNative = {
|
|||
win.baseUrl = EXTENSION_BASE_URL;
|
||||
win.setCss = setCssDebounced;
|
||||
win.getCurrentCss = () => VencordNative.quickCss.get();
|
||||
win.getTheme = () =>
|
||||
getTheme() === Theme.Light
|
||||
? "vs-light"
|
||||
: "vs-dark";
|
||||
win.getTheme = this.getEditorTheme;
|
||||
|
||||
win.document.write(IS_EXTENSION ? monacoHtmlLocal : monacoHtmlCdn);
|
||||
win.document.write(monacoHtmlLocal);
|
||||
},
|
||||
getEditorTheme: () => {
|
||||
const { getTheme, Theme } = require("@utils/discord");
|
||||
|
||||
return getTheme() === Theme.Light
|
||||
? "vs-light"
|
||||
: "vs-dark";
|
||||
}
|
||||
},
|
||||
|
||||
settings: {
|
||||
|
|
@ -106,8 +129,9 @@ window.VencordNative = {
|
|||
}
|
||||
},
|
||||
set: async (s: Settings) => localStorage.setItem("VencordSettings", JSON.stringify(s)),
|
||||
getSettingsDir: async () => "LocalStorage"
|
||||
openFolder: async () => Promise.reject("settings:openFolder is not supported on web"),
|
||||
},
|
||||
|
||||
pluginHelpers: {} as any,
|
||||
csp: {} as any,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ chrome.webRequest.onHeadersReceived.addListener(
|
|||
({ responseHeaders, type, url }) => {
|
||||
if (!responseHeaders) return;
|
||||
|
||||
if (type === "main_frame") {
|
||||
if (type === "main_frame" && url.includes("discord.com")) {
|
||||
// In main frame requests, the CSP needs to be removed to enable fetching of custom css
|
||||
// as desired by the user
|
||||
removeFirst(responseHeaders, h => h.name.toLowerCase() === "content-security-policy");
|
||||
|
|
|
|||
|
|
@ -2,20 +2,15 @@ if (typeof browser === "undefined") {
|
|||
var browser = chrome;
|
||||
}
|
||||
|
||||
const style = document.createElement("link");
|
||||
style.type = "text/css";
|
||||
style.rel = "stylesheet";
|
||||
style.href = browser.runtime.getURL("dist/Vencord.css");
|
||||
|
||||
document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
() => {
|
||||
document.documentElement.append(style);
|
||||
window.postMessage({
|
||||
type: "vencord:meta",
|
||||
meta: {
|
||||
EXTENSION_VERSION: browser.runtime.getManifest().version,
|
||||
EXTENSION_BASE_URL: browser.runtime.getURL(""),
|
||||
RENDERER_CSS_URL: browser.runtime.getURL("dist/Vencord.css"),
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["dist/*", "third-party/*"],
|
||||
"resources": ["dist/*", "vendor/*"],
|
||||
"matches": ["*://*.discord.com/*"]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
]
|
||||
},
|
||||
"condition": {
|
||||
"resourceTypes": ["main_frame", "sub_frame"]
|
||||
"resourceTypes": ["main_frame", "sub_frame"],
|
||||
"urlFilter": "||discord.com^"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -32,7 +33,7 @@
|
|||
},
|
||||
"condition": {
|
||||
"resourceTypes": ["stylesheet"],
|
||||
"urlFilter": "https://raw.githubusercontent.com/*"
|
||||
"urlFilter": "||raw.githubusercontent.com^"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare global {
|
|||
const getTheme: () => string;
|
||||
}
|
||||
|
||||
const BASE = "/dist/monaco/vs";
|
||||
const BASE = "/vendor/monaco/vs";
|
||||
|
||||
self.MonacoEnvironment = {
|
||||
getWorkerUrl(_moduleId: unknown, label: string) {
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
<script>
|
||||
const script = document.createElement("script");
|
||||
script.src = new URL("/dist/monaco/index.js", baseUrl);
|
||||
script.src = new URL("/vendor/monaco/index.js", baseUrl);
|
||||
|
||||
const style = document.createElement("link");
|
||||
style.type = "text/css";
|
||||
style.rel = "stylesheet";
|
||||
style.href = new URL("/dist/monaco/index.css", baseUrl);
|
||||
style.href = new URL("/vendor/monaco/index.css", baseUrl);
|
||||
|
||||
document.body.append(style, script);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
// @license GPL-3.0
|
||||
// @match *://*.discord.com/*
|
||||
// @grant GM_xmlhttpRequest
|
||||
// @grant unsafeWindow
|
||||
// @run-at document-start
|
||||
// @compatible chrome Chrome + Tampermonkey or Violentmonkey
|
||||
// @compatible firefox Firefox Tampermonkey
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ export default tseslint.config(
|
|||
"@stylistic/no-extra-semi": "error",
|
||||
|
||||
// TS Rules
|
||||
"@stylistic/func-call-spacing": ["error", "never"],
|
||||
"@stylistic/function-call-spacing": ["error", "never"],
|
||||
|
||||
// ESLint Rules
|
||||
"yoda": "error",
|
||||
|
|
@ -115,7 +115,7 @@ export default tseslint.config(
|
|||
"no-useless-escape": [
|
||||
"error",
|
||||
{
|
||||
"extra": "i"
|
||||
"allowRegexCharacters": ["i"]
|
||||
}
|
||||
],
|
||||
"no-fallthrough": "error",
|
||||
|
|
@ -134,7 +134,7 @@ export default tseslint.config(
|
|||
"no-unsafe-optional-chaining": "error",
|
||||
"no-useless-backreference": "error",
|
||||
"use-isnan": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-const": ["error", { destructuring: "all" }],
|
||||
"prefer-spread": "error",
|
||||
|
||||
// Plugin Rules
|
||||
|
|
|
|||
83
package.json
83
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "vencord",
|
||||
"private": "true",
|
||||
"version": "1.11.3",
|
||||
"version": "1.14.6",
|
||||
"description": "The cutest Discord client mod",
|
||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||
"bugs": {
|
||||
|
|
@ -24,66 +24,65 @@
|
|||
"dev": "pnpm watch",
|
||||
"watchWeb": "pnpm buildWeb --watch",
|
||||
"generatePluginJson": "tsx scripts/generatePluginList.ts",
|
||||
"generateTypes": "tspc --emitDeclarationOnly --declaration --outDir packages/vencord-types",
|
||||
"inject": "node scripts/runInstaller.mjs",
|
||||
"uninject": "node scripts/runInstaller.mjs",
|
||||
"generateTypes": "tspc --emitDeclarationOnly --declaration --outDir packages/vencord-types --allowJs false",
|
||||
"inject": "node scripts/runInstaller.mjs -- --install",
|
||||
"uninject": "node scripts/runInstaller.mjs -- --uninstall",
|
||||
"lint": "eslint",
|
||||
"lint-styles": "stylelint \"src/**/*.css\" --ignore-pattern src/userplugins",
|
||||
"lint:fix": "pnpm lint --fix",
|
||||
"test": "pnpm buildStandalone && pnpm lint && pnpm lint-styles && pnpm testTsc && pnpm generatePluginJson",
|
||||
"test": "pnpm buildStandalone && pnpm testTsc && pnpm lint && pnpm lint-styles && pnpm generatePluginJson",
|
||||
"testWeb": "pnpm lint && pnpm buildWeb && pnpm testTsc",
|
||||
"testTsc": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@intrnl/xxhash64": "^0.1.2",
|
||||
"@sapphi-red/web-noise-suppressor": "0.3.5",
|
||||
"@vap/core": "0.0.12",
|
||||
"@vap/shiki": "0.10.5",
|
||||
"fflate": "^0.8.2",
|
||||
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
|
||||
"monaco-editor": "^0.52.2",
|
||||
"nanoid": "^5.0.9",
|
||||
"monaco-editor": "^0.54.0",
|
||||
"nanoid": "^5.1.6",
|
||||
"virtual-merge": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@stylistic/eslint-plugin": "^2.12.1",
|
||||
"@types/chrome": "^0.0.287",
|
||||
"@types/diff": "^6.0.0",
|
||||
"@types/lodash": "^4.17.14",
|
||||
"@types/node": "^22.10.5",
|
||||
"@types/react": "^19.0.2",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"@types/yazl": "^2.4.5",
|
||||
"diff": "^7.0.0",
|
||||
"discord-types": "^1.3.26",
|
||||
"esbuild": "^0.15.18",
|
||||
"eslint": "^9.17.0",
|
||||
"@stylistic/eslint-plugin": "^5.6.0",
|
||||
"@types/chrome": "^0.1.30",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^19.0.10",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@types/yazl": "^3.3.0",
|
||||
"@vencord/discord-types": "link:packages/discord-types",
|
||||
"diff": "^8.0.2",
|
||||
"esbuild": "^0.27.0",
|
||||
"eslint": "9.39.1",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-path-alias": "2.1.0",
|
||||
"eslint-plugin-react": "^7.37.3",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-simple-header": "^1.2.1",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"highlight.js": "11.7.0",
|
||||
"eslint-plugin-unused-imports": "^4.3.0",
|
||||
"highlight.js": "11.11.1",
|
||||
"html-minifier-terser": "^7.2.0",
|
||||
"moment": "^2.22.2",
|
||||
"puppeteer-core": "^23.11.1",
|
||||
"standalone-electron-types": "^1.0.0",
|
||||
"stylelint": "^16.12.0",
|
||||
"stylelint-config-standard": "^36.0.1",
|
||||
"p-limit": "^7.3.0",
|
||||
"puppeteer-core": "^24.30.0",
|
||||
"standalone-electron-types": "^34.2.0",
|
||||
"stylelint": "^16.25.0",
|
||||
"stylelint-config-standard": "^39.0.1",
|
||||
"svgo": "^4.0.0",
|
||||
"ts-patch": "^3.3.0",
|
||||
"ts-pattern": "^5.6.0",
|
||||
"tsx": "^4.19.2",
|
||||
"type-fest": "^4.31.0",
|
||||
"typescript": "^5.7.2",
|
||||
"typescript-eslint": "^8.19.0",
|
||||
"typescript-transform-paths": "^3.5.3",
|
||||
"tsx": "^4.20.6",
|
||||
"type-fest": "^5.2.0",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.47.0",
|
||||
"typescript-transform-paths": "^3.5.5",
|
||||
"zip-local": "^0.3.5"
|
||||
},
|
||||
"packageManager": "pnpm@9.1.0",
|
||||
"packageManager": "pnpm@10.4.1",
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"eslint@9.17.0": "patches/eslint@9.17.0.patch",
|
||||
"eslint-plugin-path-alias@2.1.0": "patches/eslint-plugin-path-alias@2.1.0.patch"
|
||||
},
|
||||
"peerDependencyRules": {
|
||||
|
|
@ -96,18 +95,14 @@
|
|||
"source-map-resolve": "*",
|
||||
"resolve-url": "*",
|
||||
"source-map-url": "*",
|
||||
"urix": "*"
|
||||
}
|
||||
},
|
||||
"webExt": {
|
||||
"artifactsDir": "./dist",
|
||||
"build": {
|
||||
"overwriteDest": true
|
||||
"urix": "*",
|
||||
"q": "*"
|
||||
},
|
||||
"sourceDir": "./dist/firefox-unpacked"
|
||||
"onlyBuiltDependencies": [
|
||||
"esbuild"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18",
|
||||
"pnpm": ">=9"
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
packages/discord-types/.npmignore
Normal file
1
packages/discord-types/.npmignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
||||
1
packages/discord-types/CONTRIBUTING.md
Normal file
1
packages/discord-types/CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Hint: https://docs.discord.food is an incredible resource and allows you to copy paste complete enums and interfaces
|
||||
165
packages/discord-types/LICENSE
Normal file
165
packages/discord-types/LICENSE
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
42
packages/discord-types/README.md
Normal file
42
packages/discord-types/README.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Discord Types
|
||||
|
||||
This package provides TypeScript types for the Webpack modules of Discord's web app.
|
||||
|
||||
While it was primarily created for Vencord, other client mods could also benefit from this, so it is published as a standalone package!
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install -D @vencord/discord-types
|
||||
yarn add -D @vencord/discord-types
|
||||
pnpm add -D @vencord/discord-types
|
||||
```
|
||||
|
||||
## Example Usage
|
||||
|
||||
```ts
|
||||
import type { UserStore } from "@vencord/discord-types";
|
||||
|
||||
const userStore: UserStore = findStore("UserStore"); // findStore is up to you to implement, this library only provides types and no runtime code
|
||||
```
|
||||
|
||||
## Enums
|
||||
|
||||
This library also exports some const enums that you can use from Typescript code:
|
||||
```ts
|
||||
import { ApplicationCommandType } from "@vencord/discord-types/enums";
|
||||
|
||||
console.log(ApplicationCommandType.CHAT_INPUT); // 1
|
||||
```
|
||||
|
||||
### License
|
||||
|
||||
This package is licensed under the [LGPL-3.0](./LICENSE) (or later) license.
|
||||
|
||||
A very short summary of the license is that you can use this package as a library in both open source and closed source projects,
|
||||
similar to an MIT-licensed project.
|
||||
However, if you modify the code of this package, you must release source code of your modified version under the same license.
|
||||
|
||||
### Credit
|
||||
|
||||
This package was inspired by Swishilicous' [discord-types](https://www.npmjs.com/package/discord-types) package.
|
||||
30
packages/discord-types/enums/activity.ts
Normal file
30
packages/discord-types/enums/activity.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
export const enum ActivityType {
|
||||
PLAYING = 0,
|
||||
STREAMING = 1,
|
||||
LISTENING = 2,
|
||||
WATCHING = 3,
|
||||
CUSTOM_STATUS = 4,
|
||||
COMPETING = 5,
|
||||
HANG_STATUS = 6
|
||||
}
|
||||
|
||||
export const enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
JOIN = 1 << 1,
|
||||
/** @deprecated */
|
||||
SPECTATE = 1 << 2,
|
||||
/** @deprecated */
|
||||
JOIN_REQUEST = 1 << 3,
|
||||
SYNC = 1 << 4,
|
||||
PLAY = 1 << 5,
|
||||
PARTY_PRIVACY_FRIENDS = 1 << 6,
|
||||
PARTY_PRIVACY_VOICE_CHANNEL = 1 << 7,
|
||||
EMBEDDED = 1 << 8,
|
||||
CONTEXTLESS = 1 << 9
|
||||
}
|
||||
|
||||
export const enum ActivityStatusDisplayType {
|
||||
NAME = 0,
|
||||
STATE = 1,
|
||||
DETAILS = 2
|
||||
}
|
||||
15
packages/discord-types/enums/channel.ts
Normal file
15
packages/discord-types/enums/channel.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export const enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
DM = 1,
|
||||
GUILD_VOICE = 2,
|
||||
GROUP_DM = 3,
|
||||
GUILD_CATEGORY = 4,
|
||||
GUILD_ANNOUNCEMENT = 5,
|
||||
ANNOUNCEMENT_THREAD = 10,
|
||||
PUBLIC_THREAD = 11,
|
||||
PRIVATE_THREAD = 12,
|
||||
GUILD_STAGE_VOICE = 13,
|
||||
GUILD_DIRECTORY = 14,
|
||||
GUILD_FORUM = 15,
|
||||
GUILD_MEDIA = 16
|
||||
}
|
||||
32
packages/discord-types/enums/commands.ts
Normal file
32
packages/discord-types/enums/commands.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export const enum ApplicationCommandOptionType {
|
||||
SUB_COMMAND = 1,
|
||||
SUB_COMMAND_GROUP = 2,
|
||||
STRING = 3,
|
||||
INTEGER = 4,
|
||||
BOOLEAN = 5,
|
||||
USER = 6,
|
||||
CHANNEL = 7,
|
||||
ROLE = 8,
|
||||
MENTIONABLE = 9,
|
||||
NUMBER = 10,
|
||||
ATTACHMENT = 11,
|
||||
}
|
||||
|
||||
export const enum ApplicationCommandInputType {
|
||||
BUILT_IN = 0,
|
||||
BUILT_IN_TEXT = 1,
|
||||
BUILT_IN_INTEGRATION = 2,
|
||||
BOT = 3,
|
||||
PLACEHOLDER = 4,
|
||||
}
|
||||
|
||||
export const enum ApplicationCommandType {
|
||||
CHAT_INPUT = 1,
|
||||
USER = 2,
|
||||
MESSAGE = 3,
|
||||
}
|
||||
|
||||
export const enum ApplicationIntegrationType {
|
||||
GUILD_INSTALL = 0,
|
||||
USER_INSTALL = 1
|
||||
}
|
||||
6
packages/discord-types/enums/index.ts
Normal file
6
packages/discord-types/enums/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export * from "./activity";
|
||||
export * from "./channel";
|
||||
export * from "./commands";
|
||||
export * from "./messages";
|
||||
export * from "./misc";
|
||||
export * from "./user";
|
||||
596
packages/discord-types/enums/messages.ts
Normal file
596
packages/discord-types/enums/messages.ts
Normal file
|
|
@ -0,0 +1,596 @@
|
|||
export const enum StickerType {
|
||||
/** an official sticker in a pack */
|
||||
STANDARD = 1,
|
||||
/** a sticker uploaded to a guild for the guild's members */
|
||||
GUILD = 2
|
||||
}
|
||||
|
||||
export const enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG = 2,
|
||||
LOTTIE = 3,
|
||||
GIF = 4
|
||||
}
|
||||
|
||||
export const enum MessageType {
|
||||
/**
|
||||
* A default message (see below)
|
||||
*
|
||||
* Value: 0
|
||||
* Name: DEFAULT
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
DEFAULT = 0,
|
||||
/**
|
||||
* A message sent when a user is added to a group DM or thread
|
||||
*
|
||||
* Value: 1
|
||||
* Name: RECIPIENT_ADD
|
||||
* Rendered Content: "{author} added {mentions [0] } to the {group/thread}."
|
||||
* Deletable: false
|
||||
*/
|
||||
RECIPIENT_ADD = 1,
|
||||
/**
|
||||
* A message sent when a user is removed from a group DM or thread
|
||||
*
|
||||
* Value: 2
|
||||
* Name: RECIPIENT_REMOVE
|
||||
* Rendered Content: "{author} removed {mentions [0] } from the {group/thread}."
|
||||
* Deletable: false
|
||||
*/
|
||||
RECIPIENT_REMOVE = 2,
|
||||
/**
|
||||
* A message sent when a user creates a call in a private channel
|
||||
*
|
||||
* Value: 3
|
||||
* Name: CALL
|
||||
* Rendered Content: participated ? "{author} started a call{ended ? " that lasted {duration}" : " — Join the call"}." : "You missed a call from {author} that lasted {duration}."
|
||||
* Deletable: false
|
||||
*/
|
||||
CALL = 3,
|
||||
/**
|
||||
* A message sent when a group DM or thread's name is changed
|
||||
*
|
||||
* Value: 4
|
||||
* Name: CHANNEL_NAME_CHANGE
|
||||
* Rendered Content: "{author} changed the {is_forum ? "post title" : "channel name"}: {content} "
|
||||
* Deletable: false
|
||||
*/
|
||||
CHANNEL_NAME_CHANGE = 4,
|
||||
/**
|
||||
* A message sent when a group DM's icon is changed
|
||||
*
|
||||
* Value: 5
|
||||
* Name: CHANNEL_ICON_CHANGE
|
||||
* Rendered Content: "{author} changed the channel icon."
|
||||
* Deletable: false
|
||||
*/
|
||||
CHANNEL_ICON_CHANGE = 5,
|
||||
/**
|
||||
* A message sent when a message is pinned in a channel
|
||||
*
|
||||
* Value: 6
|
||||
* Name: CHANNEL_PINNED_MESSAGE
|
||||
* Rendered Content: "{author} pinned a message to this channel."
|
||||
* Deletable: true
|
||||
*/
|
||||
CHANNEL_PINNED_MESSAGE = 6,
|
||||
/**
|
||||
* A message sent when a user joins a guild
|
||||
*
|
||||
* Value: 7
|
||||
* Name: USER_JOIN
|
||||
* Rendered Content: See user join message type , obtained via the formula timestamp_ms % 13
|
||||
* Deletable: true
|
||||
*/
|
||||
USER_JOIN = 7,
|
||||
/**
|
||||
* A message sent when a user subscribes to (boosts) a guild
|
||||
*
|
||||
* Value: 8
|
||||
* Name: PREMIUM_GUILD_SUBSCRIPTION
|
||||
* Rendered Content: "{author} just boosted the server{content ? " {content} times"}!"
|
||||
* Deletable: true
|
||||
*/
|
||||
PREMIUM_GUILD_SUBSCRIPTION = 8,
|
||||
/**
|
||||
* A message sent when a user subscribes to (boosts) a guild to tier 1
|
||||
*
|
||||
* Value: 9
|
||||
* Name: PREMIUM_GUILD_SUBSCRIPTION_TIER_1
|
||||
* Rendered Content: "{author} just boosted the server{content ? " {content} times"}! {guild} has achieved Level 1! "
|
||||
* Deletable: true
|
||||
*/
|
||||
PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9,
|
||||
/**
|
||||
* A message sent when a user subscribes to (boosts) a guild to tier 2
|
||||
*
|
||||
* Value: 10
|
||||
* Name: PREMIUM_GUILD_SUBSCRIPTION_TIER_2
|
||||
* Rendered Content: "{author} just boosted the server{content ? " {content} times"}! {guild} has achieved Level 2! "
|
||||
* Deletable: true
|
||||
*/
|
||||
PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10,
|
||||
/**
|
||||
* A message sent when a user subscribes to (boosts) a guild to tier 3
|
||||
*
|
||||
* Value: 11
|
||||
* Name: PREMIUM_GUILD_SUBSCRIPTION_TIER_3
|
||||
* Rendered Content: "{author} just boosted the server{content ? " {content} times"}! {guild} has achieved Level 3! "
|
||||
* Deletable: true
|
||||
*/
|
||||
PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11,
|
||||
/**
|
||||
* A message sent when a news channel is followed
|
||||
*
|
||||
* Value: 12
|
||||
* Name: CHANNEL_FOLLOW_ADD
|
||||
* Rendered Content: "{author} has added {content} to this channel. Its most important updates will show up here."
|
||||
* Deletable: true
|
||||
*/
|
||||
CHANNEL_FOLLOW_ADD = 12,
|
||||
/**
|
||||
* A message sent when a guild is disqualified from discovery
|
||||
*
|
||||
* Value: 14
|
||||
* Name: GUILD_DISCOVERY_DISQUALIFIED
|
||||
* Rendered Content: "This server has been removed from Server Discovery because it no longer passes all the requirements. Check Server Settings for more details."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
/**
|
||||
* A message sent when a guild requalifies for discovery
|
||||
*
|
||||
* Value: 15
|
||||
* Name: GUILD_DISCOVERY_REQUALIFIED
|
||||
* Rendered Content: "This server is eligible for Server Discovery again and has been automatically relisted!"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_DISCOVERY_REQUALIFIED = 15,
|
||||
/**
|
||||
* A message sent when a guild has failed discovery requirements for a week
|
||||
*
|
||||
* Value: 16
|
||||
* Name: GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING
|
||||
* Rendered Content: "This server has failed Discovery activity requirements for 1 week. If this server fails for 4 weeks in a row, it will be automatically removed from Discovery."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16,
|
||||
/**
|
||||
* A message sent when a guild has failed discovery requirements for 3 weeks
|
||||
*
|
||||
* Value: 17
|
||||
* Name: GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING
|
||||
* Rendered Content: "This server has failed Discovery activity requirements for 3 weeks in a row. If this server fails for 1 more week, it will be removed from Discovery."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING = 17,
|
||||
/**
|
||||
* A message sent when a thread is created
|
||||
*
|
||||
* Value: 18
|
||||
* Name: THREAD_CREATED
|
||||
* Rendered Content: "{author} started a thread: {content} . See all threads."
|
||||
* Deletable: true
|
||||
*/
|
||||
THREAD_CREATED = 18,
|
||||
/**
|
||||
* A message sent when a user replies to a message
|
||||
*
|
||||
* Value: 19
|
||||
* Name: REPLY
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPLY = 19,
|
||||
/**
|
||||
* A message sent when a user uses a slash command
|
||||
*
|
||||
* Value: 20
|
||||
* Name: CHAT_INPUT_COMMAND
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
CHAT_INPUT_COMMAND = 20,
|
||||
/**
|
||||
* A message sent when a thread starter message is added to a thread
|
||||
*
|
||||
* Value: 21
|
||||
* Name: THREAD_STARTER_MESSAGE
|
||||
* Rendered Content: "{referenced_message?.content}" ?? "Sorry, we couldn't load the first message in this thread"
|
||||
* Deletable: false
|
||||
*/
|
||||
THREAD_STARTER_MESSAGE = 21,
|
||||
/**
|
||||
* A message sent to remind users to invite friends to a guild
|
||||
*
|
||||
* Value: 22
|
||||
* Name: GUILD_INVITE_REMINDER
|
||||
* Rendered Content: "Wondering who to invite?\nStart by inviting anyone who can help you build the server!"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_INVITE_REMINDER = 22,
|
||||
/**
|
||||
* A message sent when a user uses a context menu command
|
||||
*
|
||||
* Value: 23
|
||||
* Name: CONTEXT_MENU_COMMAND
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
CONTEXT_MENU_COMMAND = 23,
|
||||
/**
|
||||
* A message sent when auto moderation takes an action
|
||||
*
|
||||
* Value: 24
|
||||
* Name: AUTO_MODERATION_ACTION
|
||||
* Rendered Content: Special embed rendered from embeds[0]
|
||||
* Deletable: true 1
|
||||
*/
|
||||
AUTO_MODERATION_ACTION = 24,
|
||||
/**
|
||||
* A message sent when a user purchases or renews a role subscription
|
||||
*
|
||||
* Value: 25
|
||||
* Name: ROLE_SUBSCRIPTION_PURCHASE
|
||||
* Rendered Content: "{author} {is_renewal ? "renewed" : "joined"} {role_subscription.tier_name} and has been a subscriber of {guild} for {role_subscription.total_months_subscribed} month(?s)!"
|
||||
* Deletable: true
|
||||
*/
|
||||
ROLE_SUBSCRIPTION_PURCHASE = 25,
|
||||
/**
|
||||
* A message sent when a user is upsold to a premium interaction
|
||||
*
|
||||
* Value: 26
|
||||
* Name: INTERACTION_PREMIUM_UPSELL
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
INTERACTION_PREMIUM_UPSELL = 26,
|
||||
/**
|
||||
* A message sent when a stage channel starts
|
||||
*
|
||||
* Value: 27
|
||||
* Name: STAGE_START
|
||||
* Rendered Content: "{author} started {content} "
|
||||
* Deletable: true
|
||||
*/
|
||||
STAGE_START = 27,
|
||||
/**
|
||||
* A message sent when a stage channel ends
|
||||
*
|
||||
* Value: 28
|
||||
* Name: STAGE_END
|
||||
* Rendered Content: "{author} ended {content} "
|
||||
* Deletable: true
|
||||
*/
|
||||
STAGE_END = 28,
|
||||
/**
|
||||
* A message sent when a user starts speaking in a stage channel
|
||||
*
|
||||
* Value: 29
|
||||
* Name: STAGE_SPEAKER
|
||||
* Rendered Content: "{author} is now a speaker."
|
||||
* Deletable: true
|
||||
*/
|
||||
STAGE_SPEAKER = 29,
|
||||
/**
|
||||
* A message sent when a user raises their hand in a stage channel
|
||||
*
|
||||
* Value: 30
|
||||
* Name: STAGE_RAISE_HAND
|
||||
* Rendered Content: "{author} requested to speak."
|
||||
* Deletable: true
|
||||
*/
|
||||
STAGE_RAISE_HAND = 30,
|
||||
/**
|
||||
* A message sent when a stage channel's topic is changed
|
||||
*
|
||||
* Value: 31
|
||||
* Name: STAGE_TOPIC
|
||||
* Rendered Content: "{author} changed the Stage topic: {content} "
|
||||
* Deletable: true
|
||||
*/
|
||||
STAGE_TOPIC = 31,
|
||||
/**
|
||||
* A message sent when a user purchases an application premium subscription
|
||||
*
|
||||
* Value: 32
|
||||
* Name: GUILD_APPLICATION_PREMIUM_SUBSCRIPTION
|
||||
* Rendered Content: "{author} upgraded {application ?? "a deleted application"} to premium for this server!"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_APPLICATION_PREMIUM_SUBSCRIPTION = 32,
|
||||
/**
|
||||
* A message sent when a user gifts a premium (Nitro) referral
|
||||
*
|
||||
* Value: 35
|
||||
* Name: PREMIUM_REFERRAL
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
PREMIUM_REFERRAL = 35,
|
||||
/**
|
||||
* A message sent when a user enabled lockdown for the guild
|
||||
*
|
||||
* Value: 36
|
||||
* Name: GUILD_INCIDENT_ALERT_MODE_ENABLED
|
||||
* Rendered Content: "{author} enabled security actions until {content}."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_INCIDENT_ALERT_MODE_ENABLED = 36,
|
||||
/**
|
||||
* A message sent when a user disables lockdown for the guild
|
||||
*
|
||||
* Value: 37
|
||||
* Name: GUILD_INCIDENT_ALERT_MODE_DISABLED
|
||||
* Rendered Content: "{author} disabled security actions."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_INCIDENT_ALERT_MODE_DISABLED = 37,
|
||||
/**
|
||||
* A message sent when a user reports a raid for the guild
|
||||
*
|
||||
* Value: 38
|
||||
* Name: GUILD_INCIDENT_REPORT_RAID
|
||||
* Rendered Content: "{author} reported a raid in {guild}."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_INCIDENT_REPORT_RAID = 38,
|
||||
/**
|
||||
* A message sent when a user reports a false alarm for the guild
|
||||
*
|
||||
* Value: 39
|
||||
* Name: GUILD_INCIDENT_REPORT_FALSE_ALARM
|
||||
* Rendered Content: "{author} reported a false alarm in {guild}."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_INCIDENT_REPORT_FALSE_ALARM = 39,
|
||||
/**
|
||||
* A message sent when no one sends a message in the current channel for 1 hour
|
||||
*
|
||||
* Value: 40
|
||||
* Name: GUILD_DEADCHAT_REVIVE_PROMPT
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_DEADCHAT_REVIVE_PROMPT = 40,
|
||||
/**
|
||||
* A message sent when a user buys another user a gift
|
||||
*
|
||||
* Value: 41
|
||||
* Name: CUSTOM_GIFT
|
||||
* Rendered Content: Special embed rendered from embeds[0].url and gift_info
|
||||
* Deletable: true
|
||||
*/
|
||||
CUSTOM_GIFT = 41,
|
||||
/**
|
||||
* Value: 42
|
||||
* Name: GUILD_GAMING_STATS_PROMPT
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_GAMING_STATS_PROMPT = 42,
|
||||
/**
|
||||
* A message sent when a user purchases a guild product
|
||||
*
|
||||
* Value: 44
|
||||
* Name: PURCHASE_NOTIFICATION
|
||||
* Rendered Content: "{author} has purchased {purchase_notification.guild_product_purchase.product_name}!"
|
||||
* Deletable: true
|
||||
*/
|
||||
PURCHASE_NOTIFICATION = 44,
|
||||
/**
|
||||
* A message sent when a poll is finalized
|
||||
*
|
||||
* Value: 46
|
||||
* Name: POLL_RESULT
|
||||
* Rendered Content: Special embed rendered from embeds[0]
|
||||
* Deletable: true
|
||||
*/
|
||||
POLL_RESULT = 46,
|
||||
/**
|
||||
* A message sent by the Discord Updates account when a new changelog is posted
|
||||
*
|
||||
* Value: 47
|
||||
* Name: CHANGELOG
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
CHANGELOG = 47,
|
||||
/**
|
||||
* A message sent when a Nitro promotion is triggered
|
||||
*
|
||||
* Value: 48
|
||||
* Name: NITRO_NOTIFICATION
|
||||
* Rendered Content: Special embed rendered from content
|
||||
* Deletable: true
|
||||
*/
|
||||
NITRO_NOTIFICATION = 48,
|
||||
/**
|
||||
* A message sent when a voice channel is linked to a lobby
|
||||
*
|
||||
* Value: 49
|
||||
* Name: CHANNEL_LINKED_TO_LOBBY
|
||||
* Rendered Content: "{content}"
|
||||
* Deletable: true
|
||||
*/
|
||||
CHANNEL_LINKED_TO_LOBBY = 49,
|
||||
/**
|
||||
* A local-only ephemeral message sent when a user is prompted to gift Nitro to a friend on their friendship anniversary
|
||||
*
|
||||
* Value: 50
|
||||
* Name: GIFTING_PROMPT
|
||||
* Rendered Content: Special embed
|
||||
* Deletable: true
|
||||
*/
|
||||
GIFTING_PROMPT = 50,
|
||||
/**
|
||||
* A local-only message sent when a user receives an in-game message NUX
|
||||
*
|
||||
* Value: 51
|
||||
* Name: IN_GAME_MESSAGE_NUX
|
||||
* Rendered Content: "{author} messaged you from {application.name}. In-game chat may not include rich messaging features such as images, polls, or apps. Learn More "
|
||||
* Deletable: true
|
||||
*/
|
||||
IN_GAME_MESSAGE_NUX = 51,
|
||||
/**
|
||||
* A message sent when a user accepts a guild join request
|
||||
*
|
||||
* Value: 52
|
||||
* Name: GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION 2
|
||||
* Rendered Content: "{join_request.user}'s application to {content} was approved! Welcome!"
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION = 52,
|
||||
/**
|
||||
* A message sent when a user rejects a guild join request
|
||||
*
|
||||
* Value: 53
|
||||
* Name: GUILD_JOIN_REQUEST_REJECT_NOTIFICATION 2
|
||||
* Rendered Content: "{join_request.user}'s application to {content} was rejected."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_JOIN_REQUEST_REJECT_NOTIFICATION = 53,
|
||||
/**
|
||||
* A message sent when a user withdraws a guild join request
|
||||
*
|
||||
* Value: 54
|
||||
* Name: GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION 2
|
||||
* Rendered Content: "{join_request.user}'s application to {content} has been withdrawn."
|
||||
* Deletable: true
|
||||
*/
|
||||
GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION = 54,
|
||||
/**
|
||||
* A message sent when a user upgrades to HD streaming
|
||||
*
|
||||
* Value: 55
|
||||
* Name: HD_STREAMING_UPGRADED
|
||||
* Rendered Content: "{author} activated HD Splash Potion "
|
||||
* Deletable: true
|
||||
*/
|
||||
HD_STREAMING_UPGRADED = 55,
|
||||
/**
|
||||
* A message sent when a user resolves a moderation report by deleting the offending message
|
||||
*
|
||||
* Value: 58
|
||||
* Name: REPORT_TO_MOD_DELETED_MESSAGE
|
||||
* Rendered Content: "{author} deleted the message"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPORT_TO_MOD_DELETED_MESSAGE = 58,
|
||||
/**
|
||||
* A message sent when a user resolves a moderation report by timing out the offending user
|
||||
*
|
||||
* Value: 59
|
||||
* Name: REPORT_TO_MOD_TIMEOUT_USER
|
||||
* Rendered Content: "{author} timed out {mentions [0] }"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPORT_TO_MOD_TIMEOUT_USER = 59,
|
||||
/**
|
||||
* A message sent when a user resolves a moderation report by kicking the offending user
|
||||
*
|
||||
* Value: 60
|
||||
* Name: REPORT_TO_MOD_KICK_USER
|
||||
* Rendered Content: "{author} kicked {mentions [0] }"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPORT_TO_MOD_KICK_USER = 60,
|
||||
/**
|
||||
* A message sent when a user resolves a moderation report by banning the offending user
|
||||
*
|
||||
* Value: 61
|
||||
* Name: REPORT_TO_MOD_BAN_USER
|
||||
* Rendered Content: "{author} banned {mentions [0] }"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPORT_TO_MOD_BAN_USER = 61,
|
||||
/**
|
||||
* A message sent when a user resolves a moderation report
|
||||
*
|
||||
* Value: 62
|
||||
* Name: REPORT_TO_MOD_CLOSED_REPORT
|
||||
* Rendered Content: "{author} resolved this flag"
|
||||
* Deletable: true
|
||||
*/
|
||||
REPORT_TO_MOD_CLOSED_REPORT = 62,
|
||||
/**
|
||||
* A message sent when a user adds a new emoji to a guild
|
||||
*
|
||||
* Value: 63
|
||||
* Name: EMOJI_ADDED
|
||||
* Rendered Content: "{author} added a new emoji, {content} :{emoji.name}: "
|
||||
* Deletable: true
|
||||
*/
|
||||
EMOJI_ADDED = 63,
|
||||
}
|
||||
|
||||
export const enum MessageFlags {
|
||||
/**
|
||||
* Message has been published to subscribed channels (via Channel Following)
|
||||
*
|
||||
* Value: 1 << 0
|
||||
*/
|
||||
CROSSPOSTED = 1 << 0,
|
||||
/**
|
||||
* Message originated from a message in another channel (via Channel Following)
|
||||
*/
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
/**
|
||||
* Embeds will not be included when serializing this message
|
||||
*/
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
/**
|
||||
* Source message for this crosspost has been deleted (via Channel Following)
|
||||
*/
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
/**
|
||||
* Message came from the urgent message system
|
||||
*/
|
||||
URGENT = 1 << 4,
|
||||
/**
|
||||
* Message has an associated thread, with the same ID as the message
|
||||
*/
|
||||
HAS_THREAD = 1 << 5,
|
||||
/**
|
||||
* Message is only visible to the user who invoked the interaction
|
||||
*/
|
||||
EPHEMERAL = 1 << 6,
|
||||
/**
|
||||
* Message is an interaction response and the bot is "thinking"
|
||||
*/
|
||||
LOADING = 1 << 7,
|
||||
/**
|
||||
* Some roles were not mentioned and added to the thread
|
||||
*/
|
||||
FAILED_TO_MENTION_SOME_ROLES_IN_THREAD = 1 << 8,
|
||||
/**
|
||||
* Message is hidden from the guild's feed
|
||||
*/
|
||||
GUILD_FEED_HIDDEN = 1 << 9,
|
||||
/**
|
||||
* Message contains a link that impersonates Discord
|
||||
*/
|
||||
SHOULD_SHOW_LINK_NOT_DISCORD_WARNING = 1 << 10,
|
||||
/**
|
||||
* Message will not trigger push and desktop notifications
|
||||
*/
|
||||
SUPPRESS_NOTIFICATIONS = 1 << 12,
|
||||
/**
|
||||
* Message's audio attachment is rendered as a voice message
|
||||
*/
|
||||
IS_VOICE_MESSAGE = 1 << 13,
|
||||
/**
|
||||
* Message has a forwarded message snapshot attached
|
||||
*/
|
||||
HAS_SNAPSHOT = 1 << 14,
|
||||
/**
|
||||
* Message contains components from version 2 of the UI kit
|
||||
*/
|
||||
IS_COMPONENTS_V2 = 1 << 15,
|
||||
/**
|
||||
* Message was triggered by the social layer integration
|
||||
*/
|
||||
SENT_BY_SOCIAL_LAYER_INTEGRATION = 1 << 16,
|
||||
}
|
||||
103
packages/discord-types/enums/misc.ts
Normal file
103
packages/discord-types/enums/misc.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
export const enum CloudUploadPlatform {
|
||||
REACT_NATIVE = 0,
|
||||
WEB = 1,
|
||||
}
|
||||
|
||||
export const enum DraftType {
|
||||
ChannelMessage = 0,
|
||||
ThreadSettings = 1,
|
||||
FirstThreadMessage = 2,
|
||||
ApplicationLauncherCommand = 3,
|
||||
Poll = 4,
|
||||
SlashCommand = 5,
|
||||
ForwardContextMessage = 6,
|
||||
}
|
||||
|
||||
export const enum GuildScheduledEventStatus {
|
||||
SCHEDULED = 1,
|
||||
ACTIVE = 2,
|
||||
COMPLETED = 3,
|
||||
CANCELED = 4,
|
||||
}
|
||||
|
||||
export const enum GuildScheduledEventEntityType {
|
||||
STAGE_INSTANCE = 1,
|
||||
VOICE = 2,
|
||||
EXTERNAL = 3,
|
||||
}
|
||||
|
||||
export const enum GuildScheduledEventPrivacyLevel {
|
||||
GUILD_ONLY = 2,
|
||||
}
|
||||
|
||||
export const enum ParticipantType {
|
||||
STREAM = 0,
|
||||
HIDDEN_STREAM = 1,
|
||||
USER = 2,
|
||||
ACTIVITY = 3,
|
||||
}
|
||||
|
||||
export const enum RTCPlatform {
|
||||
DESKTOP = 0,
|
||||
MOBILE = 1,
|
||||
XBOX = 2,
|
||||
PLAYSTATION = 3,
|
||||
}
|
||||
|
||||
export const enum VideoSourceType {
|
||||
VIDEO = 0,
|
||||
CAMERA_PREVIEW = 1,
|
||||
}
|
||||
|
||||
export const enum EmojiIntention {
|
||||
REACTION = 0,
|
||||
STATUS = 1,
|
||||
COMMUNITY_CONTENT = 2,
|
||||
CHAT = 3,
|
||||
GUILD_STICKER_RELATED_EMOJI = 4,
|
||||
GUILD_ROLE_BENEFIT_EMOJI = 5,
|
||||
SOUNDBOARD = 6,
|
||||
VOICE_CHANNEL_TOPIC = 7,
|
||||
GIFT = 8,
|
||||
AUTO_SUGGESTION = 9,
|
||||
POLLS = 10,
|
||||
PROFILE = 11,
|
||||
MESSAGE_CONFETTI = 12,
|
||||
GUILD_PROFILE = 13,
|
||||
CHANNEL_NAME = 14,
|
||||
DEFAULT_REACT_EMOJI = 15,
|
||||
}
|
||||
|
||||
export const enum LoadState {
|
||||
NOT_LOADED = 0,
|
||||
LOADING = 1,
|
||||
LOADED = 2,
|
||||
ERROR = 3,
|
||||
}
|
||||
|
||||
export const enum ConnectionStatsFlags {
|
||||
TRANSPORT = 1,
|
||||
OUTBOUND = 2,
|
||||
INBOUND = 4,
|
||||
ALL = 7,
|
||||
}
|
||||
|
||||
export const enum SpeakingFlags {
|
||||
NONE = 0,
|
||||
VOICE = 1,
|
||||
SOUNDSHARE = 2,
|
||||
PRIORITY = 4,
|
||||
HIDDEN = 8,
|
||||
}
|
||||
|
||||
export const enum GoLiveQualityMode {
|
||||
AUTO = 1,
|
||||
FULL = 2,
|
||||
}
|
||||
|
||||
export const enum VoiceProcessingStateReason {
|
||||
CPU_OVERUSE = 1,
|
||||
FAILED = 2,
|
||||
VAD_CPU_OVERUSE = 3,
|
||||
INITIALIZED = 4,
|
||||
}
|
||||
22
packages/discord-types/enums/user.ts
Normal file
22
packages/discord-types/enums/user.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
export const enum RelationshipType {
|
||||
NONE = 0,
|
||||
FRIEND = 1,
|
||||
BLOCKED = 2,
|
||||
INCOMING_REQUEST = 3,
|
||||
OUTGOING_REQUEST = 4,
|
||||
IMPLICIT = 5,
|
||||
SUGGESTION = 6
|
||||
}
|
||||
|
||||
export enum GiftIntentType {
|
||||
FRIEND_ANNIVERSARY = 0
|
||||
}
|
||||
|
||||
export const enum ReadStateType {
|
||||
CHANNEL = 0,
|
||||
GUILD_EVENT = 1,
|
||||
NOTIFICATION_CENTER = 2,
|
||||
GUILD_HOME = 3,
|
||||
GUILD_ONBOARDING_QUESTION = 4,
|
||||
MESSAGE_REQUESTS = 5,
|
||||
}
|
||||
22
packages/discord-types/package.json
Normal file
22
packages/discord-types/package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "@vencord/discord-types",
|
||||
"author": "Vencord Contributors",
|
||||
"private": false,
|
||||
"description": "Typescript definitions for the webpack modules of the Discord Web app",
|
||||
"version": "1.0.0",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"types": "src/index.d.ts",
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Vendicated/Vencord.git",
|
||||
"directory": "packages/discord-types"
|
||||
},
|
||||
"dependencies": {
|
||||
"moment": "^2.22.2",
|
||||
"type-fest": "^4.41.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.0.10"
|
||||
}
|
||||
}
|
||||
43
packages/discord-types/src/common/Activity.d.ts
vendored
Normal file
43
packages/discord-types/src/common/Activity.d.ts
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { ActivityFlags, ActivityStatusDisplayType, ActivityType } from "../../enums";
|
||||
|
||||
export interface ActivityAssets {
|
||||
large_image?: string;
|
||||
large_text?: string;
|
||||
large_url?: string;
|
||||
small_image?: string;
|
||||
small_text?: string;
|
||||
small_url?: string;
|
||||
}
|
||||
|
||||
export interface ActivityButton {
|
||||
label: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface Activity {
|
||||
name: string;
|
||||
application_id: string;
|
||||
type: ActivityType;
|
||||
state?: string;
|
||||
state_url?: string;
|
||||
details?: string;
|
||||
details_url?: string;
|
||||
url?: string;
|
||||
flags: ActivityFlags;
|
||||
status_display_type?: ActivityStatusDisplayType;
|
||||
timestamps?: {
|
||||
start?: number;
|
||||
end?: number;
|
||||
};
|
||||
assets?: ActivityAssets;
|
||||
buttons?: string[];
|
||||
metadata?: {
|
||||
button_urls?: Array<string>;
|
||||
};
|
||||
party?: {
|
||||
id?: string;
|
||||
size?: [number, number];
|
||||
};
|
||||
}
|
||||
|
||||
export type OnlineStatus = "online" | "idle" | "dnd" | "invisible" | "offline" | "unknown" | "streaming";
|
||||
89
packages/discord-types/src/common/Application.d.ts
vendored
Normal file
89
packages/discord-types/src/common/Application.d.ts
vendored
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import { Guild } from "./Guild";
|
||||
import { User } from "./User";
|
||||
|
||||
export interface ApplicationExecutable {
|
||||
os: "win32" | "darwin" | "linux";
|
||||
name: string;
|
||||
isLauncher: boolean;
|
||||
}
|
||||
|
||||
export interface ApplicationThirdPartySku {
|
||||
id: string;
|
||||
sku: string;
|
||||
distributor: string;
|
||||
}
|
||||
|
||||
export interface ApplicationDeveloper {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ApplicationInstallParams {
|
||||
permissions: string | null;
|
||||
scopes: string[];
|
||||
}
|
||||
|
||||
export interface Application {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
type: number | null;
|
||||
coverImage: string | null;
|
||||
primarySkuId: string | undefined;
|
||||
bot: User | null;
|
||||
splash: string | undefined;
|
||||
thirdPartySkus: ApplicationThirdPartySku[];
|
||||
isMonetized: boolean;
|
||||
isVerified: boolean;
|
||||
roleConnectionsVerificationUrl: string | undefined;
|
||||
parentId: string | undefined;
|
||||
connectionEntrypointUrl: string | undefined;
|
||||
overlay: boolean;
|
||||
overlayWarn: boolean;
|
||||
overlayCompatibilityHook: boolean;
|
||||
overlayMethods: number;
|
||||
hook: boolean;
|
||||
aliases: string[];
|
||||
publishers: ApplicationDeveloper[];
|
||||
developers: ApplicationDeveloper[];
|
||||
storeListingSkuId: string | undefined;
|
||||
guildId: string | null;
|
||||
guild: Guild | undefined;
|
||||
executables: ApplicationExecutable[];
|
||||
hashes: string[];
|
||||
eulaId: string | undefined;
|
||||
slug: string | undefined;
|
||||
flags: number;
|
||||
maxParticipants: number | undefined;
|
||||
tags: string[];
|
||||
embeddedActivityConfig: Record<string, unknown> | undefined;
|
||||
team: ApplicationTeam | undefined;
|
||||
integrationTypesConfig: Record<string, Record<string, unknown>>;
|
||||
storefront_available: boolean;
|
||||
termsOfServiceUrl: string | undefined;
|
||||
privacyPolicyUrl: string | undefined;
|
||||
isDiscoverable: boolean;
|
||||
customInstallUrl: string | undefined;
|
||||
installParams: ApplicationInstallParams | undefined;
|
||||
directoryEntry: Record<string, unknown> | undefined;
|
||||
categories: string[] | undefined;
|
||||
linkedGames: string[] | undefined;
|
||||
deepLinkUri: string | undefined;
|
||||
}
|
||||
|
||||
export interface ApplicationTeam {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
members: ApplicationTeamMember[];
|
||||
ownerUserId: string;
|
||||
}
|
||||
|
||||
export interface ApplicationTeamMember {
|
||||
user: User;
|
||||
teamId: string;
|
||||
membershipState: number;
|
||||
permissions: string[];
|
||||
role: string;
|
||||
}
|
||||
83
packages/discord-types/src/common/Channel.d.ts
vendored
Normal file
83
packages/discord-types/src/common/Channel.d.ts
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
import { DiscordRecord } from "./Record";
|
||||
|
||||
export class Channel extends DiscordRecord {
|
||||
constructor(channel: object);
|
||||
application_id: number | undefined;
|
||||
bitrate: number;
|
||||
defaultAutoArchiveDuration: number | undefined;
|
||||
flags: number;
|
||||
guild_id: string;
|
||||
icon: string;
|
||||
id: string;
|
||||
lastMessageId: string;
|
||||
lastPinTimestamp: string | undefined;
|
||||
member: unknown;
|
||||
memberCount: number | undefined;
|
||||
memberIdsPreview: string[] | undefined;
|
||||
memberListId: unknown;
|
||||
messageCount: number | undefined;
|
||||
name: string;
|
||||
nicks: Record<string, unknown>;
|
||||
nsfw: boolean;
|
||||
originChannelId: unknown;
|
||||
ownerId: string;
|
||||
parent_id: string;
|
||||
permissionOverwrites: {
|
||||
[role: string]: {
|
||||
id: string;
|
||||
type: number;
|
||||
deny: bigint;
|
||||
allow: bigint;
|
||||
};
|
||||
};
|
||||
position: number;
|
||||
rateLimitPerUser: number;
|
||||
rawRecipients: {
|
||||
id: string;
|
||||
avatar: string;
|
||||
username: string;
|
||||
public_flags: number;
|
||||
discriminator: string;
|
||||
}[];
|
||||
recipients: string[];
|
||||
rtcRegion: string;
|
||||
threadMetadata: {
|
||||
locked: boolean;
|
||||
archived: boolean;
|
||||
invitable: boolean;
|
||||
createTimestamp: string | undefined;
|
||||
autoArchiveDuration: number;
|
||||
archiveTimestamp: string | undefined;
|
||||
};
|
||||
topic: string;
|
||||
type: number;
|
||||
userLimit: number;
|
||||
videoQualityMode: undefined;
|
||||
|
||||
get accessPermissions(): bigint;
|
||||
get lastActiveTimestamp(): number;
|
||||
|
||||
computeLurkerPermissionsAllowList(): unknown;
|
||||
getApplicationId(): unknown;
|
||||
getGuildId(): string;
|
||||
getRecipientId(): unknown;
|
||||
hasFlag(flag: number): boolean;
|
||||
isActiveThread(): boolean;
|
||||
isArchivedThread(): boolean;
|
||||
isCategory(): boolean;
|
||||
isDM(): boolean;
|
||||
isDirectory(): boolean;
|
||||
isForumChannel(): boolean;
|
||||
isGroupDM(): boolean;
|
||||
isGuildStageVoice(): boolean;
|
||||
isGuildVoice(): boolean;
|
||||
isListenModeCapable(): boolean;
|
||||
isManaged(): boolean;
|
||||
isMultiUserDM(): boolean;
|
||||
isNSFW(): boolean;
|
||||
isOwner(): boolean;
|
||||
isPrivate(): boolean;
|
||||
isSystemDM(): boolean;
|
||||
isThread(): boolean;
|
||||
isVocal(): boolean;
|
||||
}
|
||||
64
packages/discord-types/src/common/Guild.d.ts
vendored
Normal file
64
packages/discord-types/src/common/Guild.d.ts
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
import { Role } from './Role';
|
||||
import { DiscordRecord } from './Record';
|
||||
|
||||
// copy(Object.keys(findByProps("CREATOR_MONETIZABLE")).map(JSON.stringify).join("|"))
|
||||
export type GuildFeatures =
|
||||
"INVITE_SPLASH" | "VIP_REGIONS" | "VANITY_URL" | "MORE_EMOJI" | "MORE_STICKERS" | "MORE_SOUNDBOARD" | "VERIFIED" | "COMMERCE" | "DISCOVERABLE" | "COMMUNITY" | "FEATURABLE" | "NEWS" | "HUB" | "PARTNERED" | "ANIMATED_ICON" | "BANNER" | "ENABLED_DISCOVERABLE_BEFORE" | "WELCOME_SCREEN_ENABLED" | "MEMBER_VERIFICATION_GATE_ENABLED" | "PREVIEW_ENABLED" | "ROLE_SUBSCRIPTIONS_ENABLED" | "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE" | "CREATOR_MONETIZABLE" | "CREATOR_MONETIZABLE_PROVISIONAL" | "CREATOR_MONETIZABLE_WHITEGLOVE" | "CREATOR_MONETIZABLE_DISABLED" | "CREATOR_MONETIZABLE_RESTRICTED" | "CREATOR_STORE_PAGE" | "CREATOR_MONETIZABLE_PENDING_NEW_OWNER_ONBOARDING" | "PRODUCTS_AVAILABLE_FOR_PURCHASE" | "GUILD_WEB_PAGE_VANITY_URL" | "THREADS_ENABLED" | "THREADS_ENABLED_TESTING" | "NEW_THREAD_PERMISSIONS" | "ROLE_ICONS" | "TEXT_IN_STAGE_ENABLED" | "TEXT_IN_VOICE_ENABLED" | "HAS_DIRECTORY_ENTRY" | "ANIMATED_BANNER" | "LINKED_TO_HUB" | "EXPOSED_TO_ACTIVITIES_WTP_EXPERIMENT" | "GUILD_HOME_DEPRECATION_OVERRIDE" | "GUILD_HOME_TEST" | "GUILD_HOME_OVERRIDE" | "GUILD_ONBOARDING" | "GUILD_ONBOARDING_EVER_ENABLED" | "GUILD_ONBOARDING_HAS_PROMPTS" | "GUILD_SERVER_GUIDE" | "INTERNAL_EMPLOYEE_ONLY" | "AUTO_MODERATION" | "INVITES_DISABLED" | "BURST_REACTIONS" | "SOUNDBOARD" | "SHARD" | "ACTIVITY_FEED_ENABLED_BY_USER" | "ACTIVITY_FEED_DISABLED_BY_USER" | "SUMMARIES_ENABLED_GA" | "LEADERBOARD_ENABLED" | "SUMMARIES_ENABLED_BY_USER" | "SUMMARIES_OPT_OUT_EXPERIENCE" | "CHANNEL_ICON_EMOJIS_GENERATED" | "NON_COMMUNITY_RAID_ALERTS" | "RAID_ALERTS_DISABLED" | "AUTOMOD_TRIGGER_USER_PROFILE" | "ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY" | "GUILD_PRODUCTS_ALLOW_ARCHIVED_FILE" | "CLAN" | "MEMBER_VERIFICATION_MANUAL_APPROVAL" | "FORWARDING_DISABLED" | "MEMBER_VERIFICATION_ROLLOUT_TEST" | "AUDIO_BITRATE_128_KBPS" | "AUDIO_BITRATE_256_KBPS" | "AUDIO_BITRATE_384_KBPS" | "VIDEO_BITRATE_ENHANCED" | "MAX_FILE_SIZE_50_MB" | "MAX_FILE_SIZE_100_MB" | "GUILD_TAGS" | "ENHANCED_ROLE_COLORS" | "PREMIUM_TIER_3_OVERRIDE" | "REPORT_TO_MOD_PILOT" | "TIERLESS_BOOSTING_SYSTEM_MESSAGE";
|
||||
export type GuildPremiumFeatures =
|
||||
"ANIMATED_ICON" | "STAGE_CHANNEL_VIEWERS_150" | "ROLE_ICONS" | "GUILD_TAGS" | "BANNER" | "MAX_FILE_SIZE_50_MB" | "VIDEO_QUALITY_720_60FPS" | "STAGE_CHANNEL_VIEWERS_50" | "VIDEO_QUALITY_1080_60FPS" | "MAX_FILE_SIZE_100_MB" | "VANITY_URL" | "VIDEO_BITRATE_ENHANCED" | "STAGE_CHANNEL_VIEWERS_300" | "AUDIO_BITRATE_128_KBPS" | "ANIMATED_BANNER" | "TIERLESS_BOOSTING" | "ENHANCED_ROLE_COLORS" | "INVITE_SPLASH" | "AUDIO_BITRATE_256_KBPS" | "AUDIO_BITRATE_384_KBPS";
|
||||
|
||||
export class Guild extends DiscordRecord {
|
||||
constructor(guild: object);
|
||||
afkChannelId: string | undefined;
|
||||
afkTimeout: number;
|
||||
applicationCommandCounts: {
|
||||
0: number;
|
||||
1: number;
|
||||
2: number;
|
||||
};
|
||||
application_id: unknown;
|
||||
banner: string | undefined;
|
||||
defaultMessageNotifications: number;
|
||||
description: string | undefined;
|
||||
discoverySplash: string | undefined;
|
||||
explicitContentFilter: number;
|
||||
features: Set<GuildFeatures>;
|
||||
homeHeader: string | undefined;
|
||||
hubType: unknown;
|
||||
icon: string | undefined;
|
||||
id: string;
|
||||
joinedAt: Date;
|
||||
latestOnboardingQuestionId: string | undefined;
|
||||
maxMembers: number;
|
||||
maxStageVideoChannelUsers: number;
|
||||
maxVideoChannelUsers: number;
|
||||
mfaLevel: number;
|
||||
moderatorReporting: unknown;
|
||||
name: string;
|
||||
nsfwLevel: number;
|
||||
ownerConfiguredContentLevel: number;
|
||||
ownerId: string;
|
||||
preferredLocale: string;
|
||||
premiumFeatures: {
|
||||
additionalEmojiSlots: number;
|
||||
additionalSoundSlots: number;
|
||||
additionalStickerSlots: number;
|
||||
features: Array<GuildPremiumFeatures>;
|
||||
};
|
||||
premiumProgressBarEnabled: boolean;
|
||||
premiumSubscriberCount: number;
|
||||
premiumTier: 0 | 1 | 2 | 3;
|
||||
profile: {
|
||||
badge: string | undefined;
|
||||
tag: string | undefined;
|
||||
} | undefined;
|
||||
publicUpdatesChannelId: string | undefined;
|
||||
roles: Record<string, Role>;
|
||||
rulesChannelId: string | undefined;
|
||||
safetyAlertsChannelId: string | undefined;
|
||||
splash: string | undefined;
|
||||
systemChannelFlags: number;
|
||||
systemChannelId: string | undefined;
|
||||
vanityURLCode: string | undefined;
|
||||
verificationLevel: number;
|
||||
}
|
||||
26
packages/discord-types/src/common/GuildMember.d.ts
vendored
Normal file
26
packages/discord-types/src/common/GuildMember.d.ts
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
export interface GuildMember {
|
||||
avatar: string | undefined;
|
||||
avatarDecoration: string | undefined;
|
||||
banner: string | undefined;
|
||||
bio: string;
|
||||
colorRoleId: string | undefined;
|
||||
colorString: string;
|
||||
colorStrings: {
|
||||
primaryColor: string | undefined;
|
||||
secondaryColor: string | undefined;
|
||||
tertiaryColor: string | undefined;
|
||||
};
|
||||
communicationDisabledUntil: string | undefined;
|
||||
flags: number;
|
||||
fullProfileLoadedTimestamp: number;
|
||||
guildId: string;
|
||||
highestRoleId: string;
|
||||
hoistRoleId: string;
|
||||
iconRoleId: string;
|
||||
isPending: boolean | undefined;
|
||||
joinedAt: string | undefined;
|
||||
nick: string | undefined;
|
||||
premiumSince: string | undefined;
|
||||
roles: string[];
|
||||
userId: string;
|
||||
}
|
||||
12
packages/discord-types/src/common/Record.d.ts
vendored
Normal file
12
packages/discord-types/src/common/Record.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
type Updater = (value: any) => any;
|
||||
|
||||
/**
|
||||
* Common Record class extended by various Discord data structures, like User, Channel, Guild, etc.
|
||||
*/
|
||||
export class DiscordRecord {
|
||||
toJS(): Record<string, any>;
|
||||
|
||||
set(key: string, value: any): this;
|
||||
merge(data: Record<string, any>): this;
|
||||
update(key: string, defaultValueOrUpdater: Updater | any, updater?: Updater): this;
|
||||
}
|
||||
33
packages/discord-types/src/common/Role.d.ts
vendored
Normal file
33
packages/discord-types/src/common/Role.d.ts
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
export interface Role {
|
||||
color: number;
|
||||
colorString: string | undefined;
|
||||
colorStrings: {
|
||||
primaryColor: string | undefined;
|
||||
secondaryColor: string | undefined;
|
||||
tertiaryColor: string | undefined;
|
||||
};
|
||||
colors: {
|
||||
primary_color: number | undefined;
|
||||
secondary_color: number | undefined;
|
||||
tertiary_color: number | undefined;
|
||||
};
|
||||
flags: number;
|
||||
hoist: boolean;
|
||||
icon: string | undefined;
|
||||
id: string;
|
||||
managed: boolean;
|
||||
mentionable: boolean;
|
||||
name: string;
|
||||
originalPosition: number;
|
||||
permissions: bigint;
|
||||
position: number;
|
||||
/**
|
||||
* probably incomplete
|
||||
*/
|
||||
tags: {
|
||||
bot_id: string;
|
||||
integration_id: string;
|
||||
premium_subscriber: unknown;
|
||||
} | undefined;
|
||||
unicodeEmoji: string | undefined;
|
||||
}
|
||||
65
packages/discord-types/src/common/User.d.ts
vendored
Normal file
65
packages/discord-types/src/common/User.d.ts
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// TODO: a lot of optional params can also be null, not just undef
|
||||
|
||||
import { DiscordRecord } from "./Record";
|
||||
|
||||
export class User extends DiscordRecord {
|
||||
constructor(user: object);
|
||||
accentColor: number;
|
||||
avatar: string;
|
||||
banner: string | null | undefined;
|
||||
bio: string;
|
||||
bot: boolean;
|
||||
desktop: boolean;
|
||||
discriminator: string;
|
||||
email: string | undefined;
|
||||
flags: number;
|
||||
globalName: string | undefined;
|
||||
guildMemberAvatars: Record<string, string>;
|
||||
id: string;
|
||||
mfaEnabled: boolean;
|
||||
mobile: boolean;
|
||||
nsfwAllowed: boolean | undefined;
|
||||
phone: string | undefined;
|
||||
premiumType: number | undefined;
|
||||
premiumUsageFlags: number;
|
||||
publicFlags: number;
|
||||
purchasedFlags: number;
|
||||
system: boolean;
|
||||
username: string;
|
||||
verified: boolean;
|
||||
|
||||
get createdAt(): Date;
|
||||
get hasPremiumPerks(): boolean;
|
||||
get tag(): string;
|
||||
get usernameNormalized(): string;
|
||||
|
||||
addGuildAvatarHash(guildId: string, avatarHash: string): User;
|
||||
getAvatarSource(guildId: string, canAnimate?: boolean): { uri: string; };
|
||||
getAvatarURL(guildId?: string | null, t?: unknown, canAnimate?: boolean): string;
|
||||
hasAvatarForGuild(guildId: string): boolean;
|
||||
hasDisabledPremium(): boolean;
|
||||
hasFlag(flag: number): boolean;
|
||||
hasFreePremium(): boolean;
|
||||
hasHadSKU(e: unknown): boolean;
|
||||
hasPremiumUsageFlag(flag: number): boolean;
|
||||
hasPurchasedFlag(flag: number): boolean;
|
||||
hasUrgentMessages(): boolean;
|
||||
isClaimed(): boolean;
|
||||
isLocalBot(): boolean;
|
||||
isNonUserBot(): boolean;
|
||||
isPhoneVerified(): boolean;
|
||||
isStaff(): boolean;
|
||||
isSystemUser(): boolean;
|
||||
isVerifiedBot(): boolean;
|
||||
removeGuildAvatarHash(guildId: string): User;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface UserJSON {
|
||||
avatar: string;
|
||||
avatarDecoration: unknown | undefined;
|
||||
discriminator: string;
|
||||
id: string;
|
||||
publicFlags: number;
|
||||
username: string;
|
||||
}
|
||||
9
packages/discord-types/src/common/index.d.ts
vendored
Normal file
9
packages/discord-types/src/common/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export * from "./Activity";
|
||||
export * from "./Application";
|
||||
export * from "./Channel";
|
||||
export * from "./Guild";
|
||||
export * from "./GuildMember";
|
||||
export * from "./messages";
|
||||
export * from "./Role";
|
||||
export * from "./User";
|
||||
export * from "./Record";
|
||||
61
packages/discord-types/src/common/messages/Commands.d.ts
vendored
Normal file
61
packages/discord-types/src/common/messages/Commands.d.ts
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import { Channel } from "../Channel";
|
||||
import { Guild } from "../Guild";
|
||||
import { Promisable } from "type-fest";
|
||||
import { ApplicationCommandInputType, ApplicationCommandOptionType, ApplicationCommandType } from "../../../enums";
|
||||
|
||||
export interface CommandContext {
|
||||
channel: Channel;
|
||||
guild?: Guild;
|
||||
}
|
||||
|
||||
export interface CommandOption {
|
||||
name: string;
|
||||
displayName?: string;
|
||||
type: ApplicationCommandOptionType;
|
||||
description: string;
|
||||
displayDescription?: string;
|
||||
required?: boolean;
|
||||
options?: CommandOption[];
|
||||
choices?: Array<ChoicesOption>;
|
||||
}
|
||||
|
||||
export interface ChoicesOption {
|
||||
label: string;
|
||||
value: string;
|
||||
name: string;
|
||||
displayName?: string;
|
||||
}
|
||||
|
||||
export interface CommandReturnValue {
|
||||
content: string;
|
||||
// TODO: implement
|
||||
// cancel?: boolean;
|
||||
}
|
||||
|
||||
export interface CommandArgument {
|
||||
type: ApplicationCommandOptionType;
|
||||
name: string;
|
||||
value: string;
|
||||
focused: undefined;
|
||||
options: CommandArgument[];
|
||||
}
|
||||
|
||||
export interface Command {
|
||||
id?: string;
|
||||
applicationId?: string;
|
||||
type?: ApplicationCommandType;
|
||||
inputType?: ApplicationCommandInputType;
|
||||
plugin?: string;
|
||||
|
||||
name: string;
|
||||
untranslatedName?: string;
|
||||
displayName?: string;
|
||||
description: string;
|
||||
untranslatedDescription?: string;
|
||||
displayDescription?: string;
|
||||
|
||||
options?: CommandOption[];
|
||||
predicate?(ctx: CommandContext): boolean;
|
||||
|
||||
execute(args: CommandArgument[], ctx: CommandContext): Promisable<void | CommandReturnValue>;
|
||||
}
|
||||
70
packages/discord-types/src/common/messages/Embed.d.ts
vendored
Normal file
70
packages/discord-types/src/common/messages/Embed.d.ts
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
export interface Embed {
|
||||
author?: {
|
||||
name: string;
|
||||
url: string;
|
||||
iconURL: string | undefined;
|
||||
iconProxyURL: string | undefined;
|
||||
};
|
||||
color: string;
|
||||
fields: [];
|
||||
id: string;
|
||||
image?: {
|
||||
height: number;
|
||||
width: number;
|
||||
url: string;
|
||||
proxyURL: string;
|
||||
};
|
||||
provider?: {
|
||||
name: string;
|
||||
url: string | undefined;
|
||||
};
|
||||
rawDescription: string;
|
||||
rawTitle: string;
|
||||
referenceId: unknown;
|
||||
timestamp: string;
|
||||
thumbnail?: {
|
||||
height: number;
|
||||
proxyURL: string | undefined;
|
||||
url: string;
|
||||
width: number;
|
||||
};
|
||||
type: string;
|
||||
url: string | undefined;
|
||||
video?: {
|
||||
height: number;
|
||||
width: number;
|
||||
url: string;
|
||||
proxyURL: string | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
export interface EmbedJSON {
|
||||
author?: {
|
||||
name: string;
|
||||
url: string;
|
||||
icon_url: string;
|
||||
proxy_icon_url: string;
|
||||
};
|
||||
title: string;
|
||||
color: string;
|
||||
description: string;
|
||||
type: string;
|
||||
url: string | undefined;
|
||||
provider?: {
|
||||
name: string;
|
||||
url: string;
|
||||
};
|
||||
timestamp: string;
|
||||
thumbnail?: {
|
||||
height: number;
|
||||
width: number;
|
||||
url: string;
|
||||
proxy_url: string | undefined;
|
||||
};
|
||||
video?: {
|
||||
height: number;
|
||||
width: number;
|
||||
url: string;
|
||||
proxy_url: string | undefined;
|
||||
};
|
||||
}
|
||||
114
packages/discord-types/src/common/messages/Emoji.d.ts
vendored
Normal file
114
packages/discord-types/src/common/messages/Emoji.d.ts
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
/** Union type for both custom (guild) emojis and unicode emojis. */
|
||||
export type Emoji = CustomEmoji | UnicodeEmoji;
|
||||
|
||||
/**
|
||||
* Custom emoji uploaded to a guild.
|
||||
*/
|
||||
export interface CustomEmoji {
|
||||
/** Discriminator for custom emojis. */
|
||||
type: 1;
|
||||
/** Whether the emoji is animated (GIF). */
|
||||
animated: boolean;
|
||||
/** Whether the emoji is available for use. */
|
||||
available: boolean;
|
||||
/** Guild id this emoji belongs to. */
|
||||
guildId: string;
|
||||
/** Unique emoji id (snowflake). */
|
||||
id: string;
|
||||
/** Whether the emoji is managed by an integration (e.g. Twitch). */
|
||||
managed: boolean;
|
||||
/** Emoji name without colons. */
|
||||
name: string;
|
||||
/** Original name before any modifications. */
|
||||
originalName?: string;
|
||||
/** Whether the emoji requires colons to use. */
|
||||
require_colons: boolean;
|
||||
/** Role ids that can use this emoji (empty array means everyone). */
|
||||
roles: string[];
|
||||
/** Version number, incremented when emoji is updated. */
|
||||
version?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Built-in unicode emoji.
|
||||
*/
|
||||
export interface UnicodeEmoji {
|
||||
/** Discriminator for unicode emojis. */
|
||||
type: 0;
|
||||
/** Skin tone variant emojis keyed by diversity surrogate code (e.g. "1f3fb" for light skin). */
|
||||
diversityChildren: Record<string, UnicodeEmoji>;
|
||||
/** Raw emoji data from Discord's emoji dataset. */
|
||||
emojiObject: EmojiObject;
|
||||
/** Index position in the emoji list. */
|
||||
index: number;
|
||||
/** Unicode surrogate pair(s) for this emoji. */
|
||||
surrogates: string;
|
||||
/** Unique name identifier for this emoji. */
|
||||
uniqueName: string;
|
||||
/** Whether to render using sprite sheet. */
|
||||
useSpriteSheet: boolean;
|
||||
/** Original name if renamed in context. */
|
||||
originalName?: string;
|
||||
/** Emoji id when used in custom emoji context. */
|
||||
id?: string;
|
||||
/** Guild id when used in guild context. */
|
||||
guildId?: string;
|
||||
/** Formatted string of all emoji names. */
|
||||
get allNamesString(): string;
|
||||
/** Always false for unicode emojis. */
|
||||
get animated(): false;
|
||||
/** Default skin tone variant or undefined if no diversity. */
|
||||
get defaultDiversityChild(): UnicodeEmoji | undefined;
|
||||
/** Whether this emoji supports skin tone modifiers. */
|
||||
get hasDiversity(): boolean | undefined;
|
||||
/** Whether this emoji is a skin tone variant of another. */
|
||||
get hasDiversityParent(): boolean | undefined;
|
||||
/** Whether this emoji supports multiple diversity modifiers (e.g. handshake with two skin tones). */
|
||||
get hasMultiDiversity(): boolean | undefined;
|
||||
/** Whether this emoji is a multi-diversity variant of another. */
|
||||
get hasMultiDiversityParent(): boolean | undefined;
|
||||
/** Always true for unicode emojis. */
|
||||
get managed(): true;
|
||||
/** Primary emoji name. */
|
||||
get name(): string;
|
||||
/** All names/aliases for this emoji. */
|
||||
get names(): string[];
|
||||
/** Surrogate sequence with optional diversity modifier. */
|
||||
get optionallyDiverseSequence(): string | undefined;
|
||||
/** Unicode version when this emoji was added. */
|
||||
get unicodeVersion(): number;
|
||||
/** CDN url for emoji image. */
|
||||
get url(): string;
|
||||
/**
|
||||
* Iterates over all diversity variants of this emoji.
|
||||
* @param callback Function called for each diversity variant.
|
||||
*/
|
||||
forEachDiversity(callback: (emoji: UnicodeEmoji) => void): void;
|
||||
/**
|
||||
* Iterates over all names/aliases of this emoji.
|
||||
* @param callback Function called for each name.
|
||||
*/
|
||||
forEachName(callback: (name: string) => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Raw emoji data from Discord's emoji dataset.
|
||||
*/
|
||||
export interface EmojiObject {
|
||||
/** All names/aliases for this emoji. */
|
||||
names: string[];
|
||||
/** Unicode surrogate pair(s). */
|
||||
surrogates: string;
|
||||
/** Unicode version when this emoji was added. */
|
||||
unicodeVersion: number;
|
||||
/** Index in the sprite sheet for rendering. */
|
||||
spriteIndex?: number;
|
||||
/** Whether this emoji supports multiple skin tone modifiers. */
|
||||
hasMultiDiversity?: boolean;
|
||||
/** Whether this emoji is a diversity variant with a multi-diversity parent. */
|
||||
hasMultiDiversityParent?: boolean;
|
||||
/** Skin tone modifier codes for this variant (e.g. ["1f3fb"] or ["1f3fb", "1f3fc"]). */
|
||||
diversity?: string[];
|
||||
/** Sprite indices of diversity children for parent emojis. */
|
||||
diversityChildren?: number[];
|
||||
}
|
||||
217
packages/discord-types/src/common/messages/Message.d.ts
vendored
Normal file
217
packages/discord-types/src/common/messages/Message.d.ts
vendored
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
import { CommandOption } from './Commands';
|
||||
import { User, UserJSON } from '../User';
|
||||
import { Embed, EmbedJSON } from './Embed';
|
||||
import { DiscordRecord } from "../Record";
|
||||
import { ApplicationIntegrationType, MessageFlags, MessageType, StickerFormatType } from "../../../enums";
|
||||
|
||||
/*
|
||||
* TODO: looks like discord has moved over to Date instead of Moment;
|
||||
*/
|
||||
export class Message extends DiscordRecord {
|
||||
constructor(message: object);
|
||||
activity: unknown;
|
||||
application: unknown;
|
||||
applicationId: string | unknown;
|
||||
attachments: MessageAttachment[];
|
||||
author: User;
|
||||
blocked: boolean;
|
||||
bot: boolean;
|
||||
call: {
|
||||
duration: moment.Duration;
|
||||
endedTimestamp: moment.Moment;
|
||||
participants: string[];
|
||||
};
|
||||
channel_id: string;
|
||||
/**
|
||||
* NOTE: not fully typed
|
||||
*/
|
||||
codedLinks: {
|
||||
code?: string;
|
||||
type: string;
|
||||
}[];
|
||||
colorString: unknown;
|
||||
components: unknown[];
|
||||
content: string;
|
||||
customRenderedContent: unknown;
|
||||
editedTimestamp: Date;
|
||||
embeds: Embed[];
|
||||
flags: MessageFlags;
|
||||
giftCodes: string[];
|
||||
id: string;
|
||||
interaction: {
|
||||
id: string;
|
||||
name: string;
|
||||
type: number;
|
||||
user: User;
|
||||
}[] | undefined;
|
||||
interactionData: {
|
||||
application_command: {
|
||||
application_id: string;
|
||||
default_member_permissions: unknown;
|
||||
default_permission: boolean;
|
||||
description: string;
|
||||
dm_permission: unknown;
|
||||
id: string;
|
||||
name: string;
|
||||
options: CommandOption[];
|
||||
permissions: unknown[];
|
||||
type: number;
|
||||
version: string;
|
||||
};
|
||||
attachments: MessageAttachment[];
|
||||
guild_id: string | undefined;
|
||||
id: string;
|
||||
name: string;
|
||||
options: {
|
||||
focused: unknown;
|
||||
name: string;
|
||||
type: number;
|
||||
value: string;
|
||||
}[];
|
||||
type: number;
|
||||
version: string;
|
||||
}[];
|
||||
interactionMetadata?: {
|
||||
id: string;
|
||||
type: number;
|
||||
name?: string;
|
||||
command_type?: number;
|
||||
ephemerality_reason?: number;
|
||||
user: User;
|
||||
authorizing_integration_owners: Record<ApplicationIntegrationType, string>;
|
||||
original_response_message_id?: string;
|
||||
interacted_message_id?: string;
|
||||
target_user?: User;
|
||||
target_message_id?: string;
|
||||
};
|
||||
interactionError: unknown[];
|
||||
isSearchHit: boolean;
|
||||
loggingName: unknown;
|
||||
mentionChannels: string[];
|
||||
mentionEveryone: boolean;
|
||||
mentionRoles: string[];
|
||||
mentioned: boolean;
|
||||
mentions: string[];
|
||||
messageReference: {
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
} | undefined;
|
||||
messageSnapshots: {
|
||||
message: Message;
|
||||
}[];
|
||||
nick: unknown; // probably a string
|
||||
nonce: string | undefined;
|
||||
pinned: boolean;
|
||||
reactions: MessageReaction[];
|
||||
state: string;
|
||||
stickerItems: {
|
||||
format_type: StickerFormatType;
|
||||
id: string;
|
||||
name: string;
|
||||
}[];
|
||||
stickers: unknown[];
|
||||
timestamp: moment.Moment;
|
||||
tts: boolean;
|
||||
type: MessageType;
|
||||
webhookId: string | undefined;
|
||||
|
||||
/**
|
||||
* Doesn't actually update the original message; it just returns a new message instance with the added reaction.
|
||||
*/
|
||||
addReaction(emoji: ReactionEmoji, fromCurrentUser: boolean): Message;
|
||||
/**
|
||||
* Searches each reaction and if the provided string has an index above -1 it'll return the reaction object.
|
||||
*/
|
||||
getReaction(name: string): MessageReaction;
|
||||
/**
|
||||
* Doesn't actually update the original message; it just returns the message instance without the reaction searched with the provided emoji object.
|
||||
*/
|
||||
removeReactionsForEmoji(emoji: ReactionEmoji): Message;
|
||||
/**
|
||||
* Doesn't actually update the original message; it just returns the message instance without the reaction.
|
||||
*/
|
||||
removeReaction(emoji: ReactionEmoji, fromCurrentUser: boolean): Message;
|
||||
|
||||
getChannelId(): string;
|
||||
hasFlag(flag: MessageFlags): boolean;
|
||||
isCommandType(): boolean;
|
||||
isEdited(): boolean;
|
||||
isSystemDM(): boolean;
|
||||
|
||||
/** Vencord added */
|
||||
deleted?: boolean;
|
||||
}
|
||||
|
||||
/** A smaller Message object found in FluxDispatcher and elsewhere. */
|
||||
export interface MessageJSON {
|
||||
attachments: MessageAttachment[];
|
||||
author: UserJSON;
|
||||
channel_id: string;
|
||||
components: unknown[];
|
||||
content: string;
|
||||
edited_timestamp: string;
|
||||
embeds: EmbedJSON[];
|
||||
flags: number;
|
||||
guild_id: string | undefined;
|
||||
id: string;
|
||||
loggingName: unknown;
|
||||
member: {
|
||||
avatar: string | undefined;
|
||||
communication_disabled_until: string | undefined;
|
||||
deaf: boolean;
|
||||
hoisted_role: string | undefined;
|
||||
is_pending: boolean;
|
||||
joined_at: string;
|
||||
mute: boolean;
|
||||
nick: string | boolean;
|
||||
pending: boolean;
|
||||
premium_since: string | undefined;
|
||||
roles: string[];
|
||||
} | undefined;
|
||||
mention_everyone: boolean;
|
||||
mention_roles: string[];
|
||||
mentions: UserJSON[];
|
||||
message_reference: {
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
} | undefined;
|
||||
nonce: string | undefined;
|
||||
pinned: boolean;
|
||||
referenced_message: MessageJSON | undefined;
|
||||
state: string;
|
||||
timestamp: string;
|
||||
tts: boolean;
|
||||
type: number;
|
||||
}
|
||||
|
||||
export interface MessageAttachment {
|
||||
filename: string;
|
||||
id: string;
|
||||
proxy_url: string;
|
||||
size: number;
|
||||
spoiler: boolean;
|
||||
url: string;
|
||||
content_type?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface ReactionEmoji {
|
||||
id: string | undefined;
|
||||
name: string;
|
||||
animated: boolean;
|
||||
}
|
||||
|
||||
export interface MessageReaction {
|
||||
count: number;
|
||||
emoji: ReactionEmoji;
|
||||
me: boolean;
|
||||
}
|
||||
|
||||
// Object.keys(findByProps("REPLYABLE")).map(JSON.stringify).join("|")
|
||||
export type MessageTypeSets = Record<
|
||||
"UNDELETABLE" | "GUILD_DISCOVERY_STATUS" | "USER_MESSAGE" | "NOTIFIABLE_SYSTEM_MESSAGE" | "REPLYABLE" | "FORWARDABLE" | "REFERENCED_MESSAGE_AVAILABLE" | "AVAILABLE_IN_GUILD_FEED" | "DEADCHAT_PROMPTS" | "NON_COLLAPSIBLE" | "NON_PARSED" | "AUTOMOD_INCIDENT_ACTIONS" | "SELF_MENTIONABLE_SYSTEM" | "SCHEDULABLE",
|
||||
Set<MessageType>
|
||||
>;
|
||||
35
packages/discord-types/src/common/messages/Sticker.d.ts
vendored
Normal file
35
packages/discord-types/src/common/messages/Sticker.d.ts
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { StickerFormatType, StickerType } from "../../../enums";
|
||||
|
||||
interface BaseSticker {
|
||||
asset: string;
|
||||
available: boolean;
|
||||
description: string;
|
||||
format_type: StickerFormatType;
|
||||
id: string;
|
||||
name: string;
|
||||
sort_value?: number;
|
||||
/** a comma separated string */
|
||||
tags: string;
|
||||
}
|
||||
|
||||
export interface PackSticker extends BaseSticker {
|
||||
pack_id: string;
|
||||
type: StickerType.STANDARD;
|
||||
}
|
||||
|
||||
export interface GuildSticker extends BaseSticker {
|
||||
guild_id: string;
|
||||
type: StickerType.GUILD;
|
||||
}
|
||||
|
||||
export type Sticker = PackSticker | GuildSticker;
|
||||
|
||||
export interface PremiumStickerPack {
|
||||
banner_asset_id?: string;
|
||||
cover_sticker_id?: string;
|
||||
description: string;
|
||||
id: string;
|
||||
name: string;
|
||||
sku_id: string;
|
||||
stickers: PackSticker[];
|
||||
}
|
||||
5
packages/discord-types/src/common/messages/index.d.ts
vendored
Normal file
5
packages/discord-types/src/common/messages/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export * from "./Commands";
|
||||
export * from "./Message";
|
||||
export * from "./Embed";
|
||||
export * from "./Emoji";
|
||||
export * from "./Sticker";
|
||||
|
|
@ -1,84 +1,53 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2023 Vendicated and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import type { ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react";
|
||||
import type { ComponentClass, ComponentPropsWithRef, ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, JSX, KeyboardEvent, MouseEvent, PointerEvent, PropsWithChildren, ReactNode, Ref, RefObject } from "react";
|
||||
|
||||
|
||||
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/bold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/bold" | "eyebrow" | "heading-deprecated-14/normal" | "heading-deprecated-14/medium" | "heading-deprecated-14/bold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold" | "display-sm" | "display-md" | "display-lg" | "code";
|
||||
export type FormTextTypes = Record<"DEFAULT" | "INPUT_PLACEHOLDER" | "DESCRIPTION" | "LABEL_BOLD" | "LABEL_SELECTED" | "LABEL_DESCRIPTOR" | "ERROR" | "SUCCESS", string>;
|
||||
// #region Old compability
|
||||
|
||||
export type HeadingTag = `h${1 | 2 | 3 | 4 | 5 | 6}`;
|
||||
|
||||
export type Margins = Record<"marginTop16" | "marginTop8" | "marginBottom8" | "marginTop20" | "marginBottom20", string>;
|
||||
|
||||
// copy(find(m => Array.isArray(m) && m.includes("heading-sm/normal")).map(JSON.stringify).join("|"))
|
||||
export type TextVariant = "heading-sm/normal" | "heading-sm/medium" | "heading-sm/semibold" | "heading-sm/bold" | "heading-sm/extrabold" | "heading-md/normal" | "heading-md/medium" | "heading-md/semibold" | "heading-md/bold" | "heading-md/extrabold" | "heading-lg/normal" | "heading-lg/medium" | "heading-lg/semibold" | "heading-lg/bold" | "heading-lg/extrabold" | "heading-xl/normal" | "heading-xl/medium" | "heading-xl/semibold" | "heading-xl/bold" | "heading-xl/extrabold" | "heading-xxl/normal" | "heading-xxl/medium" | "heading-xxl/semibold" | "heading-xxl/bold" | "heading-xxl/extrabold" | "text-xxs/normal" | "text-xxs/medium" | "text-xxs/semibold" | "text-xxs/bold" | "text-xs/normal" | "text-xs/medium" | "text-xs/semibold" | "text-xs/bold" | "text-sm/normal" | "text-sm/medium" | "text-sm/semibold" | "text-sm/bold" | "text-md/normal" | "text-md/medium" | "text-md/semibold" | "text-md/bold" | "text-lg/normal" | "text-lg/medium" | "text-lg/semibold" | "text-lg/bold";
|
||||
|
||||
export type TextProps = PropsWithChildren<HtmlHTMLAttributes<HTMLDivElement> & {
|
||||
variant?: TextVariant;
|
||||
tag?: "div" | "span" | "p" | "strong" | HeadingTag;
|
||||
selectable?: boolean;
|
||||
lineClamp?: number;
|
||||
}>;
|
||||
|
||||
export type Text = ComponentType<TextProps>;
|
||||
export type Heading = ComponentType<TextProps>;
|
||||
|
||||
export type FormTitle = ComponentType<HTMLProps<HTMLTitleElement> & PropsWithChildren<{
|
||||
/** default is h5 */
|
||||
tag?: HeadingTag;
|
||||
faded?: boolean;
|
||||
disabled?: boolean;
|
||||
required?: boolean;
|
||||
error?: ReactNode;
|
||||
}>>;
|
||||
export interface ButtonProps extends PropsWithChildren<Omit<HTMLProps<HTMLButtonElement>, "size">> {
|
||||
/** Button.Looks.FILLED */
|
||||
look?: string;
|
||||
/** Button.Colors.BRAND */
|
||||
color?: string;
|
||||
/** Button.Sizes.MEDIUM */
|
||||
size?: string;
|
||||
|
||||
export type FormSection = ComponentType<PropsWithChildren<{
|
||||
/** default is h5 */
|
||||
tag?: HeadingTag;
|
||||
className?: string;
|
||||
titleClassName?: string;
|
||||
titleId?: string;
|
||||
title?: ReactNode;
|
||||
disabled?: boolean;
|
||||
htmlFor?: unknown;
|
||||
}>>;
|
||||
}
|
||||
|
||||
export type FormDivider = ComponentType<{
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
}>;
|
||||
export type Button = ComponentType<ButtonProps> & {
|
||||
Colors: Record<"BRAND" | "RED" | "GREEN" | "PRIMARY" | "LINK" | "WHITE" | "TRANSPARENT" | "CUSTOM", string>;
|
||||
Looks: Record<"FILLED" | "LINK", string>;
|
||||
Sizes: Record<"NONE" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "MIN", string>;
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
export type FormText = ComponentType<PropsWithChildren<{
|
||||
disabled?: boolean;
|
||||
selectable?: boolean;
|
||||
/** defaults to FormText.Types.DEFAULT */
|
||||
type?: string;
|
||||
}> & TextProps> & { Types: FormTextTypes; };
|
||||
export interface TooltipChildrenProps {
|
||||
onClick(): void;
|
||||
onMouseEnter(): void;
|
||||
onMouseLeave(): void;
|
||||
onContextMenu(): void;
|
||||
onFocus(): void;
|
||||
onBlur(): void;
|
||||
"aria-label"?: string;
|
||||
}
|
||||
|
||||
export type Tooltip = ComponentType<{
|
||||
export interface TooltipProps {
|
||||
text: ReactNode | ComponentType;
|
||||
children: FunctionComponent<{
|
||||
onClick(): void;
|
||||
onMouseEnter(): void;
|
||||
onMouseLeave(): void;
|
||||
onContextMenu(): void;
|
||||
onFocus(): void;
|
||||
onBlur(): void;
|
||||
"aria-label"?: string;
|
||||
}>;
|
||||
children: FunctionComponent<TooltipChildrenProps>;
|
||||
"aria-label"?: string;
|
||||
|
||||
allowOverflow?: boolean;
|
||||
|
|
@ -95,7 +64,9 @@ export type Tooltip = ComponentType<{
|
|||
|
||||
tooltipClassName?: string;
|
||||
tooltipContentClassName?: string;
|
||||
}> & {
|
||||
}
|
||||
|
||||
export type Tooltip = ComponentType<TooltipProps> & {
|
||||
Colors: Record<"BLACK" | "BRAND" | "CUSTOM" | "GREEN" | "GREY" | "PRIMARY" | "RED" | "YELLOW", string>;
|
||||
};
|
||||
|
||||
|
|
@ -144,7 +115,6 @@ export type ComboboxPopout = ComponentType<PropsWithChildren<{
|
|||
className?: string;
|
||||
listClassName?: string;
|
||||
|
||||
|
||||
autoFocus?: boolean;
|
||||
multiSelect?: boolean;
|
||||
maxVisibleItems?: number;
|
||||
|
|
@ -152,48 +122,35 @@ export type ComboboxPopout = ComponentType<PropsWithChildren<{
|
|||
|
||||
}>>;
|
||||
|
||||
export type Button = ComponentType<PropsWithChildren<Omit<HTMLProps<HTMLButtonElement>, "size"> & {
|
||||
/** Button.Looks.FILLED */
|
||||
look?: string;
|
||||
/** Button.Colors.BRAND */
|
||||
color?: string;
|
||||
/** Button.Sizes.MEDIUM */
|
||||
size?: string;
|
||||
/** Button.BorderColors.BLACK */
|
||||
borderColor?: string;
|
||||
|
||||
wrapperClassName?: string;
|
||||
className?: string;
|
||||
innerClassName?: string;
|
||||
|
||||
buttonRef?: Ref<HTMLButtonElement>;
|
||||
focusProps?: any;
|
||||
submitting?: boolean;
|
||||
|
||||
submittingStartedLabel?: string;
|
||||
submittingFinishedLabel?: string;
|
||||
}>> & {
|
||||
BorderColors: Record<"BLACK" | "BRAND" | "BRAND_NEW" | "GREEN" | "LINK" | "PRIMARY" | "RED" | "TRANSPARENT" | "WHITE" | "YELLOW", string>;
|
||||
Colors: Record<"BRAND" | "RED" | "GREEN" | "YELLOW" | "PRIMARY" | "LINK" | "WHITE" | "BLACK" | "TRANSPARENT" | "BRAND_NEW" | "CUSTOM", string>;
|
||||
Hovers: Record<"DEFAULT" | "BRAND" | "RED" | "GREEN" | "YELLOW" | "PRIMARY" | "LINK" | "WHITE" | "BLACK" | "TRANSPARENT", string>;
|
||||
Looks: Record<"FILLED" | "INVERTED" | "OUTLINED" | "LINK" | "BLANK", string>;
|
||||
Sizes: Record<"NONE" | "TINY" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "MIN" | "MAX" | "ICON", string>;
|
||||
|
||||
Link: any;
|
||||
export type CheckboxAligns = {
|
||||
CENTER: "center";
|
||||
TOP: "top";
|
||||
};
|
||||
|
||||
export type Switch = ComponentType<PropsWithChildren<{
|
||||
export type CheckboxTypes = {
|
||||
DEFAULT: "default";
|
||||
INVERTED: "inverted";
|
||||
GHOST: "ghost";
|
||||
ROW: "row";
|
||||
};
|
||||
|
||||
export type Checkbox = ComponentType<PropsWithChildren<{
|
||||
value: boolean;
|
||||
onChange(value: boolean): void;
|
||||
onChange(event: PointerEvent, value: boolean): void;
|
||||
|
||||
align?: "center" | "top";
|
||||
disabled?: boolean;
|
||||
hideBorder?: boolean;
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
|
||||
note?: ReactNode;
|
||||
tooltipNote?: ReactNode;
|
||||
}>>;
|
||||
displayOnly?: boolean;
|
||||
readOnly?: boolean;
|
||||
reverse?: boolean;
|
||||
shape?: string;
|
||||
size?: number;
|
||||
type?: "default" | "inverted" | "ghost" | "row";
|
||||
}>> & {
|
||||
Shapes: Record<"BOX" | "ROUND" | "SMALL_BOX", string>;
|
||||
Aligns: CheckboxAligns;
|
||||
Types: CheckboxTypes;
|
||||
};
|
||||
|
||||
export type Timestamp = ComponentType<PropsWithChildren<{
|
||||
timestamp: Date;
|
||||
|
|
@ -213,7 +170,8 @@ export type TextInput = ComponentType<PropsWithChildren<{
|
|||
onChange?(value: string, name?: string): void;
|
||||
placeholder?: string;
|
||||
editable?: boolean;
|
||||
maxLength?: number;
|
||||
/** defaults to 999. Pass null to disable this default */
|
||||
maxLength?: number | null;
|
||||
error?: string;
|
||||
|
||||
inputClassName?: string;
|
||||
|
|
@ -225,13 +183,15 @@ export type TextInput = ComponentType<PropsWithChildren<{
|
|||
|
||||
/** TextInput.Sizes.DEFAULT */
|
||||
size?: string;
|
||||
} & Omit<HTMLProps<HTMLInputElement>, "onChange">>> & {
|
||||
} & Omit<HTMLProps<HTMLInputElement>, "onChange" | "maxLength">>> & {
|
||||
Sizes: Record<"DEFAULT" | "MINI", string>;
|
||||
};
|
||||
|
||||
export type TextArea = ComponentType<PropsWithRef<Omit<HTMLProps<HTMLTextAreaElement>, "onChange"> & {
|
||||
// FIXME: this is wrong, it's not actually just HTMLTextAreaElement
|
||||
export type TextArea = ComponentType<Omit<HTMLProps<HTMLTextAreaElement>, "onChange"> & {
|
||||
onChange(v: string): void;
|
||||
}>>;
|
||||
inputRef?: Ref<HTMLTextAreaElement>;
|
||||
}>;
|
||||
|
||||
interface SelectOption {
|
||||
disabled?: boolean;
|
||||
|
|
@ -283,7 +243,7 @@ export type Select = ComponentType<PropsWithChildren<{
|
|||
export type SearchableSelect = ComponentType<PropsWithChildren<{
|
||||
placeholder?: string;
|
||||
options: ReadonlyArray<SelectOption>; // TODO
|
||||
value?: SelectOption;
|
||||
value?: any;
|
||||
|
||||
/**
|
||||
* - 0 ~ Filled
|
||||
|
|
@ -323,7 +283,7 @@ export type SearchableSelect = ComponentType<PropsWithChildren<{
|
|||
"aria-labelledby"?: boolean;
|
||||
}>>;
|
||||
|
||||
export type Slider = ComponentType<PropsWithChildren<{
|
||||
export type Slider = ComponentClass<PropsWithChildren<{
|
||||
initialValue: number;
|
||||
defaultValue?: number;
|
||||
keyboardStep?: number;
|
||||
|
|
@ -361,14 +321,6 @@ export type Slider = ComponentType<PropsWithChildren<{
|
|||
"aria-describedby"?: string;
|
||||
}>>;
|
||||
|
||||
// TODO - type maybe idk probably not that useful other than the constants
|
||||
export type Flex = ComponentType<PropsWithChildren<any>> & {
|
||||
Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>;
|
||||
Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>;
|
||||
Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;
|
||||
Wrap: Record<"NO_WRAP" | "WRAP" | "WRAP_REVERSE", string>;
|
||||
};
|
||||
|
||||
declare enum PopoutAnimation {
|
||||
NONE = "1",
|
||||
TRANSLATE = "2",
|
||||
|
|
@ -393,6 +345,7 @@ export type Popout = ComponentType<{
|
|||
}
|
||||
): ReactNode;
|
||||
shouldShow?: boolean;
|
||||
targetElementRef: RefObject<any>;
|
||||
renderPopout(args: {
|
||||
closePopout(): void;
|
||||
isPositioned: boolean;
|
||||
|
|
@ -456,19 +409,66 @@ export type MaskedLink = ComponentType<PropsWithChildren<{
|
|||
channelId?: string;
|
||||
}>>;
|
||||
|
||||
export type ScrollerThin = ComponentType<PropsWithChildren<{
|
||||
export interface ScrollerBaseProps {
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
|
||||
dir?: "ltr";
|
||||
orientation?: "horizontal" | "vertical" | "auto";
|
||||
paddingFix?: boolean;
|
||||
fade?: boolean;
|
||||
|
||||
onClose?(): void;
|
||||
onScroll?(): void;
|
||||
}
|
||||
|
||||
export type ScrollerThin = ComponentType<PropsWithChildren<ScrollerBaseProps & {
|
||||
orientation?: "horizontal" | "vertical" | "auto";
|
||||
fade?: boolean;
|
||||
}>>;
|
||||
|
||||
interface BaseListItem {
|
||||
anchorId: any;
|
||||
listIndex: number;
|
||||
offsetTop: number;
|
||||
section: number;
|
||||
}
|
||||
interface ListSection extends BaseListItem {
|
||||
type: "section";
|
||||
}
|
||||
interface ListRow extends BaseListItem {
|
||||
type: "row";
|
||||
row: number;
|
||||
rowIndex: number;
|
||||
}
|
||||
|
||||
export type ListScrollerThin = ComponentType<ScrollerBaseProps & {
|
||||
sections: number[];
|
||||
renderSection?: (item: ListSection) => React.ReactNode;
|
||||
renderRow: (item: ListRow) => React.ReactNode;
|
||||
renderFooter?: (item: any) => React.ReactNode;
|
||||
renderSidebar?: (listVisible: boolean, sidebarVisible: boolean) => React.ReactNode;
|
||||
wrapSection?: (section: number, children: React.ReactNode) => React.ReactNode;
|
||||
|
||||
sectionHeight: number;
|
||||
rowHeight: number;
|
||||
footerHeight?: number;
|
||||
sidebarHeight?: number;
|
||||
|
||||
chunkSize?: number;
|
||||
|
||||
paddingTop?: number;
|
||||
paddingBottom?: number;
|
||||
fade?: boolean;
|
||||
onResize?: Function;
|
||||
getAnchorId?: any;
|
||||
|
||||
innerTag?: string;
|
||||
innerId?: string;
|
||||
innerClassName?: string;
|
||||
innerRole?: string;
|
||||
innerAriaLabel?: string;
|
||||
// Yes, Discord uses this casing
|
||||
innerAriaMultiselectable?: boolean;
|
||||
innerAriaOrientation?: "vertical" | "horizontal";
|
||||
}>;
|
||||
|
||||
export type Clickable = <T extends "a" | "div" | "span" | "li" = "div">(props: PropsWithChildren<ComponentPropsWithRef<T>> & {
|
||||
tag?: T;
|
||||
}) => ReactNode;
|
||||
|
|
@ -494,7 +494,7 @@ export type Avatar = ComponentType<PropsWithChildren<{
|
|||
}>>;
|
||||
|
||||
type FocusLock = ComponentType<PropsWithChildren<{
|
||||
containerRef: RefObject<HTMLElement>;
|
||||
containerRef: Ref<HTMLElement>;
|
||||
}>>;
|
||||
|
||||
export type Icon = ComponentType<JSX.IntrinsicElements["svg"] & {
|
||||
|
|
@ -502,3 +502,10 @@ export type Icon = ComponentType<JSX.IntrinsicElements["svg"] & {
|
|||
colorClass?: string;
|
||||
} & Record<string, any>>;
|
||||
|
||||
export type ColorPicker = ComponentType<{
|
||||
color: number | null;
|
||||
showEyeDropper?: boolean;
|
||||
suggestedColors?: string[];
|
||||
label?: ReactNode;
|
||||
onChange(value: number | null): void;
|
||||
}>;
|
||||
30
packages/discord-types/src/flux.d.ts
vendored
Normal file
30
packages/discord-types/src/flux.d.ts
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { FluxStore } from "./stores/FluxStore";
|
||||
|
||||
export class FluxEmitter {
|
||||
constructor();
|
||||
|
||||
changeSentinel: number;
|
||||
changedStores: Set<FluxStore>;
|
||||
isBatchEmitting: boolean;
|
||||
isDispatching: boolean;
|
||||
isPaused: boolean;
|
||||
pauseTimer: NodeJS.Timeout | null;
|
||||
reactChangedStores: Set<FluxStore>;
|
||||
|
||||
batched(batch: (...args: any[]) => void): void;
|
||||
destroy(): void;
|
||||
emit(): void;
|
||||
emitNonReactOnce(): void;
|
||||
emitReactOnce(): void;
|
||||
getChangeSentinel(): number;
|
||||
getIsPaused(): boolean;
|
||||
injectBatchEmitChanges(batch: (...args: any[]) => void): void;
|
||||
markChanged(store: FluxStore): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
}
|
||||
|
||||
export interface Flux {
|
||||
Store: typeof FluxStore;
|
||||
Emitter: FluxEmitter;
|
||||
}
|
||||
22
packages/discord-types/src/fluxEvents.d.ts
vendored
Normal file
22
packages/discord-types/src/fluxEvents.d.ts
vendored
Normal file
File diff suppressed because one or more lines are too long
9
packages/discord-types/src/index.d.ts
vendored
Normal file
9
packages/discord-types/src/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export * from "./common";
|
||||
export * from "./components";
|
||||
export * from "./flux";
|
||||
export * from "./fluxEvents";
|
||||
export * from "./menu";
|
||||
export * from "./modules";
|
||||
export * from "./stores";
|
||||
export * from "./utils";
|
||||
export * as Webpack from "../webpack";
|
||||
|
|
@ -1,22 +1,4 @@
|
|||
/*
|
||||
* Vencord, a modification for Discord's desktop app
|
||||
* Copyright (c) 2023 Vendicated and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import type { ComponentType, CSSProperties, MouseEvent, PropsWithChildren, ReactNode, UIEvent } from "react";
|
||||
import type { ComponentType, CSSProperties, ForwardRefRenderFunction, MouseEvent, PropsWithChildren, ReactNode, UIEvent } from "react";
|
||||
|
||||
type RC<C> = ComponentType<PropsWithChildren<C & Record<string, any>>>;
|
||||
|
||||
|
|
@ -64,6 +46,8 @@ export interface Menu {
|
|||
MenuControlItem: RC<{
|
||||
id: string;
|
||||
interactive?: boolean;
|
||||
label?: string;
|
||||
control: ForwardRefRenderFunction<any, any>;
|
||||
}>;
|
||||
MenuSliderControl: RC<{
|
||||
minValue: number,
|
||||
|
|
@ -73,7 +57,7 @@ export interface Menu {
|
|||
renderValue?(value: number): string,
|
||||
}>;
|
||||
MenuSearchControl: RC<{
|
||||
query: string
|
||||
query: string;
|
||||
onChange(query: string): void;
|
||||
placeholder?: string;
|
||||
}>;
|
||||
73
packages/discord-types/src/modules/CloudUpload.d.ts
vendored
Normal file
73
packages/discord-types/src/modules/CloudUpload.d.ts
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import EventEmitter from "events";
|
||||
import { CloudUploadPlatform } from "../../enums";
|
||||
|
||||
interface BaseUploadItem {
|
||||
platform: CloudUploadPlatform;
|
||||
id?: string;
|
||||
origin?: string;
|
||||
isThumbnail?: boolean;
|
||||
clip?: unknown;
|
||||
}
|
||||
|
||||
export interface ReactNativeUploadItem extends BaseUploadItem {
|
||||
platform: CloudUploadPlatform.REACT_NATIVE;
|
||||
uri: string;
|
||||
filename?: string;
|
||||
mimeType?: string;
|
||||
durationSecs?: number;
|
||||
waveform?: string;
|
||||
isRemix?: boolean;
|
||||
}
|
||||
|
||||
export interface WebUploadItem extends BaseUploadItem {
|
||||
platform: CloudUploadPlatform.WEB;
|
||||
file: File;
|
||||
}
|
||||
|
||||
export type CloudUploadItem = ReactNativeUploadItem | WebUploadItem;
|
||||
|
||||
export class CloudUpload extends EventEmitter {
|
||||
constructor(item: CloudUploadItem, channelId: string, reactNativeFileIndex?: number);
|
||||
|
||||
channelId: string;
|
||||
classification: string;
|
||||
clip: unknown;
|
||||
contentHash: unknown;
|
||||
currentSize: number;
|
||||
description: string | null;
|
||||
durationSecs: number | undefined;
|
||||
etag: string | undefined;
|
||||
error: unknown;
|
||||
filename: string;
|
||||
id: string;
|
||||
isImage: boolean;
|
||||
isRemix: boolean | undefined;
|
||||
isThumbnail: boolean;
|
||||
isVideo: boolean;
|
||||
item: {
|
||||
file: File;
|
||||
platform: CloudUploadPlatform;
|
||||
origin: string;
|
||||
};
|
||||
loaded: number;
|
||||
mimeType: string;
|
||||
origin: string;
|
||||
postCompressionSize: number | undefined;
|
||||
preCompressionSize: number;
|
||||
responseUrl: string;
|
||||
sensitive: boolean;
|
||||
spoiler: boolean;
|
||||
startTime: number;
|
||||
status: "NOT_STARTED" | "STARTED" | "UPLOADING" | "ERROR" | "COMPLETED" | "CANCELLED" | "REMOVED_FROM_MSG_DRAFT";
|
||||
uniqueId: string;
|
||||
uploadedFilename: string;
|
||||
waveform: string | undefined;
|
||||
|
||||
// there are many more methods than just these but I didn't find them particularly useful
|
||||
upload(): Promise<void>;
|
||||
cancel(): void;
|
||||
delete(): Promise<void>;
|
||||
getSize(): number;
|
||||
maybeConvertToWebP(): Promise<void>;
|
||||
removeFromMsgDraft(): void;
|
||||
}
|
||||
1
packages/discord-types/src/modules/index.d.ts
vendored
Normal file
1
packages/discord-types/src/modules/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./CloudUpload";
|
||||
73
packages/discord-types/src/stores/AccessibilityStore.d.ts
vendored
Normal file
73
packages/discord-types/src/stores/AccessibilityStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export type ReducedMotionPreference = "auto" | "reduce" | "no-preference";
|
||||
export type ForcedColorsPreference = "none" | "active";
|
||||
export type ContrastPreference = "no-preference" | "more" | "less" | "custom";
|
||||
export type RoleStyle = "username" | "dot" | "hidden";
|
||||
|
||||
export interface AccessibilityState {
|
||||
fontSize: number;
|
||||
zoom: number;
|
||||
keyboardModeEnabled: boolean;
|
||||
contrastMode: string;
|
||||
colorblindMode: boolean;
|
||||
lowContrastMode: boolean;
|
||||
saturation: number;
|
||||
contrast: number;
|
||||
desaturateUserColors: boolean;
|
||||
forcedColorsModalSeen: boolean;
|
||||
keyboardNavigationExplainerModalSeen: boolean;
|
||||
messageGroupSpacing: number | null;
|
||||
systemPrefersReducedMotion: ReducedMotionPreference;
|
||||
systemPrefersCrossfades: boolean;
|
||||
prefersReducedMotion: ReducedMotionPreference;
|
||||
systemForcedColors: ForcedColorsPreference;
|
||||
syncForcedColors: boolean;
|
||||
systemPrefersContrast: ContrastPreference;
|
||||
alwaysShowLinkDecorations: boolean;
|
||||
roleStyle: RoleStyle;
|
||||
displayNameStylesEnabled: boolean;
|
||||
submitButtonEnabled: boolean;
|
||||
syncProfileThemeWithUserTheme: boolean;
|
||||
enableCustomCursor: boolean;
|
||||
switchIconsEnabled: boolean;
|
||||
}
|
||||
|
||||
export class AccessibilityStore extends FluxStore {
|
||||
get fontScale(): number;
|
||||
get fontSize(): number;
|
||||
get isFontScaledUp(): boolean;
|
||||
get isFontScaledDown(): boolean;
|
||||
get fontScaleClass(): string;
|
||||
get zoom(): number;
|
||||
get isZoomedIn(): boolean;
|
||||
get isZoomedOut(): boolean;
|
||||
get keyboardModeEnabled(): boolean;
|
||||
get colorblindMode(): boolean;
|
||||
get lowContrastMode(): boolean;
|
||||
get saturation(): number;
|
||||
get contrast(): number;
|
||||
get desaturateUserColors(): boolean;
|
||||
get forcedColorsModalSeen(): boolean;
|
||||
get keyboardNavigationExplainerModalSeen(): boolean;
|
||||
get messageGroupSpacing(): number;
|
||||
get isMessageGroupSpacingIncreased(): boolean;
|
||||
get isMessageGroupSpacingDecreased(): boolean;
|
||||
get isSubmitButtonEnabled(): boolean;
|
||||
get syncProfileThemeWithUserTheme(): boolean;
|
||||
get systemPrefersReducedMotion(): ReducedMotionPreference;
|
||||
get rawPrefersReducedMotion(): ReducedMotionPreference;
|
||||
get useReducedMotion(): boolean;
|
||||
get systemForcedColors(): ForcedColorsPreference;
|
||||
get syncForcedColors(): boolean;
|
||||
get useForcedColors(): boolean;
|
||||
get systemPrefersContrast(): ContrastPreference;
|
||||
get systemPrefersCrossfades(): boolean;
|
||||
get alwaysShowLinkDecorations(): boolean;
|
||||
get enableCustomCursor(): boolean;
|
||||
get roleStyle(): RoleStyle;
|
||||
get displayNameStylesEnabled(): boolean;
|
||||
get isHighContrastModeEnabled(): boolean;
|
||||
get isSwitchIconsEnabled(): boolean;
|
||||
getUserAgnosticState(): AccessibilityState;
|
||||
}
|
||||
33
packages/discord-types/src/stores/ActiveJoinedThreadsStore.d.ts
vendored
Normal file
33
packages/discord-types/src/stores/ActiveJoinedThreadsStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Channel, FluxStore } from "..";
|
||||
|
||||
export interface ThreadJoined {
|
||||
channel: Channel;
|
||||
joinTimestamp: number;
|
||||
}
|
||||
|
||||
export type ThreadsForParent = Record<string, ThreadJoined>;
|
||||
export type ThreadsForGuild = Record<string, ThreadsForParent>;
|
||||
export type AllActiveJoinedThreads = Record<string, ThreadsForGuild>;
|
||||
|
||||
export interface NewThreadCounts {
|
||||
[parentChannelId: string]: number;
|
||||
}
|
||||
|
||||
export class ActiveJoinedThreadsStore extends FluxStore {
|
||||
computeAllActiveJoinedThreads(guildId?: string | null): Channel[];
|
||||
getActiveJoinedRelevantThreadsForGuild(guildId: string): ThreadsForGuild;
|
||||
getActiveJoinedRelevantThreadsForParent(guildId: string, parentChannelId: string): ThreadsForParent;
|
||||
getActiveJoinedThreadsForGuild(guildId: string): ThreadsForGuild;
|
||||
getActiveJoinedThreadsForParent(guildId: string, parentChannelId: string): ThreadsForParent;
|
||||
getActiveJoinedUnreadThreadsForGuild(guildId: string): ThreadsForGuild;
|
||||
getActiveJoinedUnreadThreadsForParent(guildId: string, parentChannelId: string): ThreadsForParent;
|
||||
getActiveThreadCount(guildId: string, parentChannelId: string): number;
|
||||
getActiveUnjoinedThreadsForGuild(guildId: string): ThreadsForGuild;
|
||||
getActiveUnjoinedThreadsForParent(guildId: string, parentChannelId: string): ThreadsForParent;
|
||||
getActiveUnjoinedUnreadThreadsForGuild(guildId: string): ThreadsForGuild;
|
||||
getActiveUnjoinedUnreadThreadsForParent(guildId: string, parentChannelId: string): ThreadsForParent;
|
||||
getAllActiveJoinedThreads(): AllActiveJoinedThreads;
|
||||
getNewThreadCount(guildId: string, parentChannelId: string): number;
|
||||
getNewThreadCountsForGuild(guildId: string): NewThreadCounts;
|
||||
hasActiveJoinedUnreadThreads(guildId: string, parentChannelId: string): boolean;
|
||||
}
|
||||
23
packages/discord-types/src/stores/ApplicationStore.d.ts
vendored
Normal file
23
packages/discord-types/src/stores/ApplicationStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { Application, FluxStore } from "..";
|
||||
|
||||
export interface ApplicationStoreState {
|
||||
botUserIdToAppUsage: Record<string, ApplicationUsage>;
|
||||
}
|
||||
|
||||
export interface ApplicationUsage {
|
||||
applicationId: string;
|
||||
lastUsedMs: number;
|
||||
}
|
||||
|
||||
export class ApplicationStore extends FluxStore {
|
||||
getState(): ApplicationStoreState;
|
||||
getApplication(applicationId: string): Application;
|
||||
getApplicationByName(name: string): Application | undefined;
|
||||
getApplicationLastUpdated(applicationId: string): number | undefined;
|
||||
getGuildApplication(guildId: string, type: number): Application | undefined;
|
||||
getGuildApplicationIds(guildId: string): string[];
|
||||
getAppIdForBotUserId(botUserId: string): string | undefined;
|
||||
getFetchingOrFailedFetchingIds(): string[];
|
||||
isFetchingApplication(applicationId: string): boolean;
|
||||
didFetchingApplicationFail(applicationId: string): boolean;
|
||||
}
|
||||
11
packages/discord-types/src/stores/AuthenticationStore.d.ts
vendored
Normal file
11
packages/discord-types/src/stores/AuthenticationStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class AuthenticationStore extends FluxStore {
|
||||
/**
|
||||
* Gets the id of the current user
|
||||
*/
|
||||
getId(): string;
|
||||
getSessionId(): string;
|
||||
// This Store has a lot more methods related to everything Auth, but they really should
|
||||
// not be needed, so they are not typed
|
||||
}
|
||||
24
packages/discord-types/src/stores/CallStore.d.ts
vendored
Normal file
24
packages/discord-types/src/stores/CallStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface Call {
|
||||
channelId: string;
|
||||
messageId: string | null;
|
||||
region: string | null;
|
||||
ringing: string[];
|
||||
unavailable: boolean;
|
||||
regionUpdated: boolean;
|
||||
}
|
||||
|
||||
export interface CallStoreState {
|
||||
calls: Record<string, Call>;
|
||||
enqueuedRings: Record<string, string[]>;
|
||||
}
|
||||
|
||||
export class CallStore extends FluxStore {
|
||||
getCall(channelId: string): Call;
|
||||
getCalls(): Call[];
|
||||
getMessageId(channelId: string): string | null;
|
||||
isCallActive(channelId: string, messageId?: string): boolean;
|
||||
isCallUnavailable(channelId: string): boolean;
|
||||
getInternalState(): CallStoreState;
|
||||
}
|
||||
105
packages/discord-types/src/stores/ChannelRTCStore.d.ts
vendored
Normal file
105
packages/discord-types/src/stores/ChannelRTCStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
import { FluxStore, User, VoiceState } from "..";
|
||||
import { ParticipantType, RTCPlatform } from "../../enums";
|
||||
|
||||
export type RTCLayout = "normal" | "minimum" | "no-chat" | "full-screen" | "haven";
|
||||
export type RTCMode = "video" | "voice";
|
||||
export type RTCLayoutContext = "OVERLAY" | "APP" | "POPOUT" | "CALL_TILE_POPOUT";
|
||||
export type ParticipantFilterType = "VIDEO" | "STREAM" | "FILTERED" | "SPEAKING" | "ACTIVITY" | "NOT_POPPED_OUT";
|
||||
|
||||
export interface StreamResolution {
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
export interface Stream {
|
||||
channelId: string;
|
||||
guildId: string | null;
|
||||
ownerId: string;
|
||||
streamType: string;
|
||||
}
|
||||
|
||||
export interface BaseParticipant {
|
||||
id: string;
|
||||
type: ParticipantType;
|
||||
isPoppedOut?: boolean;
|
||||
}
|
||||
|
||||
export interface UserParticipant extends BaseParticipant {
|
||||
type: ParticipantType.USER;
|
||||
user: User;
|
||||
voiceState: VoiceState | null;
|
||||
voicePlatform: RTCPlatform | null;
|
||||
speaking: boolean;
|
||||
voiceDb: number;
|
||||
latched: boolean;
|
||||
lastSpoke: number;
|
||||
soundsharing: boolean;
|
||||
ringing: boolean;
|
||||
userNick: string;
|
||||
// TODO: type
|
||||
userAvatarDecoration: any | null;
|
||||
localVideoDisabled: boolean;
|
||||
userVideo?: boolean;
|
||||
streamId?: string;
|
||||
}
|
||||
|
||||
export interface StreamParticipant extends BaseParticipant {
|
||||
type: ParticipantType.STREAM | ParticipantType.HIDDEN_STREAM;
|
||||
user: User;
|
||||
userNick: string;
|
||||
userVideo: boolean;
|
||||
stream: Stream;
|
||||
maxResolution?: StreamResolution;
|
||||
maxFrameRate?: number;
|
||||
streamId?: string;
|
||||
}
|
||||
|
||||
export interface ActivityParticipant extends BaseParticipant {
|
||||
type: ParticipantType.ACTIVITY;
|
||||
applicationId: string;
|
||||
activityType: number;
|
||||
activityUrl: string;
|
||||
participants: string[];
|
||||
guildId: string | null;
|
||||
sortKey: string;
|
||||
}
|
||||
|
||||
export type Participant = UserParticipant | StreamParticipant | ActivityParticipant;
|
||||
|
||||
export interface SelectedParticipantStats {
|
||||
view_mode_grid_duration_ms?: number;
|
||||
view_mode_focus_duration_ms?: number;
|
||||
view_mode_toggle_count?: number;
|
||||
}
|
||||
|
||||
export interface ChannelRTCState {
|
||||
voiceParticipantsHidden: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export class ChannelRTCStore extends FluxStore {
|
||||
getActivityParticipants(channelId: string): ActivityParticipant[];
|
||||
getAllChatOpen(): Record<string, boolean>;
|
||||
getChatOpen(channelId: string): boolean;
|
||||
getFilteredParticipants(channelId: string): Participant[];
|
||||
getGuildRingingUsers(channelId: string): Set<string>;
|
||||
getLayout(channelId: string, context?: RTCLayoutContext): RTCLayout;
|
||||
getMode(channelId: string): RTCMode;
|
||||
getParticipant(channelId: string, participantId: string): Participant | null;
|
||||
getParticipants(channelId: string): Participant[];
|
||||
getParticipantsListOpen(channelId: string): boolean;
|
||||
getParticipantsOpen(channelId: string): boolean;
|
||||
getParticipantsVersion(channelId: string): number;
|
||||
getSelectedParticipant(channelId: string): Participant | null;
|
||||
getSelectedParticipantId(channelId: string): string | null;
|
||||
getSelectedParticipantStats(channelId: string): SelectedParticipantStats;
|
||||
getSpeakingParticipants(channelId: string): UserParticipant[];
|
||||
getStageStreamSize(channelId: string): StreamResolution | undefined;
|
||||
getStageVideoLimitBoostUpsellDismissed(channelId: string): boolean | undefined;
|
||||
getState(): ChannelRTCState;
|
||||
getStreamParticipants(channelId: string): StreamParticipant[];
|
||||
getUserParticipantCount(channelId: string): number;
|
||||
getVideoParticipants(channelId: string): UserParticipant[];
|
||||
getVoiceParticipantsHidden(channelId: string): boolean;
|
||||
isFullscreenInContext(): boolean;
|
||||
isParticipantPoppedOut(channelId: string, participantId: string): boolean;
|
||||
}
|
||||
31
packages/discord-types/src/stores/ChannelStore.d.ts
vendored
Normal file
31
packages/discord-types/src/stores/ChannelStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { Channel, FluxStore } from "..";
|
||||
|
||||
export class ChannelStore extends FluxStore {
|
||||
getChannel(channelId: string): Channel;
|
||||
getBasicChannel(channelId: string): Channel | undefined;
|
||||
hasChannel(channelId: string): boolean;
|
||||
|
||||
getChannelIds(guildId?: string | null): string[];
|
||||
getMutableBasicGuildChannelsForGuild(guildId: string): Record<string, Channel>;
|
||||
getMutableGuildChannelsForGuild(guildId: string): Record<string, Channel>;
|
||||
getAllThreadsForGuild(guildId: string): Channel[];
|
||||
getAllThreadsForParent(channelId: string): Channel[];
|
||||
getSortedLinkedChannelsForGuild(guildId: string): Channel[];
|
||||
|
||||
getDMFromUserId(userId: string): string;
|
||||
getDMChannelFromUserId(userId: string): Channel | undefined;
|
||||
getDMUserIds(): string[];
|
||||
getMutableDMsByUserIds(): Record<string, string>;
|
||||
getMutablePrivateChannels(): Record<string, Channel>;
|
||||
getSortedPrivateChannels(): Channel[];
|
||||
|
||||
getGuildChannelsVersion(guildId: string): number;
|
||||
getPrivateChannelsVersion(): number;
|
||||
getInitialOverlayState(): Record<string, Channel>;
|
||||
|
||||
getDebugInfo(): {
|
||||
loadedGuildIds: string[];
|
||||
pendingGuildLoads: string[];
|
||||
guildSizes: string[];
|
||||
};
|
||||
}
|
||||
34
packages/discord-types/src/stores/DraftStore.d.ts
vendored
Normal file
34
packages/discord-types/src/stores/DraftStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { FluxStore } from "..";
|
||||
import { DraftType } from "../../enums";
|
||||
|
||||
export interface Draft {
|
||||
timestamp: number;
|
||||
draft: string;
|
||||
}
|
||||
|
||||
export interface ThreadSettingsDraft {
|
||||
timestamp: number;
|
||||
parentMessageId?: string;
|
||||
name?: string;
|
||||
isPrivate?: boolean;
|
||||
parentChannelId?: string;
|
||||
location?: string;
|
||||
}
|
||||
|
||||
export type ChannelDrafts = {
|
||||
[DraftType.ThreadSettings]: ThreadSettingsDraft;
|
||||
} & {
|
||||
[key in Exclude<DraftType, DraftType.ThreadSettings>]: Draft;
|
||||
};
|
||||
|
||||
export type UserDrafts = Partial<Record<string, ChannelDrafts>>;
|
||||
export type DraftState = Partial<Record<string, UserDrafts>>;
|
||||
|
||||
export class DraftStore extends FluxStore {
|
||||
getState(): DraftState;
|
||||
getRecentlyEditedDrafts(type: DraftType): Array<Draft & { channelId: string; }>;
|
||||
getDraft(channelId: string, type: DraftType): string;
|
||||
|
||||
getThreadSettings(channelId: string): ThreadSettingsDraft | null | undefined;
|
||||
getThreadDraftWithParentMessageId(parentMessageId: string): ThreadSettingsDraft | null | undefined;
|
||||
}
|
||||
467
packages/discord-types/src/stores/EmojiStore.d.ts
vendored
Normal file
467
packages/discord-types/src/stores/EmojiStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,467 @@
|
|||
import { Channel, CustomEmoji, Emoji, FluxStore } from "..";
|
||||
import { EmojiIntention, LoadState } from "../../enums";
|
||||
|
||||
/** Emoji picker category names. */
|
||||
export type EmojiCategory =
|
||||
| "top guild emoji"
|
||||
| "favorites"
|
||||
| "recent"
|
||||
| "custom"
|
||||
| "people"
|
||||
| "nature"
|
||||
| "food"
|
||||
| "activity"
|
||||
| "travel"
|
||||
| "objects"
|
||||
| "symbols"
|
||||
| "flags";
|
||||
|
||||
/**
|
||||
* Tracks usage statistics for a single emoji to compute frecency scores.
|
||||
*/
|
||||
export interface EmojiUsageRecord {
|
||||
/** Total number of times this emoji has been used. */
|
||||
totalUses: number;
|
||||
/** Array of recent usage timestamps in milliseconds. */
|
||||
recentUses: number[];
|
||||
/** Computed frecency score combining frequency and recency, -1 when dirty. */
|
||||
frecency: number;
|
||||
/** Raw score before frecency computation. */
|
||||
score: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for tracking emoji usage.
|
||||
*/
|
||||
export interface TrackOptions {
|
||||
/** Timestamp of the usage in milliseconds. */
|
||||
timestamp?: number;
|
||||
/** Number of uses since last track call. */
|
||||
usesSinceLastTrack?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frecency tracker for emoji usage, combines frequency and recency to rank emojis.
|
||||
* Used by both regular emoji picker and reaction emoji picker.
|
||||
*/
|
||||
export interface EmojiFrecency {
|
||||
/** True when data has been modified and needs recomputation. */
|
||||
dirty: boolean;
|
||||
/** Cached array of frequently used emojis after computation. */
|
||||
_frequently: Emoji[];
|
||||
/** Maximum number of frequently used items to track (default 42). */
|
||||
numFrequentlyItems: number;
|
||||
/** Maximum number of recent usage samples to keep per emoji (default 10). */
|
||||
maxSamples: number;
|
||||
/** Computes bonus score for frecency calculation (returns 100). */
|
||||
computeBonus: () => number;
|
||||
/**
|
||||
* Computes weight multiplier based on recency index.
|
||||
* Returns 100 for index <= 3, 70 for <= 15, 50 for <= 30, 30 for <= 45, 10 for <= 80.
|
||||
*/
|
||||
computeWeight: (index: number) => number;
|
||||
/**
|
||||
* Computes frecency score for an emoji.
|
||||
* @param totalUses Total number of times emoji was used.
|
||||
* @param score Raw score value.
|
||||
* @param config Configuration for frecency calculation.
|
||||
*/
|
||||
computeFrecency: (totalUses: number, score: number, config: {
|
||||
/** Number of recent uses to consider. */
|
||||
numOfRecentUses?: number;
|
||||
/** Maximum total uses to cap at. */
|
||||
maxTotalUse?: number;
|
||||
}) => number;
|
||||
/** Whether to calculate max total use dynamically. */
|
||||
calculateMaxTotalUse: boolean;
|
||||
/**
|
||||
* Looks up an emoji by name or id.
|
||||
* @param name Emoji name or id to look up.
|
||||
* @returns The emoji if found.
|
||||
*/
|
||||
lookupKey: (name: string) => Emoji | undefined;
|
||||
/** Usage history keyed by emoji name (for unicode) or id (for custom). */
|
||||
usageHistory: Record<string, EmojiUsageRecord>;
|
||||
/** Callback invoked after frecency computation completes. */
|
||||
afterCompute: () => void;
|
||||
|
||||
/**
|
||||
* Overwrites the usage history with new data.
|
||||
* @param history New usage history to set.
|
||||
* @param pendingUsages Pending usages to track after overwriting.
|
||||
*/
|
||||
overwriteHistory(history: Record<string, EmojiUsageRecord> | null, pendingUsages?: PendingUsage[]): void;
|
||||
/** Marks the frecency data as dirty, requiring recomputation. */
|
||||
markDirty(): void;
|
||||
/** Returns whether the frecency data needs recomputation. */
|
||||
isDirty(): boolean;
|
||||
/**
|
||||
* Tracks usage of an emoji.
|
||||
* @param key Emoji name or id.
|
||||
* @param options Track options including timestamp.
|
||||
*/
|
||||
track(key: string, options?: TrackOptions): void;
|
||||
/**
|
||||
* Gets the usage record for an emoji, computing if dirty.
|
||||
* @param key Emoji name or id.
|
||||
* @returns The usage record or null if not found.
|
||||
*/
|
||||
getEntry(key: string): EmojiUsageRecord | null;
|
||||
/**
|
||||
* Gets the score for an emoji.
|
||||
* @param key Emoji name or id.
|
||||
* @returns The score or null if not found.
|
||||
*/
|
||||
getScore(key: string): number | null;
|
||||
/**
|
||||
* Gets the frecency for an emoji.
|
||||
* @param key Emoji name or id.
|
||||
* @returns The frecency or null if not found.
|
||||
*/
|
||||
getFrecency(key: string): number | null;
|
||||
/** Recomputes frecency scores for all emojis. */
|
||||
compute(): void;
|
||||
/** Gets the frequently used emojis, computing if necessary. */
|
||||
get frequently(): Emoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Container for a guild's emoji collection with usability checks.
|
||||
*/
|
||||
export interface GuildEmojis {
|
||||
/** Guild id this emoji collection belongs to. */
|
||||
id: string;
|
||||
/** User id for permission checks. */
|
||||
_userId: string;
|
||||
/** Internal emoji array. */
|
||||
_emojis: CustomEmoji[];
|
||||
/** Fast lookup map of emoji id to emoji. */
|
||||
_emojiMap: Record<string, CustomEmoji>;
|
||||
/** Internal emoticons array. */
|
||||
_emoticons: Emoticon[];
|
||||
/** Internal usable emojis cache. */
|
||||
_usableEmojis: CustomEmoji[];
|
||||
/** Whether user can see server subscription IAP. */
|
||||
_canSeeServerSubIAP: boolean;
|
||||
/** All custom emojis in this guild. */
|
||||
get emojis(): CustomEmoji[];
|
||||
/** Custom emojis the current user can use in this guild. */
|
||||
get usableEmojis(): CustomEmoji[];
|
||||
/** Text emoticons configured for this guild. */
|
||||
get emoticons(): Emoticon[];
|
||||
/**
|
||||
* Gets an emoji by id from this guild.
|
||||
* @param id Emoji id to look up.
|
||||
*/
|
||||
getEmoji(id: string): CustomEmoji | undefined;
|
||||
/**
|
||||
* Gets a usable emoji by id from this guild.
|
||||
* @param id Emoji id to look up.
|
||||
*/
|
||||
getUsableEmoji(id: string): CustomEmoji | undefined;
|
||||
/**
|
||||
* Checks if an emoji is usable by the current user.
|
||||
* @param emoji Emoji to check.
|
||||
*/
|
||||
isUsable(emoji: CustomEmoji): boolean;
|
||||
/** Returns array of all emoji ids in this guild. */
|
||||
emojiIds(): string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Text emoticon that can be converted to emoji.
|
||||
*/
|
||||
export interface Emoticon {
|
||||
/** Names/aliases for this emoticon. */
|
||||
names: string[];
|
||||
/** The text representation (e.g. ":)" or ":D"). */
|
||||
surrogates: string;
|
||||
/** Whether this emoticon should use sprite sheet rendering. */
|
||||
useSpriteSheet: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pending emoji usage waiting to be recorded.
|
||||
*/
|
||||
export interface PendingUsage {
|
||||
/** Emoji key (name for unicode, id for custom). */
|
||||
key: string;
|
||||
/** Timestamp in milliseconds when usage occurred. */
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializable state for EmojiStore persistence.
|
||||
*/
|
||||
export interface EmojiStoreState {
|
||||
/** Pending emoji usages not yet committed. */
|
||||
pendingUsages: PendingUsage[];
|
||||
/** Pending reaction emoji usages not yet committed. */
|
||||
emojiReactionPendingUsages: PendingUsage[];
|
||||
/** Guild ids with expanded emoji sections in picker. */
|
||||
expandedSectionsByGuildIds: Set<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Context for emoji disambiguation, caching resolved emoji data for a guild context.
|
||||
* Provides fast lookup of emojis without triggering data fetches.
|
||||
*/
|
||||
export interface DisambiguatedEmojiContext {
|
||||
/** User's favorite emojis or null if not loaded. */
|
||||
favorites: Emoji[] | null;
|
||||
/** Set of favorite emoji names and ids for fast lookup, or null if not loaded. */
|
||||
favoriteNamesAndIds: Set<string> | null;
|
||||
/** Top emojis for the current guild or null if not loaded. */
|
||||
topEmojis: Emoji[] | null;
|
||||
/** Current guild id context or null for DMs. */
|
||||
guildId: string | null;
|
||||
/** Regex-escaped emoticon names for matching. */
|
||||
escapedEmoticonNames: string;
|
||||
/** All emojis with disambiguation applied (unique names). */
|
||||
disambiguatedEmoji: Emoji[];
|
||||
/** Compiled regex for matching emoticons or null if none. */
|
||||
emoticonRegex: RegExp | null;
|
||||
/** Frequently used emojis or null if not loaded. */
|
||||
frequentlyUsed: Emoji[] | null;
|
||||
/** Frequently used reaction emojis or null if not loaded. */
|
||||
frequentlyUsedReactionEmojis: Emoji[] | null;
|
||||
/** Set of frequently used reaction emoji names and ids, or null if not loaded. */
|
||||
frequentlyUsedReactionNamesAndIds: Set<string> | null;
|
||||
/** Unicode emoji aliases keyed by alias name, maps to primary name. */
|
||||
unicodeAliases: Record<string, string>;
|
||||
/** Custom emojis keyed by emoji id. */
|
||||
customEmojis: Record<string, CustomEmoji>;
|
||||
/** Custom emojis grouped by guild id. */
|
||||
groupedCustomEmojis: Record<string, CustomEmoji[]>;
|
||||
/** Emoticons keyed by name for fast lookup. */
|
||||
emoticonsByName: Record<string, Emoticon>;
|
||||
/** All emojis keyed by name for fast lookup. */
|
||||
emojisByName: Record<string, Emoji>;
|
||||
/** Custom emojis keyed by id for fast lookup. */
|
||||
emojisById: Record<string, CustomEmoji>;
|
||||
/** Newly added emojis grouped by guild id. */
|
||||
newlyAddedEmoji: Record<string, CustomEmoji[]>;
|
||||
/**
|
||||
* Checks if an emoji is a favorite without triggering a fetch.
|
||||
* @param emoji Emoji to check.
|
||||
*/
|
||||
isFavoriteEmojiWithoutFetchingLatest(emoji: Emoji): boolean;
|
||||
|
||||
/** Gets favorite emojis without triggering a fetch. */
|
||||
get favoriteEmojisWithoutFetchingLatest(): Emoji[];
|
||||
/** Gets all disambiguated emojis. */
|
||||
getDisambiguatedEmoji(): Emoji[];
|
||||
/** Gets all custom emojis keyed by name. */
|
||||
getCustomEmoji(): Record<string, CustomEmoji>;
|
||||
/** Gets custom emojis grouped by guild id. */
|
||||
getGroupedCustomEmoji(): Record<string, CustomEmoji[]>;
|
||||
/**
|
||||
* Gets an emoji by name.
|
||||
* @param name Emoji name to look up.
|
||||
*/
|
||||
getByName(name: string): Emoji | undefined;
|
||||
/**
|
||||
* Gets an emoticon by name.
|
||||
* @param name Emoticon name to look up.
|
||||
*/
|
||||
getEmoticonByName(name: string): Emoticon | undefined;
|
||||
/**
|
||||
* Gets an emoji by id.
|
||||
* @param id Emoji id to look up.
|
||||
*/
|
||||
getById(id: string): Emoji | undefined;
|
||||
/**
|
||||
* Gets the regex for matching custom emoticons.
|
||||
* @returns RegExp or null if no emoticons.
|
||||
*/
|
||||
getCustomEmoticonRegex(): RegExp | null;
|
||||
/** Gets frequently used emojis without triggering a fetch. */
|
||||
getFrequentlyUsedEmojisWithoutFetchingLatest(): Emoji[];
|
||||
/** Rebuilds the frequently used reaction emojis cache and returns it. */
|
||||
rebuildFrequentlyUsedReactionsEmojisWithoutFetchingLatest(): {
|
||||
frequentlyUsedReactionEmojis: Emoji[];
|
||||
frequentlyUsedReactionNamesAndIds: Set<string>;
|
||||
};
|
||||
/** Gets frequently used reaction emojis without triggering a fetch. */
|
||||
getFrequentlyUsedReactionEmojisWithoutFetchingLatest(): Emoji[];
|
||||
/**
|
||||
* Checks if an emoji is frequently used for reactions.
|
||||
* @param emoji Emoji to check.
|
||||
*/
|
||||
isFrequentlyUsedReactionEmojiWithoutFetchingLatest(emoji: Emoji): boolean;
|
||||
/** Rebuilds the favorite emojis cache and returns it. */
|
||||
rebuildFavoriteEmojisWithoutFetchingLatest(): {
|
||||
favorites: Emoji[];
|
||||
favoriteNamesAndIds: Set<string>;
|
||||
};
|
||||
/**
|
||||
* Gets emojis in priority order (favorites, frequent, top) without fetching.
|
||||
* @returns Array of emojis in priority order.
|
||||
*/
|
||||
getEmojiInPriorityOrderWithoutFetchingLatest(): Emoji[];
|
||||
/**
|
||||
* Gets top emojis for a guild without triggering a fetch.
|
||||
* @param guildId Guild id to get top emojis for.
|
||||
*/
|
||||
getTopEmojiWithoutFetchingLatest(guildId: string): Emoji[];
|
||||
/**
|
||||
* Gets newly added emojis for a specific guild.
|
||||
* @param guildId Guild id.
|
||||
*/
|
||||
getNewlyAddedEmojiForGuild(guildId: string): CustomEmoji[];
|
||||
/** Gets escaped custom emoticon names for regex matching. */
|
||||
getEscapedCustomEmoticonNames(): string;
|
||||
/**
|
||||
* Checks if a name matches an emoji name chain.
|
||||
* @param name Name to match.
|
||||
*/
|
||||
nameMatchesChain(name: string): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search options for emoji search.
|
||||
*/
|
||||
export interface EmojiSearchOptions {
|
||||
/** Channel context for permission checks. */
|
||||
channel: Channel;
|
||||
/** Search query string. */
|
||||
query: string;
|
||||
/** Maximum number of results to return. */
|
||||
count?: number;
|
||||
/** Intention for using the emoji, affects availability filtering. */
|
||||
intention: EmojiIntention;
|
||||
/** Whether to include emojis from guilds the user is not in. */
|
||||
includeExternalGuilds?: boolean;
|
||||
/** Whether to only show unicode emojis in results. */
|
||||
showOnlyUnicode?: boolean;
|
||||
/**
|
||||
* Custom comparator for matching emoji names.
|
||||
* @param name Emoji name to compare.
|
||||
* @returns True if the name matches.
|
||||
*/
|
||||
matchComparator?(name: string): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search results split by availability.
|
||||
*/
|
||||
export interface EmojiSearchResults {
|
||||
/** Emojis that are locked (require Nitro or permissions). */
|
||||
locked: Emoji[];
|
||||
/** Emojis that are available for use. */
|
||||
unlocked: Emoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Metadata about top emojis for a guild.
|
||||
*/
|
||||
export interface TopEmojisMetadata {
|
||||
/** Array of top emoji ids. */
|
||||
emojiIds: string[];
|
||||
/** Time-to-live for this data in milliseconds. */
|
||||
topEmojisTTL: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flux store managing all emoji data including custom guild emojis,
|
||||
* unicode emojis, favorites, frecency, and search functionality.
|
||||
*/
|
||||
export class EmojiStore extends FluxStore {
|
||||
/** Array of emoji category names for the picker. */
|
||||
get categories(): EmojiCategory[];
|
||||
/**
|
||||
* Current skin tone modifier surrogate for emoji diversity.
|
||||
* Empty string for default yellow, or skin tone modifier (🏻🏼🏽🏾🏿).
|
||||
*/
|
||||
get diversitySurrogate(): string;
|
||||
/** Frecency tracker for emoji picker usage. */
|
||||
get emojiFrecencyWithoutFetchingLatest(): EmojiFrecency;
|
||||
/** Frecency tracker for reaction emoji usage. */
|
||||
get emojiReactionFrecencyWithoutFetchingLatest(): EmojiFrecency;
|
||||
/** Guild ids with expanded emoji sections in picker. */
|
||||
get expandedSectionsByGuildIds(): Set<string>;
|
||||
/** Current load state of the emoji store. */
|
||||
get loadState(): LoadState;
|
||||
|
||||
/**
|
||||
* Gets a custom emoji by its id.
|
||||
* @param id Emoji id to look up.
|
||||
* @returns The custom emoji if found.
|
||||
*/
|
||||
getCustomEmojiById(id?: string | null): CustomEmoji | undefined;
|
||||
/**
|
||||
* Gets a usable custom emoji by its id.
|
||||
* @param id Emoji id to look up.
|
||||
* @returns The custom emoji if found and usable by current user.
|
||||
*/
|
||||
getUsableCustomEmojiById(id?: string | null): CustomEmoji | undefined;
|
||||
/**
|
||||
* Gets all guild emoji collections keyed by guild id.
|
||||
* @returns Record of guild id to GuildEmojis.
|
||||
*/
|
||||
getGuilds(): Record<string, GuildEmojis>;
|
||||
/**
|
||||
* Gets all custom emojis for a guild.
|
||||
* @param guildId Guild id to get emojis for, or null for all guilds.
|
||||
* @returns Array of custom emojis.
|
||||
*/
|
||||
getGuildEmoji(guildId?: string | null): CustomEmoji[];
|
||||
/**
|
||||
* Gets usable custom emojis for a guild.
|
||||
* @param guildId Guild id to get emojis for.
|
||||
* @returns Array of usable custom emojis.
|
||||
*/
|
||||
getUsableGuildEmoji(guildId?: string | null): CustomEmoji[];
|
||||
/**
|
||||
* Gets newly added emojis for a guild.
|
||||
* @param guildId Guild id to get emojis for.
|
||||
* @returns Array of newly added custom emojis.
|
||||
*/
|
||||
getNewlyAddedEmoji(guildId?: string | null): CustomEmoji[];
|
||||
/**
|
||||
* Gets top emojis for a guild based on usage.
|
||||
* @param guildId Guild id to get emojis for.
|
||||
* @returns Array of top custom emojis.
|
||||
*/
|
||||
getTopEmoji(guildId?: string | null): CustomEmoji[];
|
||||
/**
|
||||
* Gets metadata about top emojis for a guild.
|
||||
* @param guildId Guild id to get metadata for.
|
||||
* @returns Metadata including emoji ids and TTL, or undefined if not cached.
|
||||
*/
|
||||
getTopEmojisMetadata(guildId?: string | null): TopEmojisMetadata | undefined;
|
||||
/**
|
||||
* Checks if user has any favorite emojis in a guild context.
|
||||
* @param guildId Guild id to check.
|
||||
* @returns True if user has favorites.
|
||||
*/
|
||||
hasFavoriteEmojis(guildId?: string | null): boolean;
|
||||
/**
|
||||
* Checks if there are pending emoji usages to be recorded.
|
||||
* @returns True if there are pending usages.
|
||||
*/
|
||||
hasPendingUsage(): boolean;
|
||||
/**
|
||||
* Checks if user has any usable custom emojis in any guild.
|
||||
* @returns True if user has usable emojis.
|
||||
*/
|
||||
hasUsableEmojiInAnyGuild(): boolean;
|
||||
/** Internal method for ordering search results. */
|
||||
getSearchResultsOrder(...args: any[]): any;
|
||||
/**
|
||||
* Gets the serializable state for persistence.
|
||||
* @returns Current store state.
|
||||
*/
|
||||
getState(): EmojiStoreState;
|
||||
/**
|
||||
* Searches for emojis without triggering data fetches.
|
||||
* @param options Search options including query and filters.
|
||||
* @returns Search results split by locked/unlocked.
|
||||
*/
|
||||
searchWithoutFetchingLatest(options: EmojiSearchOptions): EmojiSearchResults;
|
||||
/**
|
||||
* Gets the disambiguated emoji context for a guild.
|
||||
* @param guildId Guild id to get context for, or null/undefined for global context.
|
||||
*/
|
||||
getDisambiguatedEmojiContext(guildId?: string | null): DisambiguatedEmojiContext;
|
||||
}
|
||||
89
packages/discord-types/src/stores/FluxStore.d.ts
vendored
Normal file
89
packages/discord-types/src/stores/FluxStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import { FluxDispatcher, FluxEvents } from "..";
|
||||
|
||||
type Callback = () => void;
|
||||
type SyncCallback = () => boolean | void;
|
||||
|
||||
/*
|
||||
For some reason, this causes type errors when you try to destructure it:
|
||||
```ts
|
||||
interface FluxEvent {
|
||||
type: FluxEvents;
|
||||
[key: string]: any;
|
||||
}
|
||||
```
|
||||
*/
|
||||
export type FluxEvent = any;
|
||||
|
||||
export type ActionHandler = (event: FluxEvent) => void;
|
||||
/** keyed by FluxEvents action type */
|
||||
export type ActionHandlers = Partial<Record<FluxEvents, ActionHandler>>;
|
||||
|
||||
/**
|
||||
* Base class for all Discord Flux stores.
|
||||
* Provides change notification, action handling, and store synchronization.
|
||||
*/
|
||||
export class FluxStore {
|
||||
/**
|
||||
* @param dispatcher the FluxDispatcher instance to register with
|
||||
* @param actionHandlers handlers for Flux actions, keyed by action type
|
||||
* @param band priority band for action handling (default 2), lower runs first
|
||||
*/
|
||||
constructor(dispatcher: FluxDispatcher, actionHandlers?: ActionHandlers, band?: number);
|
||||
|
||||
/** returns displayName if set, otherwise constructor.name */
|
||||
getName(): string;
|
||||
|
||||
/** adds listener to _changeCallbacks, invoked before react listeners and triggers syncWith processing */
|
||||
addChangeListener(callback: Callback): void;
|
||||
/**
|
||||
* adds a listener that auto-removes when callback returns false.
|
||||
* @param callback returning false removes the listener
|
||||
* @param preemptive if true (default), calls callback immediately and skips adding if it returns false
|
||||
*/
|
||||
addConditionalChangeListener(callback: () => boolean, preemptive?: boolean): void;
|
||||
/** adds listener to _reactChangeCallbacks, invoked after all regular change listeners complete */
|
||||
addReactChangeListener(callback: Callback): void;
|
||||
removeChangeListener(callback: Callback): void;
|
||||
removeReactChangeListener(callback: Callback): void;
|
||||
|
||||
/** called by dispatcher after action handlers run, marks changed if listeners exist and may resume paused dispatch */
|
||||
doEmitChanges(event: FluxEvent): void;
|
||||
/** marks store as changed for batched listener notification */
|
||||
emitChange(): void;
|
||||
|
||||
/** unique token identifying this store in the dispatcher */
|
||||
getDispatchToken(): string;
|
||||
/** override to set up initial state, called once by initializeIfNeeded */
|
||||
initialize(): void;
|
||||
/** calls initialize() if not already initialized, adds performance mark if init takes >5ms */
|
||||
initializeIfNeeded(): void;
|
||||
/**
|
||||
* sets callback to determine if changes must emit during paused dispatch.
|
||||
* @param callback if omitted, defaults to () => true (always emit)
|
||||
*/
|
||||
mustEmitChanges(callback?: ActionHandler): void;
|
||||
/**
|
||||
* registers additional action handlers after construction.
|
||||
* @param actionHandlers handlers keyed by action type
|
||||
* @param band priority band, lower runs first
|
||||
*/
|
||||
registerActionHandlers(actionHandlers: ActionHandlers, band?: number): void;
|
||||
/**
|
||||
* syncs this store with other stores, re-emitting when they change.
|
||||
* without timeout: synchronous, callback runs during emitNonReactOnce.
|
||||
* with timeout: debounced, adds regular change listener to each source store.
|
||||
* @param stores stores to sync with
|
||||
* @param callback returning false skips emitChange on this store
|
||||
* @param timeout if provided, debounces the sync callback
|
||||
*/
|
||||
syncWith(stores: FluxStore[], callback: SyncCallback, timeout?: number): void;
|
||||
/** adds dispatcher dependencies so this store's handlers run after the specified stores */
|
||||
waitFor(...stores: FluxStore[]): void;
|
||||
|
||||
/** initializes all registered stores, called once at app startup */
|
||||
static initialize(): void;
|
||||
/** clears all registered stores and destroys the change listener system */
|
||||
static destroy(): void;
|
||||
/** returns all registered FluxStore instances */
|
||||
static getAll(): FluxStore[];
|
||||
}
|
||||
67
packages/discord-types/src/stores/FriendsStore.d.ts
vendored
Normal file
67
packages/discord-types/src/stores/FriendsStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
import { Activity, FluxStore, Guild, User } from "..";
|
||||
import { GiftIntentType, RelationshipType } from "../../enums";
|
||||
|
||||
export type FriendsSection = "ADD_FRIEND" | "ALL" | "ONLINE" | "PENDING" | "PENDING_IGNORED" | "SPAM" | "SUGGESTIONS";
|
||||
|
||||
export type StatusType = "online" | "offline" | "idle" | "dnd" | "invisible" | "streaming" | "unknown";
|
||||
|
||||
export interface ApplicationStream {
|
||||
channelId: string;
|
||||
guildId: string | null;
|
||||
ownerId: string;
|
||||
streamType: string;
|
||||
}
|
||||
|
||||
export interface FriendsRow {
|
||||
key: string;
|
||||
userId: string;
|
||||
/**
|
||||
* 99 means contact based friend suggestions from FriendSuggestionStore,
|
||||
* shown in SUGGESTIONS tab. different from RelationshipType.SUGGESTION
|
||||
* which is for implicit suggestions in RelationshipStore
|
||||
*/
|
||||
type: RelationshipType | 99;
|
||||
status: StatusType;
|
||||
isMobile: boolean;
|
||||
activities: Activity[];
|
||||
applicationStream: ApplicationStream | null;
|
||||
user: User | null;
|
||||
usernameLower: string | null;
|
||||
mutualGuildsLength: number;
|
||||
mutualGuilds: Guild[];
|
||||
nickname: string | null;
|
||||
spam: boolean;
|
||||
giftIntentType: GiftIntentType | undefined;
|
||||
ignoredUser: boolean;
|
||||
applicationId: string | undefined;
|
||||
isGameRelationship: boolean;
|
||||
comparator: [RelationshipType | 99, string | null];
|
||||
}
|
||||
|
||||
export interface RelationshipCounts {
|
||||
[RelationshipType.FRIEND]: number;
|
||||
[RelationshipType.INCOMING_REQUEST]: number;
|
||||
[RelationshipType.OUTGOING_REQUEST]: number;
|
||||
[RelationshipType.BLOCKED]: number;
|
||||
/** contact based friend suggestions from FriendSuggestionStore */
|
||||
99: number;
|
||||
}
|
||||
|
||||
export interface FriendsRows {
|
||||
_rows: FriendsRow[];
|
||||
reset(): FriendsRows;
|
||||
clone(): FriendsRows;
|
||||
update(updater: (userId: string) => Partial<FriendsRow>): boolean;
|
||||
filter(section: FriendsSection, searchQuery?: string | null): FriendsRow[];
|
||||
getRelationshipCounts(): RelationshipCounts;
|
||||
}
|
||||
|
||||
export interface FriendsState {
|
||||
fetching: boolean;
|
||||
section: FriendsSection;
|
||||
rows: FriendsRows;
|
||||
}
|
||||
|
||||
export class FriendsStore extends FluxStore {
|
||||
getState(): FriendsState;
|
||||
}
|
||||
46
packages/discord-types/src/stores/GuildChannelStore.d.ts
vendored
Normal file
46
packages/discord-types/src/stores/GuildChannelStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import { Channel, FluxStore, ThreadJoined } from "..";
|
||||
import { ChannelType } from "../../enums";
|
||||
|
||||
export interface ChannelWithComparator {
|
||||
channel: Channel;
|
||||
comparator: number;
|
||||
}
|
||||
|
||||
export interface GuildChannels {
|
||||
[ChannelType.GUILD_CATEGORY]: ChannelWithComparator[];
|
||||
id: string;
|
||||
SELECTABLE: ChannelWithComparator[] | ThreadJoined[];
|
||||
VOCAL: ChannelWithComparator[];
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface ChannelNameDisambiguation {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class GuildChannelStore extends FluxStore {
|
||||
getAllGuilds(): Record<string, GuildChannels>;
|
||||
getChannels(guildId: string): GuildChannels;
|
||||
getDefaultChannel(guildId: string): Channel | null;
|
||||
getDirectoryChannelIds(guildId: string): string[];
|
||||
getFirstChannel(
|
||||
guildId: string,
|
||||
predicate: (item: ChannelWithComparator) => boolean,
|
||||
includeVocal?: boolean
|
||||
): Channel | null;
|
||||
getFirstChannelOfType(
|
||||
guildId: string,
|
||||
predicate: (item: ChannelWithComparator) => boolean,
|
||||
type: "SELECTABLE" | "VOCAL" | ChannelType.GUILD_CATEGORY
|
||||
): Channel | null;
|
||||
getSFWDefaultChannel(guildId: string): Channel | null;
|
||||
getSelectableChannelIds(guildId: string): string[];
|
||||
getSelectableChannels(guildId: string): ChannelWithComparator[];
|
||||
getTextChannelNameDisambiguations(guildId: string): Record<string, ChannelNameDisambiguation>;
|
||||
getVocalChannelIds(guildId: string): string[];
|
||||
hasCategories(guildId: string): boolean;
|
||||
hasChannels(guildId: string): boolean;
|
||||
hasElevatedPermissions(guildId: string): boolean;
|
||||
hasSelectableChannel(guildId: string, channelId: string): boolean;
|
||||
}
|
||||
7
packages/discord-types/src/stores/GuildMemberCountStore.d.ts
vendored
Normal file
7
packages/discord-types/src/stores/GuildMemberCountStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class GuildMemberCountStore extends FluxStore {
|
||||
getMemberCounts(): Record<string, number>;
|
||||
getMemberCount(guildId: string): number;
|
||||
getOnlineCount(guildId: string): number;
|
||||
}
|
||||
35
packages/discord-types/src/stores/GuildMemberStore.d.ts
vendored
Normal file
35
packages/discord-types/src/stores/GuildMemberStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { FluxStore, GuildMember } from "..";
|
||||
|
||||
export interface PendingRoleUpdates {
|
||||
added: string[];
|
||||
removed: string[];
|
||||
}
|
||||
|
||||
export class GuildMemberStore extends FluxStore {
|
||||
/** @returns Format: [guildId-userId: Timestamp (string)] */
|
||||
getCommunicationDisabledUserMap(): Record<string, string>;
|
||||
getCommunicationDisabledVersion(): number;
|
||||
|
||||
getMutableAllGuildsAndMembers(): Record<string, Record<string, GuildMember>>;
|
||||
|
||||
getMember(guildId: string, userId: string): GuildMember | null;
|
||||
getTrueMember(guildId: string, userId: string): GuildMember | null;
|
||||
getMemberIds(guildId: string): string[];
|
||||
getMembers(guildId: string): GuildMember[];
|
||||
getMemberVersion(): number;
|
||||
getMemberRoleWithPendingUpdates(guildId: string, userId: string): string[];
|
||||
getPendingRoleUpdates(guildId: string): PendingRoleUpdates;
|
||||
memberOf(userId: string): string[];
|
||||
|
||||
getCachedSelfMember(guildId: string): GuildMember | null;
|
||||
getSelfMember(guildId: string): GuildMember | null;
|
||||
getSelfMemberJoinedAt(guildId: string): Date | null;
|
||||
|
||||
getNick(guildId: string, userId: string): string | null;
|
||||
getNicknameGuildsMapping(userId: string): Record<string, string[]>;
|
||||
getNicknames(userId: string): string[];
|
||||
|
||||
isMember(guildId: string, userId: string): boolean;
|
||||
isGuestOrLurker(guildId: string, userId: string): boolean;
|
||||
isCurrentUserGuest(guildId: string): boolean;
|
||||
}
|
||||
13
packages/discord-types/src/stores/GuildRoleStore.d.ts
vendored
Normal file
13
packages/discord-types/src/stores/GuildRoleStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { FluxStore, Guild, Role } from "..";
|
||||
|
||||
export class GuildRoleStore extends FluxStore {
|
||||
getRolesSnapshot(guildId: string): Record<string, Role>;
|
||||
getSortedRoles(guildId: string): Role[];
|
||||
|
||||
getEveryoneRole(guild: Guild): Role;
|
||||
getManyRoles(guildId: string, roleIds: string[]): Role[];
|
||||
getNumRoles(guildId: string): number;
|
||||
getRole(guildId: string, roleId: string): Role;
|
||||
getUnsafeMutableRoles(guildId: string): Record<string, Role>;
|
||||
serializeAllGuildRoles(): Array<{ partitionKey: string; values: Record<string, Role>; }>;
|
||||
}
|
||||
67
packages/discord-types/src/stores/GuildScheduledEventStore.d.ts
vendored
Normal file
67
packages/discord-types/src/stores/GuildScheduledEventStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
import { FluxStore } from "..";
|
||||
import { GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus } from "../../enums";
|
||||
|
||||
export interface GuildScheduledEventEntityMetadata {
|
||||
location?: string;
|
||||
}
|
||||
|
||||
export interface GuildScheduledEventRecurrenceRule {
|
||||
start: string;
|
||||
end: string | null;
|
||||
frequency: number;
|
||||
interval: number;
|
||||
byWeekday: number[] | null;
|
||||
byNWeekday: { n: number; day: number; }[] | null;
|
||||
byMonth: number[] | null;
|
||||
byMonthDay: number[] | null;
|
||||
byYearDay: number[] | null;
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
export interface GuildScheduledEvent {
|
||||
id: string;
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
creator_id: string | null;
|
||||
name: string;
|
||||
description: string | null;
|
||||
image: string | null;
|
||||
scheduled_start_time: string;
|
||||
scheduled_end_time: string | null;
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
status: GuildScheduledEventStatus;
|
||||
entity_type: GuildScheduledEventEntityType;
|
||||
entity_id: string | null;
|
||||
entity_metadata: GuildScheduledEventEntityMetadata | null;
|
||||
sku_ids: string[];
|
||||
recurrence_rule: GuildScheduledEventRecurrenceRule | null;
|
||||
// TODO: type
|
||||
guild_scheduled_event_exceptions: any[];
|
||||
auto_start: boolean;
|
||||
}
|
||||
|
||||
export interface GuildScheduledEventRsvp {
|
||||
guildScheduledEventId: string;
|
||||
userId: string;
|
||||
interested: boolean;
|
||||
}
|
||||
|
||||
export interface GuildScheduledEventUsers {
|
||||
// TODO: finish typing
|
||||
[userId: string]: any;
|
||||
}
|
||||
|
||||
export class GuildScheduledEventStore extends FluxStore {
|
||||
getGuildScheduledEvent(eventId: string): GuildScheduledEvent | null;
|
||||
getGuildScheduledEventsForGuild(guildId: string): GuildScheduledEvent[];
|
||||
getGuildScheduledEventsByIndex(status: GuildScheduledEventStatus): GuildScheduledEvent[];
|
||||
getGuildEventCountByIndex(status: GuildScheduledEventStatus): number;
|
||||
getRsvpVersion(): number;
|
||||
getRsvp(eventId: string, recurrenceId: string | null, userId: string | null): GuildScheduledEventRsvp | null;
|
||||
isInterestedInEventRecurrence(eventId: string, recurrenceId: string | null): boolean;
|
||||
getUserCount(eventId: string, recurrenceId: string | null): number;
|
||||
hasUserCount(eventId: string, recurrenceId: string | null): boolean;
|
||||
isActive(eventId: string): boolean;
|
||||
getActiveEventByChannel(channelId: string): GuildScheduledEvent | null;
|
||||
getUsersForGuildEvent(eventId: string, recurrenceId: string | null): GuildScheduledEventUsers;
|
||||
}
|
||||
9
packages/discord-types/src/stores/GuildStore.d.ts
vendored
Normal file
9
packages/discord-types/src/stores/GuildStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { Guild, FluxStore } from "..";
|
||||
|
||||
export class GuildStore extends FluxStore {
|
||||
getGuild(guildId: string): Guild;
|
||||
getGuildCount(): number;
|
||||
getGuilds(): Record<string, Guild>;
|
||||
getGuildsArray(): Guild[];
|
||||
getGuildIds(): string[];
|
||||
}
|
||||
17
packages/discord-types/src/stores/InstantInviteStore.d.ts
vendored
Normal file
17
packages/discord-types/src/stores/InstantInviteStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { FluxStore } from "..";
|
||||
import { Invite } from "./InviteStore";
|
||||
|
||||
export interface FriendInvite extends Invite {
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
uses: number;
|
||||
created_at: string;
|
||||
revoked?: boolean;
|
||||
}
|
||||
|
||||
export class InstantInviteStore extends FluxStore {
|
||||
getInvite(channelId: string): Invite;
|
||||
getFriendInvite(): FriendInvite | null;
|
||||
getFriendInvitesFetching(): boolean;
|
||||
canRevokeFriendInvite(): boolean;
|
||||
}
|
||||
27
packages/discord-types/src/stores/InviteStore.d.ts
vendored
Normal file
27
packages/discord-types/src/stores/InviteStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Channel, FluxStore, Guild, User } from "..";
|
||||
|
||||
export interface Invite {
|
||||
code: string;
|
||||
guild: Guild | null;
|
||||
channel: Channel | null;
|
||||
inviter: User | null;
|
||||
approximate_member_count?: number;
|
||||
approximate_presence_count?: number;
|
||||
expires_at?: string | null;
|
||||
flags?: number;
|
||||
target_type?: number;
|
||||
target_user?: User;
|
||||
// TODO: type these
|
||||
target_application?: any;
|
||||
stage_instance?: any;
|
||||
guild_scheduled_event?: any;
|
||||
}
|
||||
|
||||
export class InviteStore extends FluxStore {
|
||||
getInvite(code: string): Invite;
|
||||
// TODO: finish typing
|
||||
getInviteError(code: string): any | undefined;
|
||||
getInvites(): Record<string, Invite>;
|
||||
getInviteKeyForGuildId(guildId: string): string | undefined;
|
||||
getFriendMemberIds(code: string): string[] | undefined;
|
||||
}
|
||||
6
packages/discord-types/src/stores/LocaleStore.d.ts
vendored
Normal file
6
packages/discord-types/src/stores/LocaleStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class LocaleStore extends FluxStore {
|
||||
get locale(): string;
|
||||
get systemLocale(): string;
|
||||
}
|
||||
2742
packages/discord-types/src/stores/MediaEngineStore.d.ts
vendored
Normal file
2742
packages/discord-types/src/stores/MediaEngineStore.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load diff
55
packages/discord-types/src/stores/MessageStore.d.ts
vendored
Normal file
55
packages/discord-types/src/stores/MessageStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { FluxStore, Message } from "..";
|
||||
|
||||
export type JumpType = "ANIMATED" | "INSTANT";
|
||||
|
||||
export interface MessageCache {
|
||||
_messages: Message[];
|
||||
_map: Record<string, Message>;
|
||||
_wasAtEdge: boolean;
|
||||
_isCacheBefore: boolean;
|
||||
}
|
||||
|
||||
export interface ChannelMessages {
|
||||
channelId: string;
|
||||
ready: boolean;
|
||||
cached: boolean;
|
||||
jumpType: JumpType;
|
||||
jumpTargetId: string | null;
|
||||
jumpTargetOffset: number;
|
||||
jumpSequenceId: number;
|
||||
jumped: boolean;
|
||||
jumpedToPresent: boolean;
|
||||
jumpFlash: boolean;
|
||||
jumpReturnTargetId: string | null;
|
||||
focusTargetId: string | null;
|
||||
focusSequenceId: number;
|
||||
initialScrollSequenceId: number;
|
||||
hasMoreBefore: boolean;
|
||||
hasMoreAfter: boolean;
|
||||
loadingMore: boolean;
|
||||
revealedMessageId: string | null;
|
||||
hasFetched: boolean;
|
||||
error: boolean;
|
||||
_array: Message[];
|
||||
_before: MessageCache;
|
||||
_after: MessageCache;
|
||||
_map: Record<string, Message>;
|
||||
}
|
||||
|
||||
export class MessageStore extends FluxStore {
|
||||
focusedMessageId(channelId: string): string | undefined;
|
||||
getLastChatCommandMessage(channelId: string): Message | undefined;
|
||||
getLastEditableMessage(channelId: string): Message | undefined;
|
||||
getLastMessage(channelId: string): Message | undefined;
|
||||
getLastNonCurrentUserMessage(channelId: string): Message | undefined;
|
||||
getMessage(channelId: string, messageId: string): Message;
|
||||
/** @see {@link ChannelMessages} */
|
||||
getMessages(channelId: string): ChannelMessages;
|
||||
hasCurrentUserSentMessage(channelId: string): boolean;
|
||||
hasCurrentUserSentMessageSinceAppStart(channelId: string): boolean;
|
||||
hasPresent(channelId: string): boolean;
|
||||
isLoadingMessages(channelId: string): boolean;
|
||||
isReady(channelId: string): boolean;
|
||||
jumpedMessageId(channelId: string): string | undefined;
|
||||
whenReady(channelId: string, callback: () => void): void;
|
||||
}
|
||||
26
packages/discord-types/src/stores/NotificationSettingsStore.d.ts
vendored
Normal file
26
packages/discord-types/src/stores/NotificationSettingsStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export type DesktopNotificationType = "ALL" | "ONLY_MENTIONS" | "NEVER";
|
||||
export type TTSNotificationType = "ALL" | "ONLY_MENTIONS" | "NEVER";
|
||||
|
||||
export interface NotificationSettingsState {
|
||||
desktopType: DesktopNotificationType;
|
||||
disableAllSounds: boolean;
|
||||
disabledSounds: string[];
|
||||
ttsType: TTSNotificationType;
|
||||
disableUnreadBadge: boolean;
|
||||
taskbarFlash: boolean;
|
||||
notifyMessagesInSelectedChannel: boolean;
|
||||
}
|
||||
|
||||
export class NotificationSettingsStore extends FluxStore {
|
||||
get taskbarFlash(): boolean;
|
||||
getUserAgnosticState(): NotificationSettingsState;
|
||||
getDesktopType(): DesktopNotificationType;
|
||||
getTTSType(): TTSNotificationType;
|
||||
getDisabledSounds(): string[];
|
||||
getDisableAllSounds(): boolean;
|
||||
getDisableUnreadBadge(): boolean;
|
||||
getNotifyMessagesInSelectedChannel(): boolean;
|
||||
isSoundDisabled(sound: string): boolean;
|
||||
}
|
||||
15
packages/discord-types/src/stores/OverridePremiumTypeStore.d.ts
vendored
Normal file
15
packages/discord-types/src/stores/OverridePremiumTypeStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface OverridePremiumTypeState {
|
||||
createdAtOverride: Date | undefined;
|
||||
premiumTypeActual: number | null;
|
||||
premiumTypeOverride: number | undefined;
|
||||
}
|
||||
|
||||
export class OverridePremiumTypeStore extends FluxStore {
|
||||
getState(): OverridePremiumTypeState;
|
||||
getCreatedAtOverride(): Date | undefined;
|
||||
getPremiumTypeActual(): number | null;
|
||||
getPremiumTypeOverride(): number | undefined;
|
||||
get premiumType(): number | undefined;
|
||||
}
|
||||
15
packages/discord-types/src/stores/PendingReplyStore.d.ts
vendored
Normal file
15
packages/discord-types/src/stores/PendingReplyStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { Channel, Message } from "../common";
|
||||
import { FluxStore } from "./FluxStore";
|
||||
|
||||
export interface PendingReply {
|
||||
channel: Channel;
|
||||
message: Message;
|
||||
shouldMention: boolean;
|
||||
showMentionToggle: boolean;
|
||||
}
|
||||
|
||||
export class PendingReplyStore extends FluxStore {
|
||||
getPendingReply(channelId: string): PendingReply | undefined;
|
||||
/** Discord doesn't use this method. Also seems to always return undefined */
|
||||
getPendingReplyActionSource(channelId: string): unknown;
|
||||
}
|
||||
57
packages/discord-types/src/stores/PermissionStore.d.ts
vendored
Normal file
57
packages/discord-types/src/stores/PermissionStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import { Channel, Guild, Role, FluxStore } from "..";
|
||||
|
||||
export interface GuildPermissionProps {
|
||||
canManageGuild: boolean;
|
||||
canManageChannels: boolean;
|
||||
canManageRoles: boolean;
|
||||
canManageBans: boolean;
|
||||
canManageNicknames: boolean;
|
||||
canManageGuildExpressions: boolean;
|
||||
canViewAuditLog: boolean;
|
||||
canViewAuditLogV2: boolean;
|
||||
canManageWebhooks: boolean;
|
||||
canViewGuildAnalytics: boolean;
|
||||
canAccessMembersPage: boolean;
|
||||
isGuildAdmin: boolean;
|
||||
isOwner: boolean;
|
||||
isOwnerWithRequiredMfaLevel: boolean;
|
||||
guild: Guild;
|
||||
}
|
||||
|
||||
export interface PartialChannelContext {
|
||||
channelId: string;
|
||||
}
|
||||
|
||||
export interface PartialGuildContext {
|
||||
guildId: string;
|
||||
}
|
||||
|
||||
export type PartialContext = PartialChannelContext | PartialGuildContext;
|
||||
|
||||
type PartialChannel = Channel | { id: string; };
|
||||
type PartialGuild = Guild | { id: string; };
|
||||
|
||||
export class PermissionStore extends FluxStore {
|
||||
// TODO: finish typing these
|
||||
can(permission: bigint, channelOrGuild: PartialChannel | PartialGuild, guildId?: string, overwrites?: Record<string, any>, userId?: string): boolean;
|
||||
canBasicChannel(permission: bigint, channel: PartialChannel, guildId?: string, overwrites?: Record<string, any>, userId?: string): boolean;
|
||||
canWithPartialContext(permission: bigint, context: PartialContext): boolean;
|
||||
canManageUser(permission: bigint, userOrUserId: string, guild: PartialGuild): boolean;
|
||||
canAccessGuildSettings(guild: PartialGuild): boolean;
|
||||
canAccessMemberSafetyPage(guild: PartialGuild): boolean;
|
||||
canImpersonateRole(guild: PartialGuild, role: Role): boolean;
|
||||
|
||||
// TODO: finish typing
|
||||
computePermissions(channel: PartialChannel, guildId?: string, overwrites?: Record<string, any>, userId?: string): bigint;
|
||||
computeBasicPermissions(channel: PartialChannel): number;
|
||||
|
||||
getChannelPermissions(channel: PartialChannel): bigint;
|
||||
getGuildPermissions(guild: PartialGuild): bigint;
|
||||
getGuildPermissionProps(guild: PartialGuild): GuildPermissionProps;
|
||||
|
||||
getHighestRole(guild: PartialGuild): Role | null;
|
||||
isRoleHigher(guild: PartialGuild, firstRole: Role | null, secondRole: Role | null): boolean;
|
||||
|
||||
getGuildVersion(guildId: string): number;
|
||||
getChannelsVersion(): number;
|
||||
}
|
||||
246
packages/discord-types/src/stores/PopoutWindowStore.d.ts
vendored
Normal file
246
packages/discord-types/src/stores/PopoutWindowStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
/**
|
||||
* Known popout window key constants.
|
||||
* Used as the key parameter for PopoutWindowStore and PopoutActions methods.
|
||||
*/
|
||||
export type PopoutWindowKey =
|
||||
| "DISCORD_CHANNEL_CALL_POPOUT"
|
||||
| "DISCORD_CALL_TILE_POPOUT"
|
||||
| "DISCORD_SOUNDBOARD"
|
||||
| "DISCORD_RTC_DEBUG_POPOUT"
|
||||
| "DISCORD_CHANNEL_POPOUT"
|
||||
| "DISCORD_ACTIVITY_POPOUT"
|
||||
| "DISCORD_OVERLAY_POPOUT"
|
||||
| "DISCORD_DEVTOOLS_POPOUT";
|
||||
|
||||
/**
|
||||
* Popout window lifecycle event types.
|
||||
* Sent via postMessage from popout to parent window.
|
||||
*/
|
||||
export type PopoutWindowEventType = "loaded" | "unloaded";
|
||||
|
||||
/**
|
||||
* Persisted window position and size state.
|
||||
* Saved to localStorage and restored when reopening popouts.
|
||||
*/
|
||||
export interface PopoutWindowState {
|
||||
/** window x position on screen in pixels. */
|
||||
x: number;
|
||||
/** window y position on screen in pixels. */
|
||||
y: number;
|
||||
/** window inner width in pixels. */
|
||||
width: number;
|
||||
/** window inner height in pixels. */
|
||||
height: number;
|
||||
/** whether window stays above other windows, only on desktop app. */
|
||||
alwaysOnTop?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Features passed to window.open() for popout configuration.
|
||||
* Merged with default features (menubar, toolbar, location, directories = false).
|
||||
*/
|
||||
export interface BrowserWindowFeatures {
|
||||
/** whether to show browser toolbar. */
|
||||
toolbar?: boolean;
|
||||
/** whether to show menu bar. */
|
||||
menubar?: boolean;
|
||||
/** whether to show location/address bar. */
|
||||
location?: boolean;
|
||||
/** whether to show directory buttons. */
|
||||
directories?: boolean;
|
||||
/** window width in pixels. */
|
||||
width?: number;
|
||||
/** window height in pixels. */
|
||||
height?: number;
|
||||
/** default width if no persisted state exists. */
|
||||
defaultWidth?: number;
|
||||
/** default height if no persisted state exists. */
|
||||
defaultHeight?: number;
|
||||
/** window left position in pixels. */
|
||||
left?: number;
|
||||
/** window top position in pixels. */
|
||||
top?: number;
|
||||
/** default always-on-top state, defaults to false. */
|
||||
defaultAlwaysOnTop?: boolean;
|
||||
/** whether window can be moved by user. */
|
||||
movable?: boolean;
|
||||
/** whether window can be resized by user. */
|
||||
resizable?: boolean;
|
||||
/** whether window has a frame/border. */
|
||||
frame?: boolean;
|
||||
/** whether window stays above other windows. */
|
||||
alwaysOnTop?: boolean;
|
||||
/** whether window has a shadow (macOS). */
|
||||
hasShadow?: boolean;
|
||||
/** whether window background is transparent. */
|
||||
transparent?: boolean;
|
||||
/** whether to hide window from taskbar. */
|
||||
skipTaskbar?: boolean;
|
||||
/** title bar style, null for default. */
|
||||
titleBarStyle?: string | null;
|
||||
/** window background color as hex string. */
|
||||
backgroundColor?: string;
|
||||
/** whether this is an out-of-process overlay window. */
|
||||
outOfProcessOverlay?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manages Discord's popout windows (voice calls, activities, etc.).
|
||||
* Extends PersistedStore to save window positions across sessions.
|
||||
*
|
||||
* Handles Flux actions:
|
||||
* - POPOUT_WINDOW_OPEN: opens a new popout window
|
||||
* - POPOUT_WINDOW_CLOSE: closes a popout window
|
||||
* - POPOUT_WINDOW_SET_ALWAYS_ON_TOP: toggles always-on-top (desktop only)
|
||||
* - POPOUT_WINDOW_ADD_STYLESHEET: injects stylesheet into all open popouts
|
||||
* - LOGOUT: closes all popout windows
|
||||
*/
|
||||
export class PopoutWindowStore extends FluxStore {
|
||||
/**
|
||||
* Gets the Window object for a popout.
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns Window reference or undefined if not open
|
||||
*/
|
||||
getWindow(key: string): Window | undefined;
|
||||
|
||||
/**
|
||||
* Gets persisted position/size state for a window.
|
||||
* State is saved when window closes and restored when reopened.
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns saved state or undefined if never opened
|
||||
*/
|
||||
getWindowState(key: string): PopoutWindowState | undefined;
|
||||
|
||||
/**
|
||||
* Gets all currently open popout window keys.
|
||||
* @returns array of window key identifiers
|
||||
*/
|
||||
getWindowKeys(): string[];
|
||||
|
||||
/**
|
||||
* Checks if a popout window is currently open.
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if window exists and is not closed
|
||||
*/
|
||||
getWindowOpen(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Checks if a popout window has always-on-top enabled.
|
||||
* Only functional on desktop app (isPlatformEmbedded).
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if always-on-top is enabled
|
||||
*/
|
||||
getIsAlwaysOnTop(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Checks if a popout window's document has focus.
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if window document has focus
|
||||
*/
|
||||
getWindowFocused(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Checks if a popout window is visible (not minimized/hidden).
|
||||
* Uses document.visibilityState === "visible".
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if window is visible
|
||||
*/
|
||||
getWindowVisible(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Gets all persisted window states.
|
||||
* Keyed by window identifier, contains position/size data.
|
||||
* @returns record of window key to persisted state
|
||||
*/
|
||||
getState(): Record<string, PopoutWindowState>;
|
||||
|
||||
/**
|
||||
* Checks if a window is fully initialized and ready for rendering.
|
||||
* A window is fully initialized when it has:
|
||||
* - Window object created
|
||||
* - React root mounted
|
||||
* - Render function stored
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if window is fully initialized
|
||||
*/
|
||||
isWindowFullyInitialized(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Checks if a popout window is in fullscreen mode.
|
||||
* Checks if document.fullscreenElement.id === "app-mount".
|
||||
* @param key unique identifier for the popout window
|
||||
* @returns true if window is fullscreen
|
||||
*/
|
||||
isWindowFullScreen(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Unmounts and closes a popout window.
|
||||
* Saves current position/size before closing.
|
||||
* Logs warning if window was not fully initialized.
|
||||
* @param key unique identifier for the popout window
|
||||
*/
|
||||
unmountWindow(key: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actions for managing popout windows.
|
||||
* Dispatches Flux actions to PopoutWindowStore.
|
||||
*/
|
||||
export interface PopoutActions {
|
||||
/**
|
||||
* Opens a new popout window.
|
||||
* If window with key already exists and is not out-of-process:
|
||||
* - On desktop: focuses the existing window via native module
|
||||
* - On web: calls window.focus()
|
||||
* @param key unique identifier for the popout window
|
||||
* @param render function that returns React element to render, receives key as arg
|
||||
* @param features window features (size, position, etc.)
|
||||
*/
|
||||
open(key: string, render: (key: string) => React.ReactNode, features?: BrowserWindowFeatures): void;
|
||||
|
||||
/**
|
||||
* Closes a popout window.
|
||||
* Saves position/size state before closing unless preventPopoutClose setting is true.
|
||||
* @param key unique identifier for the popout window
|
||||
*/
|
||||
close(key: string): void;
|
||||
|
||||
/**
|
||||
* Sets always-on-top state for a popout window.
|
||||
* Only functional on desktop app (isPlatformEmbedded).
|
||||
* @param key unique identifier for the popout window
|
||||
* @param alwaysOnTop whether window should stay above others
|
||||
*/
|
||||
setAlwaysOnTop(key: string, alwaysOnTop: boolean): void;
|
||||
|
||||
/**
|
||||
* Note: Not actually in the Webpack Common. You have to add it yourself if you want to use it
|
||||
*
|
||||
* Injects a stylesheet into all open popout windows.
|
||||
* Validates origin matches current host or webpack public path.
|
||||
* @param url stylesheet URL to inject
|
||||
* @param integrity optional SRI integrity hash
|
||||
*/
|
||||
addStylesheet?(url: string, integrity?: string): void;
|
||||
|
||||
/**
|
||||
* Note: Not actually in the Webpack Common. You have to add it yourself if you want to use it
|
||||
*
|
||||
* Opens a channel call popout for voice/video calls.
|
||||
* Dispatches CHANNEL_CALL_POPOUT_WINDOW_OPEN action.
|
||||
* @param channel channel object to open call popout for
|
||||
*/
|
||||
openChannelCallPopout?(channel: { id: string; }): void;
|
||||
|
||||
/**
|
||||
* Note: Not actually in the Webpack Common. You have to add it yourself if you want to use it
|
||||
*
|
||||
* Opens a call tile popout for a specific participant.
|
||||
* Dispatches CALL_TILE_POPOUT_WINDOW_OPEN action.
|
||||
* @param channelId channel ID of the call
|
||||
* @param participantId user ID of the participant
|
||||
*/
|
||||
openCallTilePopout?(channelId: string, participantId: string): void;
|
||||
}
|
||||
38
packages/discord-types/src/stores/PresenceStore.d.ts
vendored
Normal file
38
packages/discord-types/src/stores/PresenceStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { Activity, OnlineStatus } from "../common";
|
||||
import { FluxStore } from "./FluxStore";
|
||||
|
||||
export interface UserAndActivity {
|
||||
userId: string;
|
||||
activity: Activity;
|
||||
}
|
||||
|
||||
export type DiscordPlatform = "desktop" | "mobile" | "web" | "embedded" | "vr";
|
||||
|
||||
export interface PresenceStoreState {
|
||||
presencesForGuilds: Record<string, Record<string, { status: OnlineStatus; activities: Activity[]; clientStatus: Partial<Record<DiscordPlatform, OnlineStatus>>; }>>;
|
||||
statuses: Record<string, OnlineStatus>;
|
||||
activities: Record<string, Activity[]>;
|
||||
filteredActivities: Record<string, Activity[]>;
|
||||
hiddenActivities: Record<string, Activity[]>;
|
||||
// TODO: finish typing
|
||||
activityMetadata: Record<string, any>;
|
||||
clientStatuses: Record<string, Partial<Record<DiscordPlatform, OnlineStatus>>>;
|
||||
}
|
||||
|
||||
export class PresenceStore extends FluxStore {
|
||||
findActivity(userId: string, predicate: (activity: Activity) => boolean, guildId?: string): Activity | undefined;
|
||||
getActivities(userId: string, guildId?: string): Activity[];
|
||||
// TODO: finish typing
|
||||
getActivityMetadata(userId: string): any;
|
||||
getAllApplicationActivities(applicationId: string): UserAndActivity[];
|
||||
getApplicationActivity(userId: string, applicationId: string, guildId?: string): Activity | null;
|
||||
getClientStatus(userId: string): Record<DiscordPlatform, OnlineStatus>;
|
||||
getHiddenActivities(): Activity[];
|
||||
/** literally just getActivities(...)[0] */
|
||||
getPrimaryActivity(userId: string, guildId?: string): Activity | null;
|
||||
getState(): PresenceStoreState;
|
||||
getStatus(userId: string, guildId?: string | null, defaultStatus?: OnlineStatus): OnlineStatus;
|
||||
getUnfilteredActivities(userId: string, guildId?: string): Activity[];
|
||||
getUserIds(): string[];
|
||||
isMobileOnline(userId: string): boolean;
|
||||
}
|
||||
82
packages/discord-types/src/stores/RTCConnectionStore.d.ts
vendored
Normal file
82
packages/discord-types/src/stores/RTCConnectionStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export type RTCConnectionState =
|
||||
| "DISCONNECTED"
|
||||
| "AWAITING_ENDPOINT"
|
||||
| "AUTHENTICATING"
|
||||
| "CONNECTING"
|
||||
| "RTC_DISCONNECTED"
|
||||
| "RTC_CONNECTING"
|
||||
| "RTC_CONNECTED"
|
||||
| "NO_ROUTE"
|
||||
| "ICE_CHECKING"
|
||||
| "DTLS_CONNECTING";
|
||||
|
||||
export type RTCConnectionQuality = "unknown" | "bad" | "average" | "fine";
|
||||
|
||||
export interface LastRTCConnectionState {
|
||||
duration: number | null;
|
||||
mediaSessionId: string | null;
|
||||
rtcConnectionId: string | null;
|
||||
wasEverMultiParticipant: boolean;
|
||||
wasEverRtcConnected: boolean;
|
||||
// TODO: type
|
||||
voiceStateAnalytics: any;
|
||||
channelId: string;
|
||||
}
|
||||
|
||||
export interface RTCConnectionPacketStats {
|
||||
inbound: number;
|
||||
outbound: number;
|
||||
lost: number;
|
||||
}
|
||||
|
||||
export interface VoiceStateStats {
|
||||
max_voice_state_count: number;
|
||||
}
|
||||
|
||||
export interface SecureFramesState {
|
||||
state: string;
|
||||
}
|
||||
|
||||
export interface SecureFramesRosterMapEntry {
|
||||
pendingVerifyState: number;
|
||||
verifiedState: number;
|
||||
}
|
||||
|
||||
export class RTCConnectionStore extends FluxStore {
|
||||
// TODO: type
|
||||
getRTCConnection(): any | null;
|
||||
getState(): RTCConnectionState;
|
||||
isConnected(): boolean;
|
||||
isDisconnected(): boolean;
|
||||
getRemoteDisconnectVoiceChannelId(): string | null;
|
||||
getLastSessionVoiceChannelId(): string | null;
|
||||
setLastSessionVoiceChannelId(channelId: string | null): void;
|
||||
getGuildId(): string | undefined;
|
||||
getChannelId(): string | undefined;
|
||||
getHostname(): string;
|
||||
getQuality(): RTCConnectionQuality;
|
||||
getPings(): number[];
|
||||
getAveragePing(): number;
|
||||
getLastPing(): number | undefined;
|
||||
getOutboundLossRate(): number | undefined;
|
||||
getMediaSessionId(): string | undefined;
|
||||
getRTCConnectionId(): string | undefined;
|
||||
getDuration(): number | undefined;
|
||||
getLastRTCConnectionState(): LastRTCConnectionState | null;
|
||||
getVoiceFilterSpeakingDurationMs(): number | undefined;
|
||||
getPacketStats(): RTCConnectionPacketStats | undefined;
|
||||
getVoiceStateStats(): VoiceStateStats | undefined;
|
||||
// TODO: finish typing
|
||||
getUserVoiceSettingsStats(userId: string): any | undefined;
|
||||
getWasEverMultiParticipant(): boolean;
|
||||
getWasEverRtcConnected(): boolean;
|
||||
getUserIds(): string[] | undefined;
|
||||
getJoinVoiceId(): string | null;
|
||||
isUserConnected(userId: string): boolean | undefined;
|
||||
getSecureFramesState(): SecureFramesState | undefined;
|
||||
getSecureFramesRosterMapEntry(oderId: string): SecureFramesRosterMapEntry | undefined;
|
||||
getLastNonZeroRemoteVideoSinkWantsTime(): number | null;
|
||||
getWasMoved(): boolean;
|
||||
}
|
||||
70
packages/discord-types/src/stores/ReadStateStore.d.ts
vendored
Normal file
70
packages/discord-types/src/stores/ReadStateStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
import { Channel, FluxStore } from "..";
|
||||
import { ReadStateType } from "../../enums";
|
||||
|
||||
export interface GuildChannelUnreadState {
|
||||
mentionCount: number;
|
||||
unread: boolean;
|
||||
isMentionLowImportance: boolean;
|
||||
}
|
||||
|
||||
export interface ReadStateSnapshot {
|
||||
unread: boolean;
|
||||
mentionCount: number;
|
||||
guildUnread: boolean | null;
|
||||
guildMentionCount: number | null;
|
||||
takenAt: number;
|
||||
}
|
||||
|
||||
export interface SerializedReadState {
|
||||
channelId: string;
|
||||
type: ReadStateType;
|
||||
_guildId: string;
|
||||
_persisted: boolean;
|
||||
_lastMessageId: string;
|
||||
_lastMessageTimestamp: number;
|
||||
_ackMessageId: string;
|
||||
_ackMessageTimestamp: number;
|
||||
ackPinTimestamp: number;
|
||||
lastPinTimestamp: number;
|
||||
_mentionCount: number;
|
||||
flags: number;
|
||||
lastViewed: number;
|
||||
}
|
||||
|
||||
export class ReadStateStore extends FluxStore {
|
||||
ackMessageId(channelId: string, type?: ReadStateType): string | null;
|
||||
getAllReadStates(includePrivate?: boolean): SerializedReadState[];
|
||||
getChannelIdsForWindowId(windowId: string): string[];
|
||||
getForDebugging(channelId: string): object | undefined;
|
||||
getGuildChannelUnreadState(
|
||||
channel: Channel,
|
||||
isOptInEnabled: boolean,
|
||||
guildHasActiveThreads: boolean,
|
||||
isChannelMuted: boolean,
|
||||
isGuildHome: boolean
|
||||
): GuildChannelUnreadState;
|
||||
getGuildUnreadsSentinel(guildId: string): number;
|
||||
getIsMentionLowImportance(channelId: string, type?: ReadStateType): boolean;
|
||||
getMentionChannelIds(): string[];
|
||||
getMentionCount(channelId: string, type?: ReadStateType): number;
|
||||
getNonChannelAckId(type: ReadStateType): string | null;
|
||||
getNotifCenterReadState(channelId: string): object | undefined;
|
||||
getOldestUnreadMessageId(channelId: string, type?: ReadStateType): string | null;
|
||||
getOldestUnreadTimestamp(channelId: string, type?: ReadStateType): number;
|
||||
getReadStatesByChannel(): Record<string, object>;
|
||||
getSnapshot(channelId: string, maxAge: number): ReadStateSnapshot;
|
||||
getTrackedAckMessageId(channelId: string, type?: ReadStateType): string | null;
|
||||
getUnreadCount(channelId: string, type?: ReadStateType): number;
|
||||
hasOpenedThread(channelId: string): boolean;
|
||||
hasRecentlyVisitedAndRead(channelId: string): boolean;
|
||||
hasTrackedUnread(channelId: string): boolean;
|
||||
hasUnread(channelId: string, type?: ReadStateType): boolean;
|
||||
hasUnreadOrMentions(channelId: string, type?: ReadStateType): boolean;
|
||||
hasUnreadPins(channelId: string): boolean;
|
||||
isEstimated(channelId: string, type?: ReadStateType): boolean;
|
||||
isForumPostUnread(channelId: string): boolean;
|
||||
isNewForumThread(threadId: string, parentChannelId: string, guildId: string): boolean;
|
||||
lastMessageId(channelId: string, type?: ReadStateType): string | null;
|
||||
lastMessageTimestamp(channelId: string, type?: ReadStateType): number;
|
||||
lastPinTimestamp(channelId: string): number;
|
||||
}
|
||||
42
packages/discord-types/src/stores/RelationshipStore.d.ts
vendored
Normal file
42
packages/discord-types/src/stores/RelationshipStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { FluxStore } from "..";
|
||||
import { RelationshipType } from "../../enums";
|
||||
|
||||
export class RelationshipStore extends FluxStore {
|
||||
getBlockedIDs(): string[];
|
||||
getBlockedOrIgnoredIDs(): string[];
|
||||
getFriendCount(): number;
|
||||
getFriendIDs(): string[];
|
||||
getIgnoredIDs(): string[];
|
||||
|
||||
getMutableRelationships(): Map<string, RelationshipType>;
|
||||
getNickname(userId: string): string;
|
||||
getOriginApplicationId(userId: string): string | undefined;
|
||||
getOutgoingCount(): number;
|
||||
getPendingCount(): number;
|
||||
getPendingIgnoredCount(): number;
|
||||
getRelationshipCount(): number;
|
||||
|
||||
/** @returns Enum value from constants.RelationshipTypes */
|
||||
getRelationshipType(userId: string): RelationshipType;
|
||||
getSince(userId: string): string;
|
||||
getSinces(): Record<string, string>;
|
||||
getSpamCount(): number;
|
||||
getVersion(): number;
|
||||
|
||||
isBlocked(userId: string): boolean;
|
||||
isBlockedForMessage(userId: string): boolean;
|
||||
|
||||
/**
|
||||
* @see {@link isBlocked}
|
||||
* @see {@link isIgnored}
|
||||
*/
|
||||
isBlockedOrIgnored(userId: string): boolean;
|
||||
isBlockedOrIgnoredForMessage(userId: string): boolean;
|
||||
|
||||
isFriend(userId: string): boolean;
|
||||
isIgnored(userId: string): boolean;
|
||||
isIgnoredForMessage(userId: string): boolean;
|
||||
isSpam(userId: string): boolean;
|
||||
isStranger(userId: string): boolean;
|
||||
isUnfilteredPendingIncoming(userId: string): boolean;
|
||||
}
|
||||
60
packages/discord-types/src/stores/RunningGameStore.d.ts
vendored
Normal file
60
packages/discord-types/src/stores/RunningGameStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface RunningGame {
|
||||
id?: string;
|
||||
name: string;
|
||||
exePath: string;
|
||||
cmdLine: string;
|
||||
distributor: string;
|
||||
lastFocused: number;
|
||||
lastLaunched: number;
|
||||
nativeProcessObserverId: number;
|
||||
pid?: number;
|
||||
hidden?: boolean;
|
||||
isLauncher?: boolean;
|
||||
elevated?: boolean;
|
||||
sandboxed?: boolean;
|
||||
}
|
||||
|
||||
export interface GameOverlayStatus {
|
||||
enabledLegacy: boolean;
|
||||
enabledOOP: boolean;
|
||||
}
|
||||
|
||||
export interface SystemServiceStatus {
|
||||
state: string;
|
||||
}
|
||||
|
||||
export class RunningGameStore extends FluxStore {
|
||||
canShowAdminWarning: boolean;
|
||||
|
||||
addExecutableTrackedByAnalytics(exe: string): void;
|
||||
getCandidateGames(): RunningGame[];
|
||||
getCurrentGameForAnalytics(): RunningGame | null;
|
||||
getCurrentNonGameForAnalytics(): RunningGame | null;
|
||||
getGameForName(name: string): RunningGame | null;
|
||||
getGameForPID(pid: number): RunningGame | null;
|
||||
getGameOrTransformedSubgameForPID(pid: number): RunningGame | null;
|
||||
getGameOverlayStatus(game: RunningGame): GameOverlayStatus | null;
|
||||
getGamesSeen(includeHidden?: boolean): RunningGame[];
|
||||
getLauncherForPID(pid: number): RunningGame | null;
|
||||
getObservedAppNameForWindow(windowHandle: number): string | null;
|
||||
getOverlayEnabledForGame(game: RunningGame): boolean;
|
||||
getOverlayOptionsForPID(pid: number): object | null;
|
||||
getOverrideForGame(game: RunningGame): object | null;
|
||||
getOverrides(): object[];
|
||||
getRunningDiscordApplicationIds(): string[];
|
||||
getRunningGames(): RunningGame[];
|
||||
getRunningNonGames(): RunningGame[];
|
||||
getRunningVerifiedApplicationIds(): string[];
|
||||
getSeenGameByName(name: string): RunningGame | null;
|
||||
getSystemServiceStatus(service: string): SystemServiceStatus;
|
||||
getVisibleGame(): RunningGame | null;
|
||||
getVisibleRunningGames(): RunningGame[];
|
||||
isDetectionEnabled(type?: string): boolean;
|
||||
isGamesSeenLoaded(): boolean;
|
||||
isObservedAppRunning(app: string): boolean;
|
||||
isSystemServiceInitialized(service: string): boolean;
|
||||
shouldContinueWithoutElevatedProcessForPID(pid: number): boolean;
|
||||
shouldElevateProcessForPID(pid: number): boolean;
|
||||
}
|
||||
16
packages/discord-types/src/stores/SelectedChannelStore.d.ts
vendored
Normal file
16
packages/discord-types/src/stores/SelectedChannelStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface ChannelFollowingDestination {
|
||||
guildId?: string;
|
||||
channelId?: string;
|
||||
}
|
||||
|
||||
export class SelectedChannelStore extends FluxStore {
|
||||
getChannelId(guildId?: string | null): string;
|
||||
getVoiceChannelId(): string | undefined;
|
||||
getCurrentlySelectedChannelId(guildId?: string): string | undefined;
|
||||
getMostRecentSelectedTextChannelId(guildId: string): string | undefined;
|
||||
getLastSelectedChannelId(guildId?: string): string;
|
||||
getLastSelectedChannels(guildId?: string): string;
|
||||
getLastChannelFollowingDestination(): ChannelFollowingDestination | undefined;
|
||||
}
|
||||
14
packages/discord-types/src/stores/SelectedGuildStore.d.ts
vendored
Normal file
14
packages/discord-types/src/stores/SelectedGuildStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface SelectedGuildState {
|
||||
selectedGuildTimestampMillis: Record<string | number, number>;
|
||||
selectedGuildId: string | null;
|
||||
lastSelectedGuildId: string | null;
|
||||
}
|
||||
|
||||
export class SelectedGuildStore extends FluxStore {
|
||||
getGuildId(): string | null;
|
||||
getLastSelectedGuildId(): string | null;
|
||||
getLastSelectedTimestamp(guildId: string): number | null;
|
||||
getState(): SelectedGuildState | undefined;
|
||||
}
|
||||
47
packages/discord-types/src/stores/SoundboardStore.d.ts
vendored
Normal file
47
packages/discord-types/src/stores/SoundboardStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface SoundboardSound {
|
||||
soundId: string;
|
||||
name: string;
|
||||
volume: number;
|
||||
emojiId: string | null;
|
||||
emojiName: string | null;
|
||||
available: boolean;
|
||||
guildId: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
export interface TopSoundForGuild {
|
||||
soundId: string;
|
||||
rank: number;
|
||||
}
|
||||
|
||||
export interface SoundboardOverlayState {
|
||||
soundboardSounds: Record<string, SoundboardSound[]>;
|
||||
favoritedSoundIds: string[];
|
||||
localSoundboardMutes: string[];
|
||||
}
|
||||
|
||||
export class SoundboardStore extends FluxStore {
|
||||
getOverlaySerializedState(): SoundboardOverlayState;
|
||||
getSounds(): Map<string, SoundboardSound[]>;
|
||||
getSoundsForGuild(guildId: string): SoundboardSound[] | null;
|
||||
getSound(guildId: string, soundId: string): SoundboardSound;
|
||||
getSoundById(soundId: string): SoundboardSound;
|
||||
isFetchingSounds(): boolean;
|
||||
isFetchingDefaultSounds(): boolean;
|
||||
isFetching(): boolean;
|
||||
shouldFetchDefaultSounds(): boolean;
|
||||
hasFetchedDefaultSounds(): boolean;
|
||||
isUserPlayingSounds(userId: string): boolean;
|
||||
isPlayingSound(soundId: string): boolean;
|
||||
isFavoriteSound(soundId: string): boolean;
|
||||
getFavorites(): Set<string>;
|
||||
getAllTopSoundsForGuilds(): Map<string, TopSoundForGuild[]>;
|
||||
isLocalSoundboardMuted(userId: string): boolean;
|
||||
hasHadOtherUserPlaySoundInSession(): boolean;
|
||||
shouldFetchTopSoundsForGuilds(): boolean;
|
||||
hasFetchedTopSoundsForGuilds(): boolean;
|
||||
hasFetchedAllSounds(): boolean;
|
||||
isFetchingAnySounds(): boolean;
|
||||
}
|
||||
6
packages/discord-types/src/stores/SpellCheckStore.d.ts
vendored
Normal file
6
packages/discord-types/src/stores/SpellCheckStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class SpellCheckStore extends FluxStore {
|
||||
hasLearnedWord(word: string): boolean;
|
||||
isEnabled(): boolean;
|
||||
}
|
||||
106
packages/discord-types/src/stores/SpotifyStore.d.ts
vendored
Normal file
106
packages/discord-types/src/stores/SpotifyStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface SpotifyDevice {
|
||||
id: string;
|
||||
is_active: boolean;
|
||||
is_private_session: boolean;
|
||||
is_restricted: boolean;
|
||||
name: string;
|
||||
supports_volume: boolean;
|
||||
type: string;
|
||||
volume_percent: number;
|
||||
}
|
||||
|
||||
export interface SpotifySocket {
|
||||
accessToken: string;
|
||||
accountId: string;
|
||||
connectionId: string;
|
||||
isPremium: boolean;
|
||||
socket: WebSocket;
|
||||
}
|
||||
|
||||
export interface SpotifySocketAndDevice {
|
||||
socket: SpotifySocket;
|
||||
device: SpotifyDevice;
|
||||
}
|
||||
|
||||
export interface SpotifyArtist {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface SpotifyImage {
|
||||
url: string;
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
export interface SpotifyAlbum {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
image: SpotifyImage | null;
|
||||
}
|
||||
|
||||
export interface SpotifyTrack {
|
||||
id: string;
|
||||
name: string;
|
||||
duration: number;
|
||||
isLocal: boolean;
|
||||
type: string;
|
||||
album: SpotifyAlbum;
|
||||
artists: SpotifyArtist[];
|
||||
}
|
||||
|
||||
export interface SpotifyPlayerState {
|
||||
track: SpotifyTrack;
|
||||
startTime: number;
|
||||
context: { uri: string } | null;
|
||||
}
|
||||
|
||||
export interface SpotifyActivity {
|
||||
name: string;
|
||||
assets: {
|
||||
large_image?: string;
|
||||
large_text?: string;
|
||||
};
|
||||
details: string;
|
||||
state: string | undefined;
|
||||
timestamps: {
|
||||
start: number;
|
||||
end: number;
|
||||
};
|
||||
party: {
|
||||
id: string;
|
||||
};
|
||||
sync_id?: string;
|
||||
flags?: number;
|
||||
metadata?: {
|
||||
context_uri: string | undefined;
|
||||
album_id: string;
|
||||
artist_ids: string[];
|
||||
type: string;
|
||||
button_urls: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface SpotifySyncingWith {
|
||||
oderId: string;
|
||||
partyId: string;
|
||||
sessionId: string;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export class SpotifyStore extends FluxStore {
|
||||
hasConnectedAccount(): boolean;
|
||||
getActiveSocketAndDevice(): SpotifySocketAndDevice | null;
|
||||
getPlayableComputerDevices(): SpotifySocketAndDevice[];
|
||||
canPlay(deviceId: string): boolean;
|
||||
getSyncingWith(): SpotifySyncingWith | undefined;
|
||||
wasAutoPaused(): boolean;
|
||||
getLastPlayedTrackId(): string | undefined;
|
||||
getTrack(): SpotifyTrack | null;
|
||||
getPlayerState(accountId: string): SpotifyPlayerState | null;
|
||||
shouldShowActivity(): boolean;
|
||||
getActivity(): SpotifyActivity | null;
|
||||
}
|
||||
22
packages/discord-types/src/stores/StickersStore.d.ts
vendored
Normal file
22
packages/discord-types/src/stores/StickersStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { FluxStore, GuildSticker, PremiumStickerPack, Sticker } from "..";
|
||||
|
||||
export type StickerGuildMap = Map<string, GuildSticker[]>;
|
||||
export type StickerPackMap = Map<string, Sticker[]>;
|
||||
|
||||
export class StickersStore extends FluxStore {
|
||||
hasLoadedStickerPacks: boolean;
|
||||
isFetchingStickerPacks: boolean;
|
||||
isLoaded: boolean;
|
||||
loadState: number;
|
||||
|
||||
getAllGuildStickers(): StickerGuildMap;
|
||||
getAllPackStickers(): StickerPackMap;
|
||||
getPremiumPacks(): PremiumStickerPack[];
|
||||
getRawStickersByGuild(): StickerGuildMap;
|
||||
getStickerById(id: string): Sticker | undefined;
|
||||
// TODO: type
|
||||
getStickerMetadataArrays(): any[];
|
||||
getStickerPack(id: string): PremiumStickerPack | undefined;
|
||||
getStickersByGuildId(guildId: string): Sticker[] | undefined;
|
||||
isPremiumPack(id: string): boolean;
|
||||
}
|
||||
24
packages/discord-types/src/stores/StreamerModeStore.d.ts
vendored
Normal file
24
packages/discord-types/src/stores/StreamerModeStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface StreamerModeSettings {
|
||||
enabled: boolean;
|
||||
autoToggle: boolean;
|
||||
hideInstantInvites: boolean;
|
||||
hidePersonalInformation: boolean;
|
||||
disableSounds: boolean;
|
||||
disableNotifications: boolean;
|
||||
enableContentProtection: boolean;
|
||||
}
|
||||
|
||||
export class StreamerModeStore extends FluxStore {
|
||||
get autoToggle(): boolean;
|
||||
get disableNotifications(): boolean;
|
||||
get disableSounds(): boolean;
|
||||
get enableContentProtection(): boolean;
|
||||
get enabled(): boolean;
|
||||
get hideInstantInvites(): boolean;
|
||||
get hidePersonalInformation(): boolean;
|
||||
|
||||
getSettings(): StreamerModeSettings;
|
||||
getState(): Record<string, StreamerModeSettings>;
|
||||
}
|
||||
19
packages/discord-types/src/stores/ThemeStore.d.ts
vendored
Normal file
19
packages/discord-types/src/stores/ThemeStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export type ThemePreference = "dark" | "light" | "unknown";
|
||||
export type SystemTheme = "dark" | "light";
|
||||
export type Theme = "light" | "dark" | "darker" | "midnight";
|
||||
|
||||
export interface ThemeState {
|
||||
theme: Theme;
|
||||
/** 0 = not loaded, 1 = loaded */
|
||||
status: 0 | 1;
|
||||
preferences: Record<ThemePreference, Theme>;
|
||||
}
|
||||
export class ThemeStore extends FluxStore {
|
||||
get systemTheme(): SystemTheme;
|
||||
get theme(): Theme;
|
||||
|
||||
getState(): ThemeState;
|
||||
themePreferenceForSystemTheme(preference: ThemePreference): Theme;
|
||||
}
|
||||
9
packages/discord-types/src/stores/TypingStore.d.ts
vendored
Normal file
9
packages/discord-types/src/stores/TypingStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export class TypingStore extends FluxStore {
|
||||
/**
|
||||
* returns a map of user ids to timeout ids
|
||||
*/
|
||||
getTypingUsers(channelId: string): Record<string, number>;
|
||||
isTyping(channelId: string, userId: string): boolean;
|
||||
}
|
||||
11
packages/discord-types/src/stores/UploadAttachmentStore.d.ts
vendored
Normal file
11
packages/discord-types/src/stores/UploadAttachmentStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { CloudUpload, FluxStore } from "..";
|
||||
import { DraftType } from "../../enums";
|
||||
|
||||
export class UploadAttachmentStore extends FluxStore {
|
||||
getFirstUpload(channelId: string, draftType: DraftType): CloudUpload | null;
|
||||
hasAdditionalUploads(channelId: string, draftType: DraftType): boolean;
|
||||
getUploads(channelId: string, draftType: DraftType): CloudUpload[];
|
||||
getUploadCount(channelId: string, draftType: DraftType): number;
|
||||
getUpload(channelId: string, uploadId: string, draftType: DraftType): CloudUpload;
|
||||
findUpload(channelId: string, draftType: DraftType, predicate: (upload: CloudUpload) => boolean): CloudUpload | undefined;
|
||||
}
|
||||
91
packages/discord-types/src/stores/UserGuildSettingsStore.d.ts
vendored
Normal file
91
packages/discord-types/src/stores/UserGuildSettingsStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
import { Channel, FluxStore } from "..";
|
||||
|
||||
export interface MuteConfig {
|
||||
selected_time_window: number;
|
||||
end_time: string | null;
|
||||
}
|
||||
|
||||
export interface ChannelOverride {
|
||||
muted: boolean;
|
||||
mute_config: MuteConfig | null;
|
||||
message_notifications: number;
|
||||
flags: number;
|
||||
collapsed: boolean;
|
||||
channel_id: string;
|
||||
}
|
||||
|
||||
export interface GuildSettings {
|
||||
suppress_everyone: boolean;
|
||||
suppress_roles: boolean;
|
||||
mute_scheduled_events: boolean;
|
||||
mobile_push: boolean;
|
||||
muted: boolean;
|
||||
message_notifications: number;
|
||||
flags: number;
|
||||
channel_overrides: Record<string, ChannelOverride>;
|
||||
notify_highlights: number;
|
||||
hide_muted_channels: boolean;
|
||||
version: number;
|
||||
mute_config: MuteConfig | null;
|
||||
guild_id: string;
|
||||
}
|
||||
|
||||
export interface AccountNotificationSettings {
|
||||
flags: number;
|
||||
}
|
||||
|
||||
export interface UserGuildSettingsState {
|
||||
useNewNotifications: boolean;
|
||||
}
|
||||
|
||||
export class UserGuildSettingsStore extends FluxStore {
|
||||
get accountNotificationSettings(): AccountNotificationSettings;
|
||||
get mentionOnAllMessages(): boolean;
|
||||
get useNewNotifications(): boolean;
|
||||
|
||||
allowAllMessages(guildId: string): boolean;
|
||||
allowNoMessages(guildId: string): boolean;
|
||||
getAddedToMessages(): string[];
|
||||
// TODO: finish typing
|
||||
getAllSettings(): { userGuildSettings: Record<string, GuildSettings>; };
|
||||
getChannelFlags(channel: Channel): number;
|
||||
getChannelIdFlags(guildId: string, channelId: string): number;
|
||||
getChannelMessageNotifications(guildId: string, channelId: string): number | null;
|
||||
getChannelMuteConfig(guildId: string, channelId: string): MuteConfig | null;
|
||||
getChannelOverrides(guildId: string): Record<string, ChannelOverride>;
|
||||
getChannelRecordUnreadSetting(channel: Channel): number;
|
||||
getChannelUnreadSetting(guildId: string, channelId: string): number;
|
||||
getGuildFavorites(guildId: string): string[];
|
||||
getGuildFlags(guildId: string): number;
|
||||
getGuildUnreadSetting(guildId: string): number;
|
||||
getMessageNotifications(guildId: string): number;
|
||||
getMuteConfig(guildId: string): MuteConfig | null;
|
||||
getMutedChannels(guildId: string): string[];
|
||||
getNewForumThreadsCreated(guildId: string): boolean;
|
||||
getNotifyHighlights(guildId: string): number;
|
||||
getOptedInChannels(guildId: string): string[];
|
||||
// TODO: finish typing these
|
||||
getOptedInChannelsWithPendingUpdates(guildId: string): Record<string, any>;
|
||||
getPendingChannelUpdates(guildId: string): Record<string, any>;
|
||||
getState(): UserGuildSettingsState;
|
||||
isAddedToMessages(channelId: string): boolean;
|
||||
isCategoryMuted(guildId: string, channelId: string): boolean;
|
||||
isChannelMuted(guildId: string, channelId: string): boolean;
|
||||
isChannelOptedIn(guildId: string, channelId: string, usePending?: boolean): boolean;
|
||||
isChannelOrParentOptedIn(guildId: string, channelId: string, usePending?: boolean): boolean;
|
||||
isChannelRecordOrParentOptedIn(channel: Channel, usePending?: boolean): boolean;
|
||||
isFavorite(guildId: string, channelId: string): boolean;
|
||||
isGuildCollapsed(guildId: string): boolean;
|
||||
isGuildOrCategoryOrChannelMuted(guildId: string, channelId: string): boolean;
|
||||
isMessagesFavorite(guildId: string): boolean;
|
||||
isMobilePushEnabled(guildId: string): boolean;
|
||||
isMuteScheduledEventsEnabled(guildId: string): boolean;
|
||||
isMuted(guildId: string): boolean;
|
||||
isOptInEnabled(guildId: string): boolean;
|
||||
isSuppressEveryoneEnabled(guildId: string): boolean;
|
||||
isSuppressRolesEnabled(guildId: string): boolean;
|
||||
isTemporarilyMuted(guildId: string): boolean;
|
||||
resolveGuildUnreadSetting(guildId: string): number;
|
||||
resolveUnreadSetting(channel: Channel): number;
|
||||
resolvedMessageNotifications(guildId: string): number;
|
||||
}
|
||||
166
packages/discord-types/src/stores/UserProfileStore.d.ts
vendored
Normal file
166
packages/discord-types/src/stores/UserProfileStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
import { FluxStore, Guild, User, Application, ApplicationInstallParams } from "..";
|
||||
import { ApplicationIntegrationType } from "../../enums";
|
||||
|
||||
export interface MutualFriend {
|
||||
/**
|
||||
* the userid of the mutual friend
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* the status of the mutual friend
|
||||
*/
|
||||
status: "online" | "offline" | "idle" | "dnd";
|
||||
/**
|
||||
* the user object of the mutual friend
|
||||
*/
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface MutualGuild {
|
||||
/**
|
||||
* the guild object of the mutual guild
|
||||
*/
|
||||
guild: Guild;
|
||||
/**
|
||||
* the user's nickname in the guild, if any
|
||||
*/
|
||||
nick: string | null;
|
||||
|
||||
}
|
||||
|
||||
export interface ProfileBadge {
|
||||
id: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
link?: string;
|
||||
}
|
||||
|
||||
export interface ConnectedAccount {
|
||||
type: "twitch" | "youtube" | "skype" | "steam" | "leagueoflegends" | "battlenet" | "bluesky" | "bungie" | "reddit" | "twitter" | "twitter_legacy" | "spotify" | "facebook" | "xbox" | "samsung" | "contacts" | "instagram" | "mastodon" | "soundcloud" | "github" | "playstation" | "playstation-stg" | "epicgames" | "riotgames" | "roblox" | "paypal" | "ebay" | "tiktok" | "crunchyroll" | "domain" | "amazon-music";
|
||||
/**
|
||||
* underlying id of connected account
|
||||
* eg. account uuid
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* display name of connected account
|
||||
*/
|
||||
name: string;
|
||||
verified: boolean;
|
||||
metadata?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ProfileApplication {
|
||||
id: string;
|
||||
customInstallUrl: string | undefined;
|
||||
installParams: ApplicationInstallParams | undefined;
|
||||
flags: number;
|
||||
popularApplicationCommandIds?: string[];
|
||||
integrationTypesConfig: Record<ApplicationIntegrationType, Partial<{
|
||||
oauth2_install_params: ApplicationInstallParams;
|
||||
}>>;
|
||||
primarySkuId: string | undefined;
|
||||
storefront_available: boolean;
|
||||
}
|
||||
|
||||
export interface UserProfileBase extends Pick<User, "banner"> {
|
||||
accentColor: number | null;
|
||||
/**
|
||||
* often empty for guild profiles, get the user profile for badges
|
||||
*/
|
||||
badges: ProfileBadge[];
|
||||
bio: string | undefined;
|
||||
popoutAnimationParticleType: string | null;
|
||||
profileEffectExpiresAt: number | Date | undefined;
|
||||
profileEffectId: undefined | string;
|
||||
/**
|
||||
* often an empty string when not set
|
||||
*/
|
||||
pronouns: string | "" | undefined;
|
||||
themeColors: [number, number] | undefined;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface ApplicationRoleConnection {
|
||||
application: Application;
|
||||
application_metadata: Record<string, any>;
|
||||
metadata: Record<string, any>;
|
||||
platform_name: string;
|
||||
platform_username: string;
|
||||
}
|
||||
|
||||
export interface UserProfile extends UserProfileBase, Pick<User, "premiumType"> {
|
||||
/** If this is a bot user profile, this will be its application */
|
||||
application: ProfileApplication | null;
|
||||
applicationRoleConnections: ApplicationRoleConnection[] | undefined;
|
||||
connectedAccounts: ConnectedAccount[] | undefined;
|
||||
fetchStartedAt: number;
|
||||
fetchEndedAt: number;
|
||||
legacyUsername: string | undefined;
|
||||
premiumGuildSince: Date | null;
|
||||
premiumSince: Date | null;
|
||||
}
|
||||
|
||||
export interface ApplicationWidgetConfig {
|
||||
applicationId: string;
|
||||
widgetType: number;
|
||||
}
|
||||
|
||||
export interface WishlistSettings {
|
||||
privacy: number;
|
||||
}
|
||||
|
||||
export class UserProfileStore extends FluxStore {
|
||||
get applicationWidgetApplicationConfigs(): Record<string, ApplicationWidgetConfig>;
|
||||
get isSubmitting(): boolean;
|
||||
|
||||
getApplicationWidgetApplicationConfig(applicationId: string): ApplicationWidgetConfig | undefined;
|
||||
getFirstWishlistId(userId: string): string | null;
|
||||
getGuildMemberProfile(userId: string, guildId: string | undefined): UserProfileBase | null;
|
||||
/**
|
||||
* Get the mutual friends of a user.
|
||||
*
|
||||
* @param userId the user ID of the user to get the mutual friends of.
|
||||
*
|
||||
* @returns an array of mutual friends, or undefined if the user has no mutual friends
|
||||
*/
|
||||
getMutualFriends(userId: string): MutualFriend[] | undefined;
|
||||
/**
|
||||
* Get the count of mutual friends for a user.
|
||||
*
|
||||
* @param userId the user ID of the user to get the mutual friends count of.
|
||||
*
|
||||
* @returns the count of mutual friends, or undefined if the user has no mutual friends
|
||||
*/
|
||||
getMutualFriendsCount(userId: string): number | undefined;
|
||||
/**
|
||||
* Get the mutual guilds of a user.
|
||||
*
|
||||
* @param userId the user ID of the user to get the mutual guilds of.
|
||||
*
|
||||
* @returns an array of mutual guilds, or undefined if the user has no mutual guilds
|
||||
*/
|
||||
getMutualGuilds(userId: string): MutualGuild[] | undefined;
|
||||
getUserProfile(userId: string): UserProfile | undefined;
|
||||
// TODO: finish typing
|
||||
getWidgets(userId: string): any[] | undefined;
|
||||
getWishlistIds(userId: string): string[];
|
||||
getWishlistSettings(userId: string): WishlistSettings | null;
|
||||
/**
|
||||
* Check if mutual friends for {@link userId} are currently being fetched.
|
||||
*
|
||||
* @param userId the user ID of the mutual friends being fetched.
|
||||
*
|
||||
* @returns true if mutual friends are being fetched, false otherwise.
|
||||
*/
|
||||
isFetchingFriends(userId: string): boolean;
|
||||
/**
|
||||
* @param userId the user ID of the profile being fetched.
|
||||
* @param guildId the guild ID to of the profile being fetched.
|
||||
* defaults to the internal symbol `NO GUILD ID` if nullish
|
||||
*
|
||||
* @returns true if the profile is being fetched, false otherwise.
|
||||
*/
|
||||
isFetchingProfile(userId: string, guildId?: string): boolean;
|
||||
takeSnapshot(): Record<string, UserProfile>;
|
||||
}
|
||||
223
packages/discord-types/src/stores/UserSettingsProtoStore.d.ts
vendored
Normal file
223
packages/discord-types/src/stores/UserSettingsProtoStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
import { FluxStore } from "..";
|
||||
|
||||
export interface GuildFolder {
|
||||
guildIds: string[];
|
||||
folderId?: number;
|
||||
folderName?: string;
|
||||
folderColor?: number;
|
||||
}
|
||||
|
||||
export interface GuildProto {
|
||||
// TODO: finish typing
|
||||
channels: Record<string, any>;
|
||||
hubProgress: number;
|
||||
guildOnboardingProgress: number;
|
||||
dismissedGuildContent: Record<string, number>;
|
||||
disableRaidAlertPush: boolean;
|
||||
disableRaidAlertNag: boolean;
|
||||
leaderboardsDisabled: boolean;
|
||||
// TODO: finish typing
|
||||
guildDismissibleContentStates: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface UserSettingsVersions {
|
||||
clientVersion: number;
|
||||
serverVersion: number;
|
||||
dataVersion: number;
|
||||
}
|
||||
|
||||
export interface InboxSettings {
|
||||
currentTab: number;
|
||||
viewedTutorial: boolean;
|
||||
}
|
||||
|
||||
export interface GuildsSettings {
|
||||
guilds: Record<string, GuildProto>;
|
||||
}
|
||||
|
||||
export interface UserContentSettings {
|
||||
dismissedContents: string;
|
||||
lastReceivedChangelogId: string;
|
||||
// TODO: finish typing
|
||||
recurringDismissibleContentStates: Record<string, any>;
|
||||
// TODO: type
|
||||
lastDismissedOutboundPromotionStartDate: any;
|
||||
premiumTier0ModalDismissedAt: any;
|
||||
}
|
||||
|
||||
export interface VoiceAndVideoSettings {
|
||||
// TODO: type
|
||||
videoBackgroundFilterDesktop: any;
|
||||
alwaysPreviewVideo: boolean;
|
||||
afkTimeout: number;
|
||||
streamNotificationsEnabled: boolean;
|
||||
nativePhoneIntegrationEnabled: boolean;
|
||||
disableStreamPreviews: boolean;
|
||||
soundmojiVolume: number;
|
||||
}
|
||||
|
||||
export interface TextAndImagesSettings {
|
||||
emojiPickerCollapsedSections: string[];
|
||||
stickerPickerCollapsedSections: string[];
|
||||
soundboardPickerCollapsedSections: string[];
|
||||
dmSpamFilterV2: number;
|
||||
viewImageDescriptions: boolean;
|
||||
inlineAttachmentMedia: boolean;
|
||||
inlineEmbedMedia: boolean;
|
||||
gifAutoPlay: boolean;
|
||||
renderEmbeds: boolean;
|
||||
renderReactions: boolean;
|
||||
animateEmoji: boolean;
|
||||
animateStickers: number;
|
||||
enableTtsCommand: boolean;
|
||||
messageDisplayCompact: boolean;
|
||||
explicitContentFilter: number;
|
||||
viewNsfwGuilds: boolean;
|
||||
convertEmoticons: boolean;
|
||||
viewNsfwCommands: boolean;
|
||||
includeStickersInAutocomplete: boolean;
|
||||
// TODO: type these
|
||||
explicitContentSettings: any;
|
||||
goreContentSettings: any;
|
||||
showMentionSuggestions: boolean;
|
||||
}
|
||||
|
||||
export interface NotificationsSettings {
|
||||
notificationCenterAckedBeforeId: string;
|
||||
focusModeExpiresAtMs: string;
|
||||
reactionNotifications: number;
|
||||
gameActivityNotifications: boolean;
|
||||
customStatusPushNotifications: boolean;
|
||||
showInAppNotifications: boolean;
|
||||
notifyFriendsOnGoLive: boolean;
|
||||
enableVoiceActivityNotifications: boolean;
|
||||
enableUserResurrectionNotifications: boolean;
|
||||
}
|
||||
|
||||
export interface PrivacySettings {
|
||||
restrictedGuildIds: string[];
|
||||
defaultGuildsRestricted: boolean;
|
||||
allowAccessibilityDetection: boolean;
|
||||
activityRestrictedGuildIds: string[];
|
||||
defaultGuildsActivityRestricted: boolean;
|
||||
activityJoiningRestrictedGuildIds: string[];
|
||||
messageRequestRestrictedGuildIds: string[];
|
||||
guildsLeaderboardOptOutDefault: boolean;
|
||||
slayerSdkReceiveDmsInGame: boolean;
|
||||
defaultGuildsActivityRestrictedV2: boolean;
|
||||
detectPlatformAccounts: boolean;
|
||||
passwordless: boolean;
|
||||
contactSyncEnabled: boolean;
|
||||
friendSourceFlags: number;
|
||||
friendDiscoveryFlags: number;
|
||||
dropsOptedOut: boolean;
|
||||
hideLegacyUsername: boolean;
|
||||
defaultGuildsRestrictedV2: boolean;
|
||||
quests3PDataOptedOut: boolean;
|
||||
}
|
||||
|
||||
export interface GameLibrarySettings {
|
||||
disableGamesTab: boolean;
|
||||
}
|
||||
|
||||
export interface StatusSettings {
|
||||
statusExpiresAtMs: string;
|
||||
status: { status: string; } | null;
|
||||
showCurrentGame: boolean;
|
||||
statusCreatedAtMs: string;
|
||||
}
|
||||
|
||||
export interface LocalizationSettings {
|
||||
locale: { localeCode: string; } | null;
|
||||
timezoneOffset: { offset: number; } | null;
|
||||
}
|
||||
|
||||
export interface AppearanceSettings {
|
||||
theme: number;
|
||||
developerMode: boolean;
|
||||
mobileRedesignDisabled: boolean;
|
||||
timestampHourCycle: number;
|
||||
launchPadMode: number;
|
||||
uiDensity: number;
|
||||
swipeRightToLeftMode: number;
|
||||
// TODO: type
|
||||
clientThemeSettings: any;
|
||||
}
|
||||
|
||||
export interface GuildFoldersSettings {
|
||||
folders: GuildFolder[];
|
||||
guildPositions: string[];
|
||||
}
|
||||
|
||||
export interface AudioContextSettings {
|
||||
// TODO: finish these
|
||||
user: Record<string, any>;
|
||||
stream: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface ClipsSettings {
|
||||
allowVoiceRecording: boolean;
|
||||
}
|
||||
|
||||
export interface InAppFeedbackSettings {
|
||||
// TODO: finish typing
|
||||
inAppFeedbackStates: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface UserSettings {
|
||||
versions: UserSettingsVersions;
|
||||
inbox: InboxSettings;
|
||||
guilds: GuildsSettings;
|
||||
userContent: UserContentSettings;
|
||||
voiceAndVideo: VoiceAndVideoSettings;
|
||||
textAndImages: TextAndImagesSettings;
|
||||
notifications: NotificationsSettings;
|
||||
privacy: PrivacySettings;
|
||||
// TODO: finish typing
|
||||
debug: Record<string, any>;
|
||||
gameLibrary: GameLibrarySettings;
|
||||
status: StatusSettings;
|
||||
localization: LocalizationSettings;
|
||||
appearance: AppearanceSettings;
|
||||
guildFolders: GuildFoldersSettings;
|
||||
audioContextSettings: AudioContextSettings;
|
||||
clips: ClipsSettings;
|
||||
inAppFeedbackSettings: InAppFeedbackSettings;
|
||||
}
|
||||
|
||||
export interface FrecencySettings {
|
||||
// TODO: type all of these
|
||||
versions: any;
|
||||
favoriteGifs: any;
|
||||
favoriteStickers: any;
|
||||
stickerFrecency: any;
|
||||
favoriteEmojis: any;
|
||||
emojiFrecency: any;
|
||||
applicationCommandFrecency: any;
|
||||
favoriteSoundboardSounds: any;
|
||||
applicationFrecency: any;
|
||||
playedSoundFrecency: any;
|
||||
guildAndChannelFrecency: any;
|
||||
emojiReactionFrecency: any;
|
||||
}
|
||||
|
||||
export interface ProtoState {
|
||||
// TODO: type
|
||||
proto: any;
|
||||
}
|
||||
|
||||
export class UserSettingsProtoStore extends FluxStore {
|
||||
settings: UserSettings;
|
||||
frecencyWithoutFetchingLatest: FrecencySettings;
|
||||
wasMostRecentUpdateFromServer: boolean;
|
||||
getState(): Record<string, ProtoState>;
|
||||
computeState(): Record<string, ProtoState>;
|
||||
getFullState(): Record<string, ProtoState>;
|
||||
hasLoaded(settingsType: number): boolean;
|
||||
getGuildFolders(): GuildFolder[];
|
||||
getGuildRecentsDismissedAt(guildId: string): number;
|
||||
getDismissedGuildContent(guildId: string): Record<string, number> | null;
|
||||
// TODO: finish typing
|
||||
getGuildDismissedContentState(guildId: string): any;
|
||||
getGuildsProto(): Record<string, GuildProto>;
|
||||
}
|
||||
34
packages/discord-types/src/stores/UserStore.d.ts
vendored
Normal file
34
packages/discord-types/src/stores/UserStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { FluxStore, User } from "..";
|
||||
|
||||
/** returned by takeSnapshot for persistence */
|
||||
export interface UserStoreSnapshot {
|
||||
/** snapshot format version, currently 1 */
|
||||
version: number;
|
||||
data: {
|
||||
/** contains only the current user */
|
||||
users: User[];
|
||||
};
|
||||
}
|
||||
|
||||
export class UserStore extends FluxStore {
|
||||
/**
|
||||
* filters users and optionally sorts results.
|
||||
* @param sort if true (default false), sorts alphabetically by username
|
||||
*/
|
||||
filter(filter: (user: User) => boolean, sort?: boolean): User[];
|
||||
/**
|
||||
* finds user by username and discriminator.
|
||||
* for new username system (unique usernames), pass null/undefined as discriminator.
|
||||
*/
|
||||
findByTag(username: string, discriminator?: string | null): User | undefined;
|
||||
/** @param action return false to break iteration early */
|
||||
forEach(action: (user: User) => boolean | void): void;
|
||||
getCurrentUser(): User;
|
||||
getUser(userId: string): User;
|
||||
/** keyed by user ID */
|
||||
getUsers(): Record<string, User>;
|
||||
/** increments when users are added/updated/removed */
|
||||
getUserStoreVersion(): number;
|
||||
/** only includes current user, used for persistence */
|
||||
takeSnapshot(): UserStoreSnapshot;
|
||||
}
|
||||
51
packages/discord-types/src/stores/VoiceStateStore.d.ts
vendored
Normal file
51
packages/discord-types/src/stores/VoiceStateStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { DiscordRecord } from "../common";
|
||||
import { FluxStore } from "./FluxStore";
|
||||
|
||||
export type UserVoiceStateRecords = Record<string, VoiceState>;
|
||||
export type VoiceStates = Record<string, UserVoiceStateRecords>;
|
||||
|
||||
export interface VoiceState extends DiscordRecord {
|
||||
userId: string;
|
||||
channelId: string | null | undefined;
|
||||
sessionId: string | null | undefined;
|
||||
mute: boolean;
|
||||
deaf: boolean;
|
||||
selfMute: boolean;
|
||||
selfDeaf: boolean;
|
||||
selfVideo: boolean;
|
||||
selfStream: boolean | undefined;
|
||||
suppress: boolean;
|
||||
requestToSpeakTimestamp: string | null | undefined;
|
||||
discoverable: boolean;
|
||||
|
||||
isVoiceMuted(): boolean;
|
||||
isVoiceDeafened(): boolean;
|
||||
}
|
||||
|
||||
export class VoiceStateStore extends FluxStore {
|
||||
getAllVoiceStates(): VoiceStates;
|
||||
getVoiceStateVersion(): number;
|
||||
|
||||
getVoiceStates(guildId?: string | null): UserVoiceStateRecords;
|
||||
getVoiceStatesForChannel(channelId: string): UserVoiceStateRecords;
|
||||
getVideoVoiceStatesForChannel(channelId: string): UserVoiceStateRecords;
|
||||
|
||||
getVoiceState(guildId: string | null, userId: string): VoiceState | undefined;
|
||||
getDiscoverableVoiceState(guildId: string | null, userId: string): VoiceState | null;
|
||||
getVoiceStateForChannel(channelId: string, userId?: string): VoiceState | undefined;
|
||||
getVoiceStateForUser(userId: string): VoiceState | undefined;
|
||||
getDiscoverableVoiceStateForUser(userId: string): VoiceState | undefined;
|
||||
getVoiceStateForSession(userId: string, sessionId?: string | null): VoiceState | null | undefined;
|
||||
|
||||
getUserVoiceChannelId(guildId: string | null, userId: string): string | undefined;
|
||||
getCurrentClientVoiceChannelId(guildId: string | null): string | undefined;
|
||||
|
||||
getUsersWithVideo(channelId: string): Set<string>;
|
||||
getVoicePlatformForChannel(channelId: string, guildId: string): string | undefined;
|
||||
|
||||
isCurrentClientInVoiceChannel(): boolean;
|
||||
isInChannel(channelId: string, userId?: string): boolean;
|
||||
hasVideo(channelId: string): boolean;
|
||||
|
||||
get userHasBeenMovedVersion(): number;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue