import { AjaxCallbackSetup } from "../../../../../Ajax/Data";
import { DialogCallbackSetup } from "../../../../../Ui/Dialog/Data";
+type CallbackSuccess = (data: AjaxResponseSuccess) => void;
+
+interface AjaxResponseSuccess {
+ loopCount: number;
+ parameters: ArbitraryObject;
+ proceedURL: string;
+ progress: number;
+ template?: string;
+}
+
interface AjaxResponse {
returnValues: {
template: string;
class AcpUserContentRemoveHandler {
private readonly dialogId: string;
private readonly userId: number;
+ private readonly callbackSuccess: CallbackSuccess | null | undefined;
/**
* Initializes the content remove handler.
*/
- constructor(element: HTMLElement, userId: number) {
+ constructor(element: HTMLElement, userId: number, callbackSuccess?: CallbackSuccess | null) {
this.userId = userId;
this.dialogId = `userRemoveContentHandler-${this.userId}`;
+ this.callbackSuccess = callbackSuccess;
element.addEventListener("click", (ev) => this.click(ev));
}
userID: this.userId,
contentProvider: objectTypes,
},
+ callbackSuccess: this.callbackSuccess,
});
}
/**
* Initializes the content remove handler.
*/
- constructor(element, userId) {
+ constructor(element, userId, callbackSuccess) {
this.userId = userId;
this.dialogId = `userRemoveContentHandler-${this.userId}`;
+ this.callbackSuccess = callbackSuccess;
element.addEventListener("click", (ev) => this.click(ev));
}
/**
userID: this.userId,
contentProvider: objectTypes,
},
+ callbackSuccess: this.callbackSuccess,
});
}
/**