
// 假设 IPage 接口的定义
interface IPage {
    // 这里可以根据实际情况添加 IPage 接口的成员
}

// 假设 MessageBoxButton、MessageBoxImage、MessageBoxResult 的枚举定义
enum MessageBoxButton {
    OK,
    YesNo
}

enum MessageBoxImage {
    Information,
    Error,
    Question,
    Warning,
    Exclamation
}

enum MessageBoxResult {
    None,
    OK,
    Yes,
    No
}

// 假设 Key 类型的定义
type Key = string;

// 假设 PageMessageBox、PageMessageBoxExt、PageMessageBoxSimple、PageMessageBoxMetro 类的模拟实现
class PageMessageBox {
    show(target: IPage, content: object, caption: string, messageBoxButton: MessageBoxButton, messageBoxImage: MessageBoxImage, defaultResult: MessageBoxResult): MessageBoxResult {
        // 这里实现显示消息框的逻辑，返回用户点击的结果
        return MessageBoxResult.None;
    }
}

class PageMessageBoxExt {
    constructor(target: IPage, messageBoxText: string, content: { [key: string]: string }, defaultFocus: Key) {
        // 这里实现初始化逻辑
    }

    get MessageDialogMode(): Key {
        // 这里返回用户点击的按钮对应的键
        return "";
    }
}

class PageMessageBoxSimple {
    constructor(target: IPage, messageBoxText: string, defaultButton?: string, ...buttonConent: string[]) {
        // 这里实现初始化逻辑
    }

    get MessageDialogResult(): string {
        // 这里返回用户点击按钮的结果
        return "";
    }
}

class PageMessageBoxMetro {
    constructor(target: IPage, messagecontnt: object, caption: string, image: any, direction: number, isreverse: boolean, iscoverall: boolean, animationEnable: boolean, defaultButton: string, ...buttonConent: string[]) {
        // 这里实现初始化逻辑
    }

    get MessageDialogResult(): string {
        // 这里返回用户点击按钮的结果
        return "";
    }
}

// MsgHelper 类的 TypeScript 实现
export class MsgHelper {
    static ShowMessageBox(target: IPage, content: object, caption: string = "", messageBoxButton: MessageBoxButton = MessageBoxButton.OK, messageBoxImage: MessageBoxImage = MessageBoxImage.Information, defaultResult: MessageBoxResult = MessageBoxResult.None): MessageBoxResult {
        const pageMessageBox = new PageMessageBox();
        return pageMessageBox.show(target, content, caption, messageBoxButton, messageBoxImage, defaultResult);
    }

    static ShowInfoMessageBox(target: IPage, content: object): MessageBoxResult {
        return this.ShowMessageBox(target, content, "Information", MessageBoxButton.OK, MessageBoxImage.Exclamation);
    }

    static ShowErrorMessageBox(target: IPage, content: object): MessageBoxResult {
        return this.ShowMessageBox(target, content, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
    }

    static ShowQuestionMessageBox(target: IPage, content: object): MessageBoxResult {
        return this.ShowMessageBox(target, content, "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
    }

    static ShowWarnMessageBox(target: IPage, content: object): MessageBoxResult {
        return this.ShowMessageBox(target, content, "Warn", MessageBoxButton.OK, MessageBoxImage.Warning);
    }

    static ShowPageMessageBoxExt(target: IPage, messageBoxText: string, content: { [key: string]: string }, defaultFocus: Key = ""): Key {
        const pageMessageBoxExt = new PageMessageBoxExt(target, messageBoxText, content, defaultFocus);
        return pageMessageBoxExt.MessageDialogMode;
    }

    static ShowPageMessageBoxSimple(target: IPage, messageBoxText: string, defaultButton?: string, ...buttonConent: string[]): string {
        const dialog = new PageMessageBoxSimple(target, messageBoxText, defaultButton, ...buttonConent);
        return dialog.MessageDialogResult;
    }

    static ShowPageMessageBoxMetro(target: IPage, messagecontnt: object, caption: string, image: any, defaultButton: string, direction: number = 0, isreverse: boolean = true, iscoverall: boolean = true, animationEnable: boolean = true, ...buttonConent: string[]): string {
        const dialog = new PageMessageBoxMetro(target, messagecontnt, caption, image, direction, isreverse, iscoverall, animationEnable, defaultButton, ...buttonConent);
        return dialog.MessageDialogResult;
    }
}