-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathglobal.d.ts
More file actions
77 lines (64 loc) · 2.27 KB
/
global.d.ts
File metadata and controls
77 lines (64 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
declare function GM_addStyle(css: string): void
declare function GM_getResourceText(name: string): string
type GMValue<T = string | number | boolean | object | GMValue[]> = T
declare function GM_getValue<T = GMValue>(name: string): T | undefined
declare function GM_getValue<T = GMValue>(name: string, defaultValue: T): T
declare function GM_setValue(name: string, value: GMValue): void
declare function GM_deleteValue(name: string): void
declare function GM_listValues(): string[]
declare function GM_setClipboard(text: string): void
declare function GM_registerMenuCommand(
caption: string,
commandFunc: (event: MouseEvent | KeyboardEvent) => void,
accessKey?: string
): number
interface GMRegisterMenuCommandOptions {
id?: number | string
accessKey?: string
autoClose?: boolean
title?: string
}
declare function GM_registerMenuCommand(
caption: string,
commandFunc: (event: MouseEvent | KeyboardEvent) => void,
options?: GMRegisterMenuCommandOptions
): number
declare function GM_openInTab(url: string, loadInBackground?: boolean): void
type GMOpenInTabOptions = {
active?: boolean
insert?: boolean
setParent?: boolean
incognito?: boolean
loadInBackground?: boolean
}
declare function GM_openInTab(url: string, options?: GMOpenInTabOptions): void
declare type ReactElement = import('react').ReactElement
declare type ReactNode = import('react').ReactNode
declare type ChangeEvent<T> = import('react').ChangeEvent<T>
declare type Immer = import('immer').Immer
declare const immer: Immer
declare type Lodash = import('lodash').LoDashStatic
declare const _: Lodash
interface UnsafeWindow extends Window {}
declare const unsafeWindow: UnsafeWindow
interface YtdPlayerElement extends HTMLElement {
loadVideoWithPlayerVars(options: { videoId: string; start?: number }): void
getPlayer: () => YouTubePlayer
}
interface YouTubeMoviePlayerElement extends HTMLElement, YouTubePlayer {
loadVideoByPlayerVars(options: { videoId: string; start?: number }): void
toggleSubtitles(): void
toggleSubtitlesOn(): void
isSubtitlesOn(): boolean
}
interface YouTubePlayer {
getVideoData: () => YouTubeVideoData
getCurrentTime: () => number
getDuration: () => number
loadVideoById: (videoId: string, startTime?: number) => void
}
interface YouTubeVideoData {
title: string
video_id: string
isLive: boolean
}