import { ApiBase } from '../Implementation/ApiBase';
export class UserInterfaceInternalApi extends ApiBase {
    prepareAdaptableIconDef(icon) {
        if (icon && 'name' in icon) {
            let customIcon = icon && 'name' in icon ? this.getCustomIconDefinition(icon.name) : null;
            if (customIcon) {
                icon = customIcon;
            }
        }
        return icon;
    }
    getCustomIconDefinition(iconName) {
        let customIcon = undefined;
        const customIcons = this.getUserInterfaceApi().getCustomIcons();
        customIcon = customIcons.find((icon) => icon.name === iconName);
        if (customIcon) {
            return customIcon.icon;
        }
        return customIcon;
    }
    shouldShowSelectCellEditor(column) {
        const showSelectCellEditor = this.getEditOptions().showSelectCellEditor;
        if (showSelectCellEditor) {
            const columnColumnContext = {
                column,
                ...this.getAdaptableInternalApi().buildBaseContext(),
            };
            return showSelectCellEditor(columnColumnContext);
        }
        return false;
    }
}
