mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Added config types and added back handler to proxy
This commit is contained in:
parent
bb9de35722
commit
5bb5dae20e
1 changed files with 41 additions and 20 deletions
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 {
|
||||
configListeners: Array<Function>;
|
||||
defaults: any;
|
||||
defaults: SBConfig;
|
||||
localConfig: any;
|
||||
config: any;
|
||||
}
|
||||
|
@ -32,24 +53,24 @@ var SB: SBObject = {
|
|||
*/
|
||||
configListeners: [],
|
||||
defaults: {
|
||||
"sponsorTimes": new SBMap(),
|
||||
"startSponsorKeybind": ";",
|
||||
"submitKeybind": "'",
|
||||
"minutesSaved": 0,
|
||||
"skipCount": 0,
|
||||
"sponsorTimesContributed": 0,
|
||||
"disableSkipping": false,
|
||||
"disableAutoSkip": false,
|
||||
"trackViewCount": true,
|
||||
"dontShowNotice": false,
|
||||
"hideVideoPlayerControls": false,
|
||||
"hideInfoButtonPlayerControls": false,
|
||||
"hideDeleteButtonPlayerControls": false,
|
||||
"hideDiscordLaunches": 0,
|
||||
"hideDiscordLink": false,
|
||||
"invidiousInstances": ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
||||
"invidiousUpdateInfoShowCount": 0,
|
||||
"autoUpvote": true
|
||||
sponsorTimes: new SBMap(),
|
||||
startSponsorKeybind: ";",
|
||||
submitKeybind: "'",
|
||||
minutesSaved: 0,
|
||||
skipCount: 0,
|
||||
sponsorTimesContributed: 0,
|
||||
disableSkipping: false,
|
||||
disableAutoSkip: false,
|
||||
trackViewCount: true,
|
||||
dontShowNotice: false,
|
||||
hideVideoPlayerControls: false,
|
||||
hideInfoButtonPlayerControls: false,
|
||||
hideDeleteButtonPlayerControls: false,
|
||||
hideDiscordLaunches: 0,
|
||||
hideDiscordLink: false,
|
||||
invidiousInstances: ["invidio.us", "invidiou.sh", "invidious.snopyta.org"],
|
||||
invidiousUpdateInfoShowCount: 0,
|
||||
autoUpvote: true
|
||||
},
|
||||
localConfig: null,
|
||||
config: null
|
||||
|
@ -179,7 +200,7 @@ function configProxy(): any {
|
|||
|
||||
};
|
||||
|
||||
return new Proxy({}, handler);
|
||||
return new Proxy({handler}, handler);
|
||||
}
|
||||
|
||||
function fetchConfig() {
|
||||
|
|
Loading…
Reference in a new issue