lightcordapi+glasstron

Adding some docs for LightcordApi
Adding a dropdown to change the blur type/vibrancy
This commit is contained in:
Jean Ouina 2020-09-06 12:50:52 +02:00
parent 805b68b48c
commit 6246ba2ef9
27 changed files with 1095 additions and 606 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@ import CardList from "../ui/addonlist";
import V2C_PresenceSettings from "../ui/presenceSettings";
import CustomRichPresence from "./CustomRichPresence";
import V2C_AccountInfos from "../ui/AccountInfos";
import { remote } from "electron";
import { remote, ipcRenderer } from "electron";
import AntiAdDM from "./AntiAdDM";
import blurPrivate from "./blurPrivate";
import disableTyping from "./disableTyping";
@ -345,6 +345,57 @@ export default new class V2_SettingsPanel {
}, "Open a new Tab")
]
}
if(setting.id === "enable_glasstron" && isChecked){
if(process.platform !== "linux"){
let choices = []
let actual = null
if(process.platform === "win32"){
choices.push("blurbehind", "acrylic", "transparent")
actual = appSettings.get("GLASSTRON_BLUR", "blurbehind")
}else if(process.platform === "darwin"){
choices.push("titlebar",
"selection",
"menu",
"popover",
"sidebar",
"header",
"sheet",
"window",
"hud",
"fullscreen-ui",
"tooltip",
"content",
"under-window",
"under-page",
"none"
)
actual = appSettings.get("GLASSTRON_VIBRANCY", "fullscreen-ui")
}
return [
returnValue,
React.createElement(Lightcord.Api.Components.general.SettingSubTitle, {}, "Glasstron Blur"),
React.createElement(Lightcord.Api.Components.inputs.Dropdown, {
options: choices.map(e => {
return {
value: e,
label: e
}
}),
value: actual,
disabled: false,
searchable: true,
clearable: false,
onChange: (value) => {
if(process.platform === "win32"){
ipcRenderer.invoke("LIGHTCORD_SET_BLUR_TYPE", value)
}else{
ipcRenderer.invoke("LIGHTCORD_SET_VIBRANCY", value)
}
}
}, null)
]
}
}
return returnValue
})
]

View File

@ -368,9 +368,7 @@ class InputChoice extends React.PureComponent {
this.props.manager.updateWhenFetched(this)
}
onChange(data){
let value = data.value
onChange(value){
if(!this.lastEdited || this.lastEdited < Date.now() - 500){
this.props.manager.onChange(this, value === "none" ? null : value.replace("asset-", ""))
this.lastEdited = Date.now()

File diff suppressed because one or more lines are too long

View File

@ -104,7 +104,7 @@
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_modules_discordtools_.notice.html#data" class="tsd-kind-icon">data</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_modules_discordtools_.notice.html#nexttickrefresh" class="tsd-kind-icon">next<wbr>Tick<wbr>Refresh</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_modules_discordtools_.notice.html#state" class="tsd-kind-icon">state</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_modules_discordtools_.notice.html#state" class="tsd-kind-icon">state</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a href="_modules_discordtools_.notice.html#defaultmaxlisteners" class="tsd-kind-icon">default<wbr>Max<wbr>Listeners</a></li>
</ul>
</section>
@ -159,7 +159,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:92</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:125</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -181,7 +181,7 @@
<div class="tsd-signature tsd-kind-icon">data<span class="tsd-signature-symbol">:</span> <a href="../modules/_components_private_notices_.html#notice" class="tsd-signature-type">notice</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:227</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:264</li>
</ul>
</aside>
</section>
@ -191,19 +191,24 @@
<div class="tsd-signature tsd-kind-icon">next<wbr>Tick<wbr>Refresh<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:155</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:189</li>
</ul>
</aside>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private">
<a name="state" class="tsd-anchor"></a>
<h3>state</h3>
<h3><span class="tsd-flag ts-flagPrivate">Private</span> state</h3>
<div class="tsd-signature tsd-kind-icon">state<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>index<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span>removed<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>showing<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:149</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:183</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Please do not modify this. It is used internally to emit events only if the data has changed.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
@ -244,7 +249,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:204</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:241</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
@ -252,7 +257,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:207</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:244</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -275,9 +280,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:167</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:204</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The id of the notice.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
</li>
</ul>
@ -292,9 +302,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:164</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:200</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The position in the queue, 0 is showing.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
</li>
</ul>
@ -310,7 +325,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:213</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:250</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h4>
@ -330,7 +345,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:216</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:253</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -365,9 +380,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:157</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:192</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>if the notice is not, and will not show anymore.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
@ -382,9 +402,14 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:160</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:196</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>If the notice is showing right now.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
</li>
</ul>
@ -400,7 +425,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:186</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:223</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
@ -408,7 +433,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:189</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:226</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -432,7 +457,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:195</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:232</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">"brand"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"default"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"spotify"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"facebook"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"info"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"danger"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"success"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"streamerMode"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"download"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"notification"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"premium"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"richPresence"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"premiumTier1"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"premiumTier2"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"survey"</span></h4>
@ -440,7 +465,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:198</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:235</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -631,7 +656,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.off</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:142</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:175</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -661,7 +686,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.off</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:143</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:176</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -697,7 +722,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.off</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:144</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:177</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -744,7 +769,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.on</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:113</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:146</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -779,7 +804,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.on</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:117</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:150</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -820,7 +845,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.on</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:121</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:154</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -872,7 +897,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.once</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:129</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:162</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -907,7 +932,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.once</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:133</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:166</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -948,7 +973,7 @@
<aside class="tsd-sources">
<p>Overrides EventEmitter.once</p>
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:137</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:170</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -1114,7 +1139,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:222</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:259</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@ -1227,7 +1252,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:171</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:208</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -1303,7 +1328,7 @@
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-private">
<a href="_modules_discordtools_.notice.html#nexttickrefresh" class="tsd-kind-icon">next<wbr>Tick<wbr>Refresh</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-private">
<a href="_modules_discordtools_.notice.html#state" class="tsd-kind-icon">state</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static">

View File

@ -118,7 +118,7 @@
<aside class="tsd-sources">
<p>Overrides <a href="_modules_webpackloader_.webpackloadererror.html">WebpackLoaderError</a>.<a href="_modules_webpackloader_.webpackloadererror.html#name">name</a></p>
<ul>
<li>Defined in lightcordapi/src/modules/Utils.ts:132</li>
<li>Defined in lightcordapi/src/modules/Utils.ts:174</li>
</ul>
</aside>
</section>

View File

@ -106,7 +106,7 @@
<div class="tsd-signature tsd-kind-icon">BDModules<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>modules<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span>get<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:46</li>
<li>Defined in lightcordapi/src/index.ts:62</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -131,7 +131,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:48</li>
<li>Defined in lightcordapi/src/index.ts:64</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -166,7 +166,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:49</li>
<li>Defined in lightcordapi/src/index.ts:65</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -183,7 +183,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:50</li>
<li>Defined in lightcordapi/src/index.ts:66</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -208,7 +208,7 @@
<div class="tsd-signature tsd-kind-icon">Bd<wbr>Api<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:52</li>
<li>Defined in lightcordapi/src/index.ts:68</li>
</ul>
</aside>
</section>
@ -218,7 +218,7 @@
<div class="tsd-signature tsd-kind-icon">EDApi<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:53</li>
<li>Defined in lightcordapi/src/index.ts:69</li>
</ul>
</aside>
</section>
@ -228,7 +228,7 @@
<div class="tsd-signature tsd-kind-icon">Lightcord<span class="tsd-signature-symbol">:</span> <a href="_index_.lightcordglobal.html" class="tsd-signature-type">LightcordGlobal</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:42</li>
<li>Defined in lightcordapi/src/index.ts:58</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -243,7 +243,7 @@
<div class="tsd-signature tsd-kind-icon">React<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="../modules/_index_.__global.html#react" class="tsd-signature-type">React</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:55</li>
<li>Defined in lightcordapi/src/index.ts:71</li>
</ul>
</aside>
</section>
@ -253,7 +253,7 @@
<div class="tsd-signature tsd-kind-icon">ReactDOM<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="../modules/_modules_utils_.html#reactdom" class="tsd-signature-type">ReactDOM</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:54</li>
<li>Defined in lightcordapi/src/index.ts:70</li>
</ul>
</aside>
</section>

View File

@ -108,9 +108,14 @@
<div class="tsd-signature tsd-kind-icon">Api<span class="tsd-signature-symbol">:</span> <a href="../modules/_index_.html#lightcordapiglobal" class="tsd-signature-type">LightcordApiGlobal</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:81</li>
<li>Defined in lightcordapi/src/index.ts:107</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Lightcord&#39;s Api. This is where all methods/properties lightcord adds are.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="betterdiscord" class="tsd-anchor"></a>
@ -118,9 +123,14 @@
<div class="tsd-signature tsd-kind-icon">Better<wbr>Discord<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>BdApi<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:82</li>
<li>Defined in lightcordapi/src/index.ts:109</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>BetterDiscord&#39;s Internal Modules. Can be used as well. Example: <code>Lightcord.BetterDiscord.DOM</code> for DomTools.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
@ -129,6 +139,11 @@
</li>
<li class="tsd-parameter">
<h5>Bd<wbr>Api<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>BetterDiscord&#39;s plugin api. Can also be accessed with the global variable: <code>BdApi</code></p>
</div>
</div>
</li>
</ul>
</div>
@ -139,14 +154,24 @@
<div class="tsd-signature tsd-kind-icon">Discord<wbr>Modules<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>constants<span class="tsd-signature-symbol">: </span><a href="_types_discordconstantstypes_.discordconstantstype.html" class="tsd-signature-type">DiscordConstantsType</a><span class="tsd-signature-symbol">; </span>dispatcher<span class="tsd-signature-symbol">: </span><a href="_types_discorddispatchertypes_.dispatchertypes.html" class="tsd-signature-type">DispatcherTypes</a><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:70</li>
<li>Defined in lightcordapi/src/index.ts:89</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Some Discord Internal Module shortcuts.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>constants<span class="tsd-signature-symbol">: </span><a href="_types_discordconstantstypes_.discordconstantstype.html" class="tsd-signature-type">DiscordConstantsType</a></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Discord&#39;s constants - Can be used to retrieve some infos like Discord&#39;s Api Link, Colors, Events, etc...</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>dispatcher<span class="tsd-signature-symbol">: </span><a href="_types_discorddispatchertypes_.dispatchertypes.html" class="tsd-signature-type">DispatcherTypes</a></h5>
@ -165,9 +190,14 @@
<div class="tsd-signature tsd-kind-icon">Settings<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>callRingingBeat<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>devMode<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:77</li>
<li>Defined in lightcordapi/src/index.ts:100</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Lightcord&#39;s base settings. You don&#39;t need to use them.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">

File diff suppressed because one or more lines are too long

View File

@ -69,6 +69,13 @@
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Discord&#39;s dispatcher described. Too lazy to comment everything.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
@ -125,7 +132,7 @@
<div class="tsd-signature tsd-kind-icon">_compute<wbr>Ordered<wbr>Action<wbr>Handlers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:44</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:47</li>
</ul>
</aside>
</section>
@ -135,7 +142,7 @@
<div class="tsd-signature tsd-kind-icon">_compute<wbr>Ordered<wbr>Callback<wbr>Tokens<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:45</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:48</li>
</ul>
</aside>
</section>
@ -145,7 +152,7 @@
<div class="tsd-signature tsd-kind-icon">_current<wbr>Dispatch<wbr>Action<wbr>Type<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:5</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:8</li>
</ul>
</aside>
</section>
@ -155,7 +162,7 @@
<div class="tsd-signature tsd-kind-icon">_dependency<wbr>Graph<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:9</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:12</li>
</ul>
</aside>
</section>
@ -165,7 +172,7 @@
<div class="tsd-signature tsd-kind-icon">_invalidate<wbr>Caches<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:42</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:45</li>
</ul>
</aside>
</section>
@ -175,7 +182,7 @@
<div class="tsd-signature tsd-kind-icon">_lastID<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:8</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:11</li>
</ul>
</aside>
</section>
@ -185,7 +192,7 @@
<div class="tsd-signature tsd-kind-icon">_ordered<wbr>Action<wbr>Handlers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:6</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:9</li>
</ul>
</aside>
</section>
@ -195,7 +202,7 @@
<div class="tsd-signature tsd-kind-icon">_ordered<wbr>Callback<wbr>Tokens<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:7</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:10</li>
</ul>
</aside>
</section>
@ -205,7 +212,7 @@
<div class="tsd-signature tsd-kind-icon">_process<wbr>Wait<wbr>Queue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:43</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:46</li>
</ul>
</aside>
</section>
@ -215,7 +222,7 @@
<div class="tsd-signature tsd-kind-icon">_processing<wbr>Wait<wbr>Queue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:4</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:7</li>
</ul>
</aside>
</section>
@ -225,7 +232,7 @@
<div class="tsd-signature tsd-kind-icon">_subscriptions<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:2</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:5</li>
</ul>
</aside>
</section>
@ -235,7 +242,7 @@
<div class="tsd-signature tsd-kind-icon">_wait<wbr>Queue<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:3</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:6</li>
</ul>
</aside>
</section>
@ -245,7 +252,7 @@
<div class="tsd-signature tsd-kind-icon">add<wbr>Dependencies<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:41</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:44</li>
</ul>
</aside>
</section>
@ -262,7 +269,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:25</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:28</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -298,7 +305,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:19</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:22</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -334,7 +341,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:23</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:26</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -370,7 +377,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:11</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:14</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
@ -387,7 +394,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:15</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:18</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -423,7 +430,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:40</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:43</li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
@ -452,7 +459,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:29</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:32</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -498,7 +505,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:35</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:38</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -555,7 +562,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:39</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:42</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
@ -612,7 +619,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:33</li>
<li>Defined in lightcordapi/src/types/DiscordDispatcherTypes.ts:36</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">

View File

@ -100,7 +100,7 @@
<div class="tsd-signature tsd-kind-icon">Bd<wbr>Api<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:58</li>
<li>Defined in lightcordapi/src/index.ts:74</li>
</ul>
</aside>
</section>
@ -110,7 +110,7 @@
<div class="tsd-signature tsd-kind-icon">EDApi<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">BdApi</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:59</li>
<li>Defined in lightcordapi/src/index.ts:75</li>
</ul>
</aside>
</section>
@ -120,7 +120,7 @@
<div class="tsd-signature tsd-kind-icon">Lightcord<span class="tsd-signature-symbol">:</span> <a href="../interfaces/_index_.lightcordglobal.html" class="tsd-signature-type">LightcordGlobal</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:57</li>
<li>Defined in lightcordapi/src/index.ts:73</li>
</ul>
</aside>
</section>
@ -130,7 +130,7 @@
<div class="tsd-signature tsd-kind-icon">React<span class="tsd-signature-symbol">:</span> <a href="_index_.__global.html#react" class="tsd-signature-type">React</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:36</li>
<li>Defined in lightcordapi/src/index.ts:52</li>
</ul>
</aside>
</section>
@ -140,7 +140,7 @@
<div class="tsd-signature tsd-kind-icon">ReactDOM<span class="tsd-signature-symbol">:</span> <a href="_modules_utils_.html#reactdom" class="tsd-signature-type">ReactDOM</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/index.ts:37</li>
<li>Defined in lightcordapi/src/index.ts:53</li>
</ul>
</aside>
</section>

File diff suppressed because one or more lines are too long

View File

@ -107,7 +107,7 @@
<div class="tsd-signature tsd-kind-icon">Notice<wbr>Data<span class="tsd-signature-symbol">:</span> <a href="_components_private_notices_.html#noticewithoutid" class="tsd-signature-type">noticeWithoutID</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:71</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:101</li>
</ul>
</aside>
</section>
@ -117,20 +117,40 @@
<div class="tsd-signature tsd-kind-icon">Notification<wbr>Data<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>icon<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>onClick<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>onClose<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>onShow<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>title<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:62</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:86</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Notifications informations.</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The body of the notification. Could be truncated.</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5>icon<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>An http(s) link to an icon.</p>
</div>
</div>
</li>
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Click<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>When the user clicked the notification</p>
</div>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter-signature">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-variable">
@ -146,6 +166,11 @@
</li>
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Close<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>When the notification has been closed.</p>
</div>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter-signature">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-variable">
@ -161,6 +186,11 @@
</li>
<li class="tsd-parameter">
<h5><span class="tsd-flag ts-flagOptional">Optional</span> on<wbr>Show<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>When the notification is showing</p>
</div>
</div>
<ul class="tsd-parameters">
<li class="tsd-parameter-signature">
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-variable">
@ -176,6 +206,11 @@
</li>
<li class="tsd-parameter">
<h5>title<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The title of the notification</p>
</div>
</div>
</li>
</ul>
</div>
@ -186,9 +221,14 @@
<div class="tsd-signature tsd-kind-icon">Sound<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"call_calling"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"call_ringing"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"call_ringing_beat"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ddr-down"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ddr-left"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ddr-right"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ddr-up"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"deafen"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"discodo"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"disconnect"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"human_man"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"mention1"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"mention2"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"mention3"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"message1"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"message2"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"message3"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"mute"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"overlayunlock"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ptt_start"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ptt_stop"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"reconnect"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"robot_man"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"stream_ended"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"stream_started"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"stream_user_joined"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"stream_user_left"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"undeafen"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"unmute"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"user_join"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"user_leave"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"user_moved"</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:60</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:81</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>List of valid sounds.</p>
</div>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-not-exported">
@ -216,7 +256,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:73</li>
<li>Defined in lightcordapi/src/modules/DiscordTools.ts:103</li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,10 +15,26 @@ import "./alias/react-dom"
import { LazyLoad } from "./modules/lazyLoader"
patchers.patch()
/**
* Lightcord Api defined at [/LightcordApi/src/index.ts](https://github.com/Lightcord/Lightcord/blob/master/LightcordApi/src/index.ts#L18)
*/
const LightcordApi = {
/**
* WebpackLoader loads Internal Discord's modules with given filter.
*/
WebpackLoader: WebpackLoader,
/**
* Lightcord's exported component. You can see a list in the app settings when activating `Developer Options` in lightcord's settings.
*/
Components: Components,
/**
* Create uuids.
* @method
*/
uuid: uuid,
/**
* Set of methods that can help you sometimes.
*/
Utils: Utils,
DiscordTools: DiscordTools,
_: {
@ -67,19 +83,31 @@ Object.assign(window.Lightcord.Api, LightcordApi)
* The main Lightcord exports. Can be accessed with `window.Lightcord`
*/
export interface LightcordGlobal {
/**
* Some Discord Internal Module shortcuts.
*/
DiscordModules: {
/**
* Internal Discord's dispatcher - can be used to subscribe to gateway events / client events.
*/
dispatcher: import("./types/DiscordDispatcherTypes").default,
/**
* Discord's constants - Can be used to retrieve some infos like Discord's Api Link, Colors, Events, etc...
*/
constants: import("./types/DiscordConstantsTypes").default
},
/** Lightcord's base settings. You don't need to use them. */
Settings: {
devMode: boolean,
callRingingBeat: boolean
},
/**
* Lightcord's Api. This is where all methods/properties lightcord adds are.
*/
Api: LightcordApiGlobal,
/** BetterDiscord's Internal Modules. Can be used as well. Example: `Lightcord.BetterDiscord.DOM` for DomTools. */
BetterDiscord: {
/** BetterDiscord's plugin api. Can also be accessed with the global variable: `BdApi` */
BdApi: typeof bandagedbdApi.BdApi,
[mod:string]:any
}
@ -90,6 +118,7 @@ export interface LightcordGlobal {
*/
type LightcordApiGlobal = lightcordApiMainExports & typeof LightcordApi
/** Exports that are defined [here](https://github.com/Lightcord/Lightcord/blob/master/modules/discord_desktop_core/core/app/BetterDiscord/index.js#L278) */
type lightcordApiMainExports = {
/**
* Waits until the first module that match the filter gets exported

View File

@ -9,7 +9,14 @@ import NOOP from "./noop";
import WebpackLoader, { WebpackLoaderError } from "./WebpackLoader";
let soundModule
/**
* Tools for interacting with
*/
export default new class DiscordTools {
/**
* Shows a notice on the top of Discord.
* @param data Data of the notice.
*/
showNotice(data:NoticeData):Notice{
if(typeof data !== "object" || typeof data.text !== "string")throw new Error(`This notice is not valid. Given: ${Utils.formatJSObject(data)}`)
let newData = cloneNullProto(Object.assign({}, defaultNotice, data)) as notice
@ -20,6 +27,9 @@ export default new class DiscordTools {
return notice
}
/**
* Get all the notices in queue.
*/
get notices():Notice[]{
return notices.map(data => new Notice(data))
}
@ -43,13 +53,21 @@ export default new class DiscordTools {
return notification
}
/**
* Create a sound for later use.
* @param sound The sound as defined in the Sound type.
*/
createSound(sound:Sound){
soundModule = soundModule || WebpackLoader.findByUniqueProperties(["createSound"])
if(!soundModule)throw new WebpackLoaderError("Couldn't find soundModule here.")
if(!soundModule)throw new WebpackLoaderError("Couldn't find soundModule.")
const created = soundModule.createSound(sound)
return created
}
/**
* Same as createSource, except it automatically plays.
* @param sound The sound as defined in the Sound type.
*/
playSound(sound:Sound){
const created = this.createSound(sound)
created.play()
@ -57,14 +75,26 @@ export default new class DiscordTools {
}
}
/**
* List of valid sounds.
*/
export type Sound = "call_calling"|"call_ringing"|"call_ringing_beat"|"ddr-down"|"ddr-left"|"ddr-right"|"ddr-up"|"deafen"|"discodo"|"disconnect"|"human_man"|"mention1"|"mention2"|"mention3"|"message1"|"message2"|"message3"|"mute"|"overlayunlock"|"ptt_start"|"ptt_stop"|"reconnect"|"robot_man"|"stream_ended"|"stream_started"|"stream_user_joined"|"stream_user_left"|"undeafen"|"unmute"|"user_join"|"user_leave"|"user_moved"
/**
* Notifications informations.
*/
export type NotificationData = {
/** The title of the notification */
title: string,
/** The body of the notification. Could be truncated. */
body: string,
/** An http(s) link to an icon. */
icon: string,
/** When the notification is showing */
onShow?: () => void,
/** When the user clicked the notification */
onClick?: () => void,
/** When the notification has been closed. */
onClose?: () => void
}
@ -86,6 +116,9 @@ const EventHandler = function(){
if(this.index !== this.state.index){
this.emit("index", this.index)
}
this.state.removed = this.removed
this.state.index = this.index
this.state.showing = this.showing
}
/** A notice interface for modifying it and subscribing to events. */
@ -146,7 +179,8 @@ export class Notice extends EventEmitter {
return super.off(event, listener)
}
state:{
/** Please do not modify this. It is used internally to emit events only if the data has changed. */
private state:{
removed:boolean,
showing:boolean,
index:number
@ -154,16 +188,19 @@ export class Notice extends EventEmitter {
private nextTickRefresh:boolean = false
/** if the notice is not, and will not show anymore. */
get removed():boolean{
return !notices.find(e => e.id === this.id)
}
/** If the notice is showing right now. */
get showing():boolean{
return this.index === 0
}
/** The position in the queue, 0 is showing. */
get index():number{
return notices.findIndex(e => e.id === this.id)
}
/** The id of the notice. */
get id(){
return this.data.id
}

View File

@ -2,17 +2,43 @@ import { ReactElement } from "react";
import ReactDOM = require("react-dom")
import PluginUtilities from "./PluginUtilities";
/**
* Set of methods that can help you sometimes.
*/
export default new class Utils {
constructor(){}
ReactToHTMLElement(ReactElement: ReactElement){
/**
* Return an HTML div element from a react element.
* @param ReactElement A React Element. Most of the time from `React.createElement()`
*/
ReactToHTMLElement(ReactElement: ReactElement):HTMLDivElement{
const element = document.createElement("div")
ReactDOM.render(ReactElement, element)
return element
}
/**
* Still in beta.
*/
get PluginUtils(){return PluginUtilities}
/**
* Return the object after going through the path given path
* @param obj The initial object
* @param path the path
* @example
* ```js
* const object = {
* prop1: {
* prop2: {
* str: "Lightcord"
* }
* }
* }
* console.log(Lightcord.Api.Utils.getNestedProps(object, "prop1.prop2.str")) // Lightcord
* ```
*/
getNestedProps(obj:any, path: string){
let segments = path.split(".")
for(let seg of segments){
@ -21,10 +47,18 @@ export default new class Utils {
return obj
}
/**
* Convert a decimal color to hexadecimal.
* @param color The color to convert
*/
DecimalColorToHex(color:number):string{
return "#"+color.toString(16).toUpperCase()
return "#"+color.toString(16).toUpperCase().split("").concat([].fill("0", 0, 6)).slice(0, 6).join("")
}
/**
* Convert a hexadecimal color to decimal.
* @param color The color to convert
*/
HexColorToDecimal(color:string):number{
color = color.replace(/[#;]/g, "")
let res = parseInt(color, 16)
@ -32,13 +66,21 @@ export default new class Utils {
return res
}
/**
* Removes "da-" from classnames patched by BetterDiscord.
* @param className The ClassName
*/
removeDa(className:string):string{
if(!className)return className
return className.split(" ").filter(e => !e.startsWith("da-")).join(" ")
}
/**
* Taken from https://stackoverflow.com/a/39165137. All credits goes to [Venryx](https://stackoverflow.com/users/2441655/venryx).
* @param dom The DOM Element to reverse.
* @param traverseUp A number of elemenet to go through.
*/
FindReact(dom:Element, traverseUp:number = 0):React.Component|React.PureComponent{
// taken from https://stackoverflow.com/questions/29321742/react-getting-a-component-from-a-dom-element-for-debugging#39165137
const key = Object.keys(dom).find(key=>key.startsWith("__reactInternalInstance$"));
const domFiber = dom[key];
if (domFiber == null) return null;

View File

@ -1,3 +1,6 @@
/**
* This file is automatically generated.
*/
export default interface DiscordConstantsType {
API_HOST: "discord.com",
ActionTypes: {

View File

@ -1,3 +1,6 @@
/**
* Discord's dispatcher described. Too lazy to comment everything.
*/
export default interface DispatcherTypes {
_subscriptions: any,
_waitQueue: (() => void)[],

View File

@ -6,11 +6,15 @@ const { getDiscordIPCEvent } = require('../common/constants');
const ipcRenderer = electron.ipcRenderer;
function send(ev, ...args) {
ipcRenderer.send(getDiscordIPCEvent(ev), ...args);
const event = getDiscordIPCEvent(ev)
console.log(event)
ipcRenderer.send(event, ...args);
}
function on(ev, callback) {
ipcRenderer.on(getDiscordIPCEvent(ev), callback);
const event = getDiscordIPCEvent(ev)
console.log(event)
ipcRenderer.on(event, callback);
}
module.exports = {

View File

@ -3,8 +3,17 @@
*/
const electron = require("electron")
const { setBlurType, setVibrancy } = require("./mainScreen");
const UserAgent = electron.session.defaultSession.getUserAgent()
electron.ipcMain.on("LIGHTCORD_GET_USER_AGENT", (event) => {
event.returnValue = UserAgent
})
})
electron.ipcMain.handle("LIGHTCORD_SET_BLUR_TYPE", async (event, blurType) => {
setBlurType(blurType)
});
electron.ipcMain.handle("LIGHTCORD_SET_VIBRANCY", async (event, vibrancy) => {
setVibrancy(vibrancy)
});

View File

@ -8,6 +8,28 @@ exports.webContentsSend = webContentsSend;
exports.init = init;
exports.handleSingleInstance = handleSingleInstance;
exports.setMainWindowVisible = setMainWindowVisible;
exports.setBlurType = setBlurType
exports.setVibrancy = setVibrancy
const VIBRANCY_TYPES = [
"titlebar",
"selection",
"menu",
"popover",
"sidebar",
"header",
"sheet",
"window",
"hud",
"fullscreen-ui",
"tooltip",
"content",
"under-window",
"under-page",
"none"
]
const BLUR_TYPES = ["blurbehind", "acrylic", "transparent"]
var glasstron = require("glasstron")
@ -165,6 +187,46 @@ function saveWindowConfig(browserWindow) {
}
}
function setBlur(blur){
if(!mainWindow)return
if(typeof blur !== "boolean")throw new TypeError("INVALID ARGUMENT: blur")
mainWindow.setBlur(blur)
}
function setVibrancy(vibrancy){
if(!mainWindow)return
if(!VIBRANCY_TYPES.includes(vibrancy))throw new TypeError("INVALID ARGUMENT: vibrancy")
mainWindow.setVibrancy(vibrancy)
settings.set("GLASSTRON_VIBRANCY", vibrancy)
}
function setBlurType(blurType){
if(!mainWindow)return
if(!BLUR_TYPES.includes(blurType))throw new TypeError("INVALID ARGUMENT: blurType")
mainWindow.blurType = blurType
settings.set("GLASSTRON_BLUR", blurType)
}
function setDefaultBlur(){
if(!mainWindow)return
let blurType = settings.get("GLASSTRON_BLUR", "blurbehind")
if(!BLUR_TYPES.includes(blurType)){
blurType = "blurbehind"
settings.set("GLASSTRON_BLUR", blurType)
}
setBlurType(blurType)
let vibrancy = settings.get("GLASSTRON_VIBRANCY", "fullscreen-ui")
if(!VIBRANCY_TYPES.includes(vibrancy)){
vibrancy = "fullscreen-ui"
settings.set("GLASSTRON_VIBRANCY", vibrancy)
}
setVibrancy(vibrancy)
setBlur(true)
}
function setWindowVisible(isVisible, andUnminimize) {
if (mainWindow == null) {
return;
@ -373,22 +435,14 @@ function launchMainAppWindow(isVisible) {
if(!settings.get("NO_WINDOWS_BOUND", false))applyWindowBoundsToConfig(mainWindowOptions);
mainWindow = new glasstron.BrowserWindow(mainWindowOptions);
const useGlasstron = settings.get("GLASSTRON", true)
const BrowserWindow = useGlasstron ? glasstron.BrowserWindow : electron.BrowserWindow
mainWindow = new BrowserWindow(mainWindowOptions);
mainWindowId = mainWindow.id;
global.mainWindowId = mainWindowId;
if(settings.get("GLASSTRON", true)){
let blurType = mainWindow.blurType
mainWindow.blurType = settings.get("GLASSTRON_BLUR", "blurbehind")
mainWindow.setVibrancy("fullscreen-ui")
try {
mainWindow.setBlur(true)
} catch (e){
console.error(e)
console.error("Could not setBlur(), transparency effects will not work.")
mainWindow.blurType = blurType
}
}
if(useGlasstron)setDefaultBlur()
mainWindow.webContents.session.webRequest.onHeadersReceived(function(details, callback) {
if (!details.responseHeaders["content-security-policy-report-only"] && !details.responseHeaders["content-security-policy"]) return callback({cancel: false});
delete details.responseHeaders["content-security-policy-report-only"];