import { ComponentStore } from '@metad/store'; import { Observable } from 'rxjs'; import { Agent, OcapCache } from './agent'; import { DataSource, DataSourceFactory, DataSourceOptions } from './data-source'; import { EntitySet } from './models'; import { TimeGranularity } from './models/index'; /** * State type of DataSource core service */ export interface DSState { dataSources: DataSourceOptions[]; today?: Date; timeGranularity?: TimeGranularity; } /** * DataSource core store * * - Register semantic model * - Create data source object for model * - Create entity service for cube */ export declare class DSCoreService extends ComponentStore { #private; agents: Array; factories: Array<{ type: string; factory: DataSourceFactory; }>; cacheService?: OcapCache; readonly timeGranularity$: Observable; readonly currentTime$: Observable<{ today: Date; timeGranularity: TimeGranularity; }>; private _dataSources; constructor(agents: Array, dataSources: Array, factories: Array<{ type: string; factory: DataSourceFactory; }>, cacheService?: OcapCache); registerModel: (observableOrValue: DataSourceOptions | Observable) => import("rxjs").Subscription; /** * @todo 共用 DataSource 对象 * * @param key The key of data source * @returns */ getDataSource(key: string): Observable; /** * New async method to get DataSource object * * @deprecated 慎用 _dataSources 与 #dataSources 不一致问题 * * @param key * @returns */ _getDataSource(key: string): Promise; private createDataSource; getEntityService(dataSource: string, entitySet: string): Observable>; /** * @deprecated use `selectEntitySet` */ getEntitySet(dataSource: string, entity: string): Observable; /** * Observe first correct EntitySet, filterd not Error * * @param dataSource * @param entity * @returns */ selectEntitySet(dataSource: string, entity: string): Observable; /** * Observe EntitySet or Error * * @param dataSource * @param entity * @returns */ selectEntitySetOrFail(dataSource: string, entity: string): Observable; setTimeGranularity(timeGranularity: TimeGranularity): void; setToday(today: Date): void; getToday(): { today: Date; timeGranularity: TimeGranularity; }; }