add item data source

This commit is contained in:
Mads Rasmussen
2023-04-17 16:18:28 +02:00
parent f2c9c23b00
commit 586a73bfd2
3 changed files with 8 additions and 0 deletions

View File

@@ -2,3 +2,4 @@ export * from './data-source-response.interface';
export * from './data-source.interface';
export * from './folder-data-source.interface';
export * from './tree-data-source.interface';
export * from './item-data-source.interface';

View File

@@ -0,0 +1,5 @@
import type { DataSourceResponse } from '@umbraco-cms/backoffice/repository';
export interface UmbItemDataSource<ItemType> {
getItems(unique: Array<string>): Promise<DataSourceResponse<Array<ItemType>>>;
}

View File

@@ -3,5 +3,7 @@ import type { DataSourceResponse } from '@umbraco-cms/backoffice/repository';
export interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
getRootItems(): Promise<DataSourceResponse<PagedItemsType>>;
getChildrenOf(parentUnique: string): Promise<DataSourceResponse<PagedItemsType>>;
// TODO: remove this when all repositories are migrated to the new items interface
getItems(unique: Array<string>): Promise<DataSourceResponse<Array<ItemsType>>>;
}