mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-01 22:29:20 +03:00
Added config types and added back handler to proxy
This commit is contained in:
61
src/SB.ts
61
src/SB.ts
@@ -1,6 +1,27 @@
|
|||||||
|
interface SBConfig {
|
||||||
|
sponsorTimes: SBMap<string, any>,
|
||||||
|
startSponsorKeybind: string,
|
||||||
|
submitKeybind: string,
|
||||||
|
minutesSaved: number,
|
||||||
|
skipCount: number,
|
||||||
|
sponsorTimesContributed: number,
|
||||||
|
disableSkipping: boolean,
|
||||||
|
disableAutoSkip: boolean,
|
||||||
|
trackViewCount: boolean,
|
||||||
|
dontShowNotice: boolean,
|
||||||
|
hideVideoPlayerControls: boolean,
|
||||||
|
hideInfoButtonPlayerControls: boolean,
|
||||||
|
hideDeleteButtonPlayerControls: boolean,
|
||||||
|
hideDiscordLaunches: number,
|
||||||
|
hideDiscordLink: boolean,
|
||||||
|
invidiousInstances: string[],
|
||||||
|
invidiousUpdateInfoShowCount: number,
|
||||||
|
autoUpvote: boolean
|
||||||
|
}
|
||||||
|
|
||||||
interface SBObject {
|
interface SBObject {
|
||||||
configListeners: Array<Function>;
|
configListeners: Array<Function>;
|
||||||
defaults: any;
|
defaults: SBConfig;
|
||||||
localConfig: any;
|
localConfig: any;
|
||||||
config: any;
|
config: any;
|
||||||
}
|
}
|
||||||
@@ -32,24 +53,24 @@ var SB: SBObject = {
|
|||||||
*/
|
*/
|
||||||
configListeners: [],
|
configListeners: [],
|
||||||
defaults: {
|
defaults: {
|
||||||
"sponsorTimes": new SBMap(),
|
sponsorTimes: new SBMap(),
|
||||||
"startSponsorKeybind": ";",
|
startSponsorKeybind: ";",
|
||||||
"submitKeybind": "'",
|
submitKeybind: "'",
|
||||||
"minutesSaved": 0,
|
minutesSaved: 0,
|
||||||
"skipCount": 0,
|
skipCount: 0,
|
||||||
"sponsorTimesContributed": 0,
|
sponsorTimesContributed: 0,
|
||||||
"disableSkipping": false,
|
disableSkipping: false,
|
||||||
"disableAutoSkip": false,
|
disableAutoSkip: false,
|
||||||
"trackViewCount": true,
|
trackViewCount: true,
|
||||||
"dontShowNotice": false,
|
dontShowNotice: false,
|
||||||
"hideVideoPlayerControls": false,
|
hideVideoPlayerControls: false,
|
||||||
"hideInfoButtonPlayerControls": false,
|
hideInfoButtonPlayerControls: false,
|
||||||
"hideDeleteButtonPlayerControls": false,
|
hideDeleteButtonPlayerControls: false,
|
||||||
"hideDiscordLaunches": 0,
|
hideDiscordLaunches: 0,
|
||||||
"hideDiscordLink": false,
|
hideDiscordLink: false,
|
||||||
"invidiousInstances": ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
invidiousInstances: ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
||||||
"invidiousUpdateInfoShowCount": 0,
|
invidiousUpdateInfoShowCount: 0,
|
||||||
"autoUpvote": true
|
autoUpvote: true
|
||||||
},
|
},
|
||||||
localConfig: null,
|
localConfig: null,
|
||||||
config: null
|
config: null
|
||||||
@@ -179,7 +200,7 @@ function configProxy(): any {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return new Proxy({}, handler);
|
return new Proxy({handler}, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchConfig() {
|
function fetchConfig() {
|
||||||
|
|||||||
Reference in New Issue
Block a user