User array filter
[GitHub/WoltLab/WCF.git] / ts / global.d.ts
1 import DatePicker from "WoltLabSuite/Core/Date/Picker";
2 import Devtools from "WoltLabSuite/Core/Devtools";
3 import DomUtil from "WoltLabSuite/Core/Dom/Util";
4 import * as ColorUtil from "WoltLabSuite/Core/ColorUtil";
5 import * as EventHandler from "WoltLabSuite/Core/Event/Handler";
6 import UiDropdownSimple from "WoltLabSuite/Core/Ui/Dropdown/Simple";
7 import "@woltlab/editor";
8 import "@woltlab/zxcvbn";
9 import { Reaction } from "WoltLabSuite/Core/Ui/Reaction/Data";
10 import type WoltlabCoreDialogElement from "WoltLabSuite/Core/Element/woltlab-core-dialog";
11 import type WoltlabCoreDialogControlElement from "WoltLabSuite/Core/Element/woltlab-core-dialog-control";
12 import type WoltlabCoreGoogleMapsElement from "WoltLabSuite/Core/Component/GoogleMaps/woltlab-core-google-maps";
13
14 type Codepoint = string;
15 type HasRegularVariant = boolean;
16 type IconMetadata = [Codepoint, HasRegularVariant];
17
18 type IconSize = 16 | 24 | 32 | 48 | 64 | 96 | 128 | 144;
19 type LoadingIndicatorIconSize = 24 | 48 | 96;
20
21 declare global {
22 interface WoltLabTemplate {
23 fetch(v: object): string;
24 }
25
26 interface Window {
27 Devtools?: typeof Devtools;
28 ENABLE_DEBUG_MODE: boolean;
29 ENABLE_DEVELOPER_TOOLS: boolean;
30 LANGUAGE_ID: number;
31 PAGE_TITLE: string;
32 REACTION_TYPES: {
33 [key: string]: Reaction;
34 };
35 TIME_NOW: number;
36 WCF_PATH: string;
37 WSC_API_URL: string;
38
39 getFontAwesome6Metadata: () => Map<string, IconMetadata>;
40 getFontAwesome6IconMetadata: (name: string) => IconMetadata | undefined;
41
42 jQuery: JQueryStatic;
43 WCF: any;
44 bc_wcfDomUtil: typeof DomUtil;
45 bc_wcfSimpleDropdown: typeof UiDropdownSimple;
46 __wcf_bc_colorPickerInit?: () => void;
47 __wcf_bc_colorUtil: typeof ColorUtil;
48 __wcf_bc_datePicker: typeof DatePicker;
49 __wcf_bc_eventHandler: typeof EventHandler;
50
51 WoltLabLanguage: {
52 getPhrase(key: string, parameters?: object): string;
53 registerPhrase(key: string, value: string): void;
54 };
55
56 WoltLabTemplate: new (template: string) => WoltLabTemplate;
57 }
58
59 interface String {
60 hashCode: () => string;
61 }
62
63 interface JQuery {
64 sortable(...args: any[]): unknown;
65
66 messageTabMenu(...args: any[]): unknown;
67 }
68
69 type ArbitraryObject = Record<string, unknown>;
70
71 class HTMLParsedElement extends HTMLElement {
72 parsedCallback(): void;
73 }
74
75 interface FaBrand extends HTMLElement {
76 size: IconSize;
77 }
78
79 interface FaIcon extends HTMLElement {
80 readonly name: string;
81 readonly solid: boolean;
82 size: IconSize;
83
84 setIcon: (name: string, forceSolid?: boolean) => void;
85 }
86
87 interface WoltlabCoreDateTime extends HTMLElement {
88 static: boolean;
89
90 get date(): Date;
91 set date(date: Date);
92 }
93
94 interface WoltlabCoreLoadingIndicatorElement extends HTMLElement {
95 get size(): LoadingIndicatorIconSize;
96 set size(size: LoadingIndicatorIconSize);
97 get hideText(): boolean;
98 set hideText(hideText: boolean);
99 }
100
101 interface WoltlabCoreReactionSummaryElement extends HTMLElement {
102 get objectId(): number;
103 get objectType(): string;
104 setData: (data: Map<number, number>, selectedReaction?: number) => void;
105 }
106
107 interface WoltlabCorePaginationElement extends HTMLElement {
108 getLinkUrl(page: number): string;
109 jumpToPage(page: number): void;
110 get count(): number;
111 set count(count: number);
112 get page(): number;
113 set page(page: number);
114 get url(): string;
115 set url(url: string);
116 }
117
118 interface HTMLElementTagNameMap {
119 "fa-brand": FaBrand;
120 "fa-icon": FaIcon;
121 "woltlab-core-dialog": WoltlabCoreDialogElement;
122 "woltlab-core-dialog-control": WoltlabCoreDialogControlElement;
123 "woltlab-core-date-time": WoltlabCoreDateTime;
124 "woltlab-core-loading-indicator": WoltlabCoreLoadingIndicatorElement;
125 "woltlab-core-pagination": WoltlabCorePaginationElement;
126 "woltlab-core-google-maps": WoltlabCoreGoogleMapsElement;
127 "woltlab-core-reaction-summary": WoltlabCoreReactionSummaryElement;
128 }
129 }