SponsorBlock/src/types.ts

65 lines
1.5 KiB
TypeScript
Raw Normal View History

2020-03-12 00:35:20 +01:00
import SubmissionNotice from "./render/SubmissionNotice";
import SkipNoticeComponent from "./components/SkipNoticeComponent";
interface ContentContainer {
(): {
vote: (type: any, UUID: any, category?: string, skipNotice?: SkipNoticeComponent) => void,
2020-03-12 00:35:20 +01:00
dontShowNoticeAgain: () => void,
unskipSponsorTime: (segment: SponsorTime) => void,
sponsorTimes: SponsorTime[],
sponsorTimesSubmitting: SponsorTime[],
2020-03-12 00:35:20 +01:00
v: HTMLVideoElement,
sponsorVideoID,
reskipSponsorTime: (segment: SponsorTime) => void,
2020-03-12 00:35:20 +01:00
updatePreviewBar: () => void,
onMobileYouTube: boolean,
sponsorSubmissionNotice: SubmissionNotice,
resetSponsorSubmissionNotice: () => void,
2020-03-12 00:56:16 +01:00
changeStartSponsorButton: (showStartSponsor: any, uploadButtonVisible: any) => Promise<boolean>,
previewTime: (time: number) => void,
videoInfo: any,
getRealCurrentTime: () => number
2020-03-12 00:35:20 +01:00
}
}
interface VideoDurationResponse {
2020-01-29 05:52:15 +01:00
duration: number;
}
enum CategorySkipOption {
ShowOverlay,
ManualSkip,
AutoSkip
}
2020-04-03 04:13:36 +02:00
interface CategorySelection {
name: string;
option: CategorySkipOption
2020-04-03 04:13:36 +02:00
}
2020-03-12 00:35:20 +01:00
enum SponsorHideType {
Visible = undefined,
Downvoted = 1,
MinimumDuration
}
interface SponsorTime {
segment: number[];
UUID: string;
category: string;
hidden?: SponsorHideType;
}
type VideoID = string;
2020-01-29 05:52:15 +01:00
export {
2020-03-12 00:35:20 +01:00
VideoDurationResponse,
2020-04-03 04:13:36 +02:00
ContentContainer,
CategorySelection,
CategorySkipOption,
SponsorTime,
VideoID,
SponsorHideType
2020-01-29 05:52:15 +01:00
};