import { UMB_DATA_TYPE_ROOT_ENTITY_TYPE } from '../entity.js';
import { UmbDataTypeTreeServerDataSource } from './server-data-source/data-type-tree.server.data-source.js';
import { UMB_DATA_TYPE_TREE_STORE_CONTEXT } from './data-type-tree.store.context-token.js';
import { UmbTreeRepositoryBase } from '../../core/tree/index.js';
export class UmbDataTypeTreeRepository extends UmbTreeRepositoryBase {
    constructor(host) {
        super(host, UmbDataTypeTreeServerDataSource, UMB_DATA_TYPE_TREE_STORE_CONTEXT);
    }
    async requestTreeRoot() {
        const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 0 });
        const hasChildren = treeRootData ? treeRootData.total > 0 : false;
        const data = {
            unique: null,
            entityType: UMB_DATA_TYPE_ROOT_ENTITY_TYPE,
            name: '#treeHeaders_dataTypes',
            hasChildren,
            isFolder: true,
        };
        return { data };
    }
}
export { UmbDataTypeTreeRepository as api };
