class LevelToIndentConverter {
    private static _indentSize: number = 10.0;

    /**
     * 获取或设置缩进
     */
    public static get IndentSize(): number {
        return LevelToIndentConverter._indentSize;
    }

    public static set IndentSize(value: number) {
        LevelToIndentConverter._indentSize = value;
    }

    /**
     * 将层级转换为缩进样式对象
     * @param level 层级
     * @returns 包含缩进样式的对象
     */
    public static Convert(level: number): { marginLeft: number } {
        return { marginLeft: level * LevelToIndentConverter._indentSize };
    }

    /**
     * 反向转换方法，当前不支持
     */
    public static ConvertBack(): never {
        throw new Error('反向转换不支持');
    }
}

export default LevelToIndentConverter;