-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.d.ts
150 lines (125 loc) · 4.67 KB
/
global.d.ts
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import DatePicker from "WoltLabSuite/Core/Date/Picker";
import Devtools from "WoltLabSuite/Core/Devtools";
import DomUtil from "WoltLabSuite/Core/Dom/Util";
import * as ColorUtil from "WoltLabSuite/Core/ColorUtil";
import * as EventHandler from "WoltLabSuite/Core/Event/Handler";
import UiDropdownSimple from "WoltLabSuite/Core/Ui/Dropdown/Simple";
import "@woltlab/editor";
import "@woltlab/zxcvbn";
import { Reaction } from "WoltLabSuite/Core/Ui/Reaction/Data";
import type WoltlabCoreDialogElement from "WoltLabSuite/Core/Element/woltlab-core-dialog";
import type WoltlabCoreDialogControlElement from "WoltLabSuite/Core/Element/woltlab-core-dialog-control";
import type WoltlabCoreGoogleMapsElement from "WoltLabSuite/Core/Component/GoogleMaps/woltlab-core-google-maps";
import type WoltlabCoreFileElement from "WoltLabSuite/Core/Component/File/woltlab-core-file";
type Codepoint = string;
type HasRegularVariant = boolean;
type IconMetadata = [Codepoint, HasRegularVariant];
type IconSize = 16 | 24 | 32 | 48 | 64 | 96 | 128 | 144;
type LoadingIndicatorIconSize = 24 | 48 | 96;
type WoltlabCoreNoticeElementType = "error" | "info" | "success" | "warning";
declare global {
interface WoltLabTemplate {
fetch(v: object): string;
}
interface Window {
Devtools?: typeof Devtools;
ENABLE_DEBUG_MODE: boolean;
ENABLE_DEVELOPER_TOOLS: boolean;
LANGUAGE_ID: number;
PAGE_TITLE: string;
REACTION_TYPES: {
[key: string]: Reaction;
};
TIME_NOW: number;
WCF_PATH: string;
WSC_API_URL: string;
WSC_RPC_API_URL: string;
getFontAwesome6Metadata: () => Map<string, IconMetadata>;
getFontAwesome6IconMetadata: (name: string) => IconMetadata | undefined;
jQuery: JQueryStatic;
WCF: any;
bc_wcfDomUtil: typeof DomUtil;
bc_wcfSimpleDropdown: typeof UiDropdownSimple;
__wcf_bc_colorPickerInit?: () => void;
__wcf_bc_colorUtil: typeof ColorUtil;
__wcf_bc_datePicker: typeof DatePicker;
__wcf_bc_eventHandler: typeof EventHandler;
__wcf_bc_getPageOverlayContainer: () => HTMLElement;
WoltLabLanguage: {
getPhrase(key: string, parameters?: object): string;
registerPhrase(key: string, value: string): void;
};
WoltLabTemplate: new (template: string) => WoltLabTemplate;
}
interface String {
hashCode: () => string;
}
interface JQuery {
sortable(...args: any[]): unknown;
messageTabMenu(...args: any[]): unknown;
}
type ArbitraryObject = Record<string, unknown>;
class HTMLParsedElement extends HTMLElement {
parsedCallback(): void;
}
interface FaBrand extends HTMLElement {
size: IconSize;
}
interface FaIcon extends HTMLElement {
readonly name: string;
readonly solid: boolean;
size: IconSize;
setIcon: (name: string, forceSolid?: boolean) => void;
}
interface WoltlabCoreDateTime extends HTMLElement {
static: boolean;
get date(): Date;
set date(date: Date);
}
interface WoltlabCoreFileUploadElement extends HTMLElement {
get disabled(): boolean;
set disabled(disabled: boolean);
get maximumCount(): number;
get maximumSize(): number;
}
interface WoltlabCoreLoadingIndicatorElement extends HTMLElement {
get size(): LoadingIndicatorIconSize;
set size(size: LoadingIndicatorIconSize);
get hideText(): boolean;
set hideText(hideText: boolean);
}
interface WoltlabCoreNoticeElement extends HTMLElement {
get type(): WoltlabCoreNoticeElementType;
set type(type: WoltlabCoreNoticeElementType);
get icon(): string;
}
interface WoltlabCoreReactionSummaryElement extends HTMLElement {
get objectId(): number;
get objectType(): string;
setData: (data: Map<number, number>, selectedReaction?: number) => void;
}
interface WoltlabCorePaginationElement extends HTMLElement {
getLinkUrl(page: number): string;
jumpToPage(page: number): void;
get count(): number;
set count(count: number);
get page(): number;
set page(page: number);
get url(): string;
set url(url: string);
}
interface HTMLElementTagNameMap {
"fa-brand": FaBrand;
"fa-icon": FaIcon;
"woltlab-core-dialog": WoltlabCoreDialogElement;
"woltlab-core-dialog-control": WoltlabCoreDialogControlElement;
"woltlab-core-date-time": WoltlabCoreDateTime;
"woltlab-core-file": WoltlabCoreFileElement;
"woltlab-core-file-upload": WoltlabCoreFileUploadElement;
"woltlab-core-loading-indicator": WoltlabCoreLoadingIndicatorElement;
"woltlab-core-notice": WoltlabCoreNoticeElement;
"woltlab-core-pagination": WoltlabCorePaginationElement;
"woltlab-core-google-maps": WoltlabCoreGoogleMapsElement;
"woltlab-core-reaction-summary": WoltlabCoreReactionSummaryElement;
}
}