// 定义 Visibility 枚举
enum Visibility {
    Visible = 'visible',
    Collapsed = 'collapsed'
}

// 定义 IValueConverter 接口
interface IValueConverter {
    convert(value: any, targetType: any, parameter: any, culture: any): any;
    convertBack(value: any, targetType: any, parameter: any, culture: any): any;
}

// 实现 BoolToVisibilityConverter 类
export class BoolToVisibilityConverter implements IValueConverter {
    convert(value: boolean, targetType: any, parameter: any, culture: any): Visibility {
        if (value) {
            return Visibility.Visible;
        } else {
            return Visibility.Collapsed;
        }
    }

    convertBack(value: Visibility, targetType: any, parameter: any, culture: any): boolean {
        throw new Error('Not implemented');
    }
}