import { DataSourceProperty, DataSourcePropertyDisplayInformation, GuidValue, PropertyDataSourceId, PropertyDefinition, PropertyValue, PropertyValuePrimitiveConverter, UserIdentity } from "../../../models"; import { OmniaContext } from "../../../contexts"; import { DataSourcePropertyDefinitionHandler } from "./DataSourcePropertyDefinitionHandler"; import { IDataSourcePropertyCreator } from "./DataSourcePropertyProvider"; export declare enum WriteBackStatus { WrittenOk = 0, ConversionError = 1, SaveError = 2, WritebackUnSupported = 3 } export type WritebackRequest = { dataSourceProperty: DataSourceProperty; propertyValue: PropertyValue; definitionHandler: DataSourcePropertyDefinitionHandler, DataSourceProperty, any, any>; }; export type WritebackResult = { dataSourceProperty: DataSourceProperty; writeStatus: WriteBackStatus; }; export interface IWritebackTrigger { /** * Will trigger any pending writebacks * */ executeWritebacks(): Promise; } export interface IChangeUserContextTrigger { } export declare class DataSourcePropertiesService { private propertyDataSourceInstances; private specificUser; private serviceContainerContext; omniaContext: OmniaContext; private externalWritebackTrigger; private externalChangeUserContextTrigger; private isChangeUserContextTrigger; getDataSources(): Promise>; isEqual(dataSourceProperty1: DataSourceProperty, dataSourceProperty2: DataSourceProperty): boolean; isEqualAsync(dataSourceProperty1: DataSourceProperty, dataSourceProperty2: DataSourceProperty): Promise; getSpecificUser(): UserIdentity; setSpecificUser(specificUser: UserIdentity): void; changeUserContext(user: UserIdentity): void; isChangeUserContext(): boolean; resetUserContext(): void; hasExternalWritebackTrigger(): boolean; addOnBeforeExternalWritebackHandler(writebackPreparationFunc: () => Promise): void; registerExternalWritebackTrigger(onWriteBackPendingListener: () => void, getExist?: boolean): IWritebackTrigger; registerExternalChangeUserContextTrigger(onChangeUserContextListener: () => void): IChangeUserContextTrigger; getProperties(datasourceId: PropertyDataSourceId): Promise>; updatePropertyValue(writeRequest: WritebackRequest): Promise; /** * Getting more than one possible creator for a given data source property means a selection must be made as several converters/creators could be used to create the desired propertydefinition, e.g. using ui component * Each DataSourcePropertyDefinitionHandler has it own unique id, which can be used to persist the choice of the selection, note a persisted selection could point to a handler no longer provided by the system * Getting no converters/creators mean this property can not be handled by the system * */ getPropertyValueCreators(dataSourceProperty: DataSourceProperty): Promise, DataSourceProperty, any, any>>>; getPropertiesDisplayInformation(dataSourceProperties: Array): Promise>; getPropertySourceValues(dataSourceProperties: Array): Promise>; getPropertyValuePrimitiveConverter(propertyValueCreator: DataSourcePropertyDefinitionHandler, DataSourceProperty, any, any>): Promise; supportsWriteback(dataSourceProperties: Array): Promise>; /** * Write back dataSourceProperties based on the values in PropertyValue, the value written to the datasource is the result of the definitionHandler.propertyWriteBackDataCreator. * */ writeback(writeRequests: Array): Promise>; /** * Get an interface for a datasource to create properties from string, if not supported null/undefined * @param dataSourceId * @returns creator or undefined/null for not supported */ getDataSourcePropertyCreator(dataSourceId: GuidValue): Promise; /** * Todo add something like this that a datasource can return if it supports creating datasourceproperties, i.e. graph But does this need more than from string, i.e. like separat creator manifest from datasource? * string is quite basic/ugly but migt not need anthing more now atleast * return null, not supported else the creator of propertymetadata * */ private writeBackToDataSource; private getDataSourceDefinitionHandlers; private getPropertyDataSourceInstance; private groupBy; private makeWriteable; }