import { PropertyDataSourceId, PropertyDefinition } from "@omnia/fx-models"; import { PropertyDataSourceBase, DataSourcePropertyDefinitionHandler } from "@omnia/fx/services"; import { DataSourceProperty } from "internal/fx/models/properties/datasource/DataSourceProperty"; import { PropertyDefinitionId } from "./Properties"; export interface IPropertyDataSourceRegistrationApi extends IRegisteredPropertyDataSourceApi { /** * Register a property data source * */ registerDataSource2(registration: new () => PropertyDataSourceBase): void; /** * Register a property handler for the specific datasource, such a handler looks at the TDataSourceProperty and checks if this should be converted to the property defintion this handler is created/registered to handle * */ registerDataSourcePropertyDefintionHandler2>(dataSource: new () => PropertyDataSourceBase, propertyDefinitionHandlerCtor: new () => DataSourcePropertyDefinitionHandler): any; } /** * We work on registered datasources without any care about implementing type, i.e. none generic for getting * */ export interface IRegisteredPropertyDataSourceApi { getDataSources(): Promise<(new () => PropertyDataSourceBase)[]>; getDataSource(dataSourceId: PropertyDataSourceId): Promise PropertyDataSourceBase>; getDataSourceDefinitionHandlers(dataSourceId: PropertyDataSourceId): Promise DataSourcePropertyDefinitionHandler, DataSourceProperty, any, any>; }>>; } export interface IPropertyDataSourceProvider { } export declare class PropertyDataSourceProviderRegistration { typeId: PropertyDataSourceId; provider: new () => IPropertyDataSourceProvider; constructor(typeId: PropertyDataSourceId, provider: new () => IPropertyDataSourceProvider); } export interface IPropertyDataSourceProviderApi { register(registration: PropertyDataSourceProviderRegistration): void; getProvider(typeId: PropertyDataSourceId): Promise IPropertyDataSourceProvider>; }