return PLURAL_ONE;
},
// Tibetan
- bo(_n) { },
+ bo(_n) {
+ return undefined;
+ },
// Bosnian
bs(n) {
const v = Plural.getV(n);
return PLURAL_ONE;
},
// Indonesian
- id(_n) { },
+ id(_n) {
+ return undefined;
+ },
// Icelandic
is(n) {
const f = Plural.getF(n);
return PLURAL_ONE;
},
// Japanese
- ja(_n) { },
+ ja(_n) {
+ return undefined;
+ },
// Javanese
- jv(_n) { },
+ jv(_n) {
+ return undefined;
+ },
// Georgian
ka(n) {
if (n == 1)
return PLURAL_ONE;
},
// Khmer
- km(_n) { },
+ km(_n) {
+ return undefined;
+ },
// Kannada
kn(n) {
if (n >= 0 && n <= 1)
return PLURAL_ONE;
},
// Korean
- ko(_n) { },
+ ko(_n) {
+ return undefined;
+ },
// Kurdish
ku(n) {
if (n == 1)
return PLURAL_ONE;
},
// Lao
- lo(_n) { },
+ lo(_n) {
+ return undefined;
+ },
// Lithuanian
lt(n) {
const mod10 = n % 10;
return PLURAL_ONE;
},
// Malay
- ms(_n) { },
+ ms(_n) {
+ return undefined;
+ },
// Maltese
mt(n) {
const mod100 = n % 100;
return PLURAL_MANY;
},
// Burmese
- my(_n) { },
+ my(_n) {
+ return undefined;
+ },
// Norwegian
no(n) {
if (n == 1)
return PLURAL_ONE;
},
// Tajik
- tg(_n) { },
+ tg(_n) {
+ return undefined;
+ },
// Thai
- th(_n) { },
+ th(_n) {
+ return undefined;
+ },
// Turkmen
tk(n) {
if (n == 1)
return PLURAL_ONE;
},
// Vietnamese
- vi(_n) { },
+ vi(_n) {
+ return undefined;
+ },
// Chinese
- zh(_n) { },
+ zh(_n) {
+ return undefined;
+ },
};
return Plural;
});
_callbackList.forEach(null, (callback) => callback());
},
};
- document.body.addEventListener("click", UiCloseOverlay.execute);
+ document.body.addEventListener("click", () => UiCloseOverlay.execute());
return UiCloseOverlay;
});
}
/**
* Opens the lookup overlay for provided page id.
- *
- * @param {int} pageId page id
- * @param {string} title dialog title
- * @param {function} callback callback function provided with the user-selected object id
- * @param {string?} labelLanguageItem optional language item name for the search input label
*/
function open(pageId, title, callback, labelLanguageItem) {
getUiPageSearchHandler().open(pageId, title, callback, labelLanguageItem);
/**
* Returns the unique prefix for the localStorage.
*/
-export function getStoragePrefix() {
+export function getStoragePrefix(): string {
return _prefix;
}
},
// Tibetan
- bo(_n: number) {},
+ bo(_n: number): string | undefined {
+ return undefined;
+ },
// Bosnian
bs(n: number): string | undefined {
},
// Indonesian
- id(_n: number) {},
+ id(_n: number): string | undefined {
+ return undefined;
+ },
// Icelandic
is(n: number): string | undefined {
},
// Japanese
- ja(_n: number) {},
+ ja(_n: number): string | undefined {
+ return undefined;
+ },
// Javanese
- jv(_n: number) {},
+ jv(_n: number): string | undefined {
+ return undefined;
+ },
// Georgian
ka(n: number): string | undefined {
},
// Khmer
- km(_n: number) {},
+ km(_n: number): string | undefined {
+ return undefined;
+ },
// Kannada
kn(n: number): string | undefined {
},
// Korean
- ko(_n: number) {},
+ ko(_n: number): string | undefined {
+ return undefined;
+ },
// Kurdish
ku(n: number): string | undefined {
},
// Lao
- lo(_n: number) {},
+ lo(_n: number): string | undefined {
+ return undefined;
+ },
// Lithuanian
lt(n: number): string | undefined {
},
// Malay
- ms(_n: number) {},
+ ms(_n: number): string | undefined {
+ return undefined;
+ },
// Maltese
mt(n: number): string | undefined {
},
// Burmese
- my(_n: number) {},
+ my(_n: number): string | undefined {
+ return undefined;
+ },
// Norwegian
no(n: number): string | undefined {
},
// Tajik
- tg(_n: number) {},
+ tg(_n: number): string | undefined {
+ return undefined;
+ },
// Thai
- th(_n: number) {},
+ th(_n: number): string | undefined {
+ return undefined;
+ },
// Turkmen
tk(n: number): string | undefined {
},
// Vietnamese
- vi(_n: number) {},
+ vi(_n: number): string | undefined {
+ return undefined;
+ },
// Chinese
- zh(_n: number) {},
+ zh(_n: number): string | undefined {
+ return undefined;
+ },
};
export = Plural;
import * as Ajax from "../../Ajax";
import { AjaxCallbackObject, CallbackSetup, DatabaseObjectActionResponse } from "../../Ajax/Data";
-import { DialogCallbackObject } from "../Dialog/Data";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "../Dialog/Data";
import DomUtil from "../../Dom/Util";
import * as Language from "../../Language";
import * as StringUtil from "../../StringUtil";
};
}
- _dialogSetup() {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "wcfUiArticleSearch",
options: {
return uiArticleSearch;
}
-export function open(callbackSelect) {
+export function open(callbackSelect: CallbackSelect): void {
getUiArticleSearch().open(callbackSelect);
}
/**
* Invokes all registered callbacks.
*/
- execute() {
+ execute(): void {
_callbackList.forEach(null, (callback) => callback());
},
};
-document.body.addEventListener("click", UiCloseOverlay.execute);
+document.body.addEventListener("click", () => UiCloseOverlay.execute());
export = UiCloseOverlay;
import * as Core from "../Core";
import * as Language from "../Language";
import UiDialog from "./Dialog";
-import { DialogCallbackObject } from "./Dialog/Data";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "./Dialog/Data";
class UiConfirmation implements DialogCallbackObject {
private _active = false;
this.confirmButton.focus();
}
- _dialogSetup() {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "wcfSystemConfirmation",
options: {
export type DialogHtml = DocumentFragment | string | null;
+export type CallbackSetup = () => DialogSettings;
+export type CallbackSubmit = () => void;
+
export interface DialogCallbackObject {
- _dialogSetup: () => DialogSettings;
- _dialogSubmit?: () => void;
+ _dialogSetup: CallbackSetup;
+ _dialogSubmit?: CallbackSubmit;
}
export interface AjaxInitialization extends RequestPayload {
* @module WoltLabSuite/Core/Ui/Page/JumpTo
*/
-import { DialogCallbackObject, DialogSettings } from "../Dialog/Data";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "../Dialog/Data";
import * as Language from "../../Language";
import UiDialog from "../Dialog";
UiDialog.close(this);
}
- _dialogSetup(): DialogSettings {
+ _dialogSetup(): ReturnType<DialogSetup> {
const source = `<dl>
<dt><label for="jsPaginationPageNo">${Language.get("wcf.page.jumpTo")}</label></dt>
<dd>
import * as Ajax from "../../Ajax";
import { AjaxCallbackObject, CallbackSetup, DatabaseObjectActionResponse } from "../../Ajax/Data";
-import { DialogCallbackObject } from "../Dialog/Data";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "../Dialog/Data";
import DomUtil from "../../Dom/Util";
import * as Language from "../../Language";
import * as StringUtil from "../../StringUtil";
};
}
- _dialogSetup() {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "wcfUiPageSearch",
options: {
import * as StringUtil from "../../../StringUtil";
import DomUtil from "../../../Dom/Util";
import UiDialog from "../../Dialog";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "../../Dialog/Data";
import UiPageSearchInput from "./Input";
import { DatabaseObjectActionResponse } from "../../../Ajax/Data";
returnValues: ItemData[];
}
-class UiPageSearchHandler {
+class UiPageSearchHandler implements DialogCallbackObject {
private callbackSuccess?: CallbackSelect = undefined;
private resultList?: HTMLUListElement = undefined;
private resultListContainer?: HTMLElement = undefined;
UiDialog.close(this);
}
- _dialogSetup() {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "wcfUiPageSearchHandler",
options: {
/**
* Opens the lookup overlay for provided page id.
- *
- * @param {int} pageId page id
- * @param {string} title dialog title
- * @param {function} callback callback function provided with the user-selected object id
- * @param {string?} labelLanguageItem optional language item name for the search input label
*/
-export function open(pageId, title, callback, labelLanguageItem) {
+export function open(pageId: number, title: string, callback: CallbackSelect, labelLanguageItem?: string): void {
getUiPageSearchHandler().open(pageId, title, callback, labelLanguageItem);
}
/**
* Removes an excluded search value.
*/
- removeExcludedValue(value: string) {
+ removeExcludedValue(value: string): void {
this.excludedSearchValues.delete(value);
}
/**
* Sets up tab menus and binds listeners.
*/
-export function setup() {
+export function setup(): void {
init();
selectErroneousTabs();
return _tabMenus.get(containerId);
}
-export function scrollToTab(tab) {
+export function scrollToTab(tab): void {
if (!_enableTabScroll) {
return;
}
return this.tabs;
}
- static getIdentifierFromHash() {
+ static getIdentifierFromHash(): string {
if (window.location.hash.match(/^#+([^\/]+)+(?:\/.+)?/)) {
return RegExp.$1;
}
import * as Ajax from "../../Ajax";
import { AjaxCallbackObject, CallbackSetup } from "../../Ajax/Data";
import * as Core from "../../Core";
-import { DialogCallbackObject, DialogSettings } from "../Dialog/Data";
+import { DialogCallbackObject, CallbackSetup as DialogSetup } from "../Dialog/Data";
import DomUtil from "../../Dom/Util";
import * as Language from "../../Language";
import * as StringUtil from "../../StringUtil";
};
}
- _dialogSetup(): DialogSettings {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "wcfUiUserEditor",
options: {
/**
* Initializes the user editor.
*/
-export function init() {
+export function init(): void {
new UserEditor();
}
import UiDialog from "../Dialog";
import UiPagination from "../Pagination";
import { AjaxCallbackObject, CallbackSetup, DatabaseObjectActionResponse } from "../../Ajax/Data";
-import { DialogCallbackObject, DialogData, DialogSettings } from "../Dialog/Data";
+import { DialogCallbackObject, DialogData, CallbackSetup as DialogSetup } from "../Dialog/Data";
/**
* @constructor
};
}
- _dialogSetup(): DialogSettings {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: DomUtil.getUniqueId(),
options: {
import * as Ajax from "../../../Ajax";
import { AjaxCallbackObject, CallbackSetup, DatabaseObjectActionResponse } from "../../../Ajax/Data";
-import { DialogCallbackObject, DialogData } from "../../Dialog/Data";
+import { DialogCallbackObject, DialogData, CallbackSetup as DialogSetup } from "../../Dialog/Data";
import DomChangeListener from "../../../Dom/Change/Listener";
import UiDialog from "../../Dialog";
import UiPagination from "../../Pagination";
};
}
- _dialogSetup() {
+ _dialogSetup(): ReturnType<DialogSetup> {
return {
id: "userTrophyListOverlay",
options: {