import type { IDynamicDataAnnotatedPropertyValue } from './IDynamicDataAnnotatedPropertyValue'; import type { IDynamicDataPropertyDefinition } from './IDynamicDataPropertyDefinition'; import type { IDynamicDataEventDefinition } from './IDynamicDataEventDefinition'; import type { IDynamicDataSourceMetadata } from './IDynamicDataSourceMetadata'; /** * Dynamic Data Sources provide Dynamic Data to consumers. * They offer metadata to identify the data sources and API to get the data. * * @privateRemarks * We are not extending the IDynamicDataCallables interface here because * it would give us a flexibility of changing those api's signature to suit * the consumer needs. * * @public */ export interface IDynamicDataSource { /** * Id of the Dynamic Data Source. */ id: string; /** * Metadata of the Dynamic Data Source. */ metadata: IDynamicDataSourceMetadata; /** * Returns all the property definitions for dynamic data. * This needs to be overridden by the implementation of the component. */ getPropertyDefinitionsAsync(): Promise>; /** * Given a property id, returns the value of the property. * This needs to be overridden by the implementation of the component. * * @param propertyId - Property id for which the value is requested. */ getPropertyValueAsync(propertyId: string): Promise; /** * Given a property id, returns its annotated value. * If the source doesn't supply the annotated value, then it falls back to whatever * 'getPropertyValue' as the sample value and metadata would be undefined. * * @param propertyId - Property id for which the value is requested. */ getAnnotatedPropertyValueAsync(propertyId: string): Promise; /** * Returns list of allowed events on the dynamic data source. * When this api returns a non-empty result, then source must define 'sendData' api. * * If this api is not defined or returns an empty map, then no consumer will be able * to talk to this source. * * @beta */ allowedEventsAsync?(): Promise>; /** * If defined, enables the consumer to send data to the associated * dynamic data source. Then source can act accordingly. * * Invoking this api throws an error when the passed in 'eventName' is not * one of the allowed events on the source. * * @param eventName - A case-sensitive string representing the name of the event. * @param data - Data to be sent to the dynamic data source. * * @beta */ sendEvent?(eventName: string, data: any): void; /** * Returns all the property definitions for dynamic data. * This needs to be overridden by the implementation of the component. * @deprecated - This API is deprecated. Please use the asynchronous version `getPropertyDefinitionsAsync` */ getPropertyDefinitions(): ReadonlyArray; /** * Given a property id, returns the value of the property. * This needs to be overridden by the implementation of the component. * * @param propertyId - Property id for which the value is requested. * @deprecated - This API is deprecated. Please use the asynchronous version `getAsyncPropertyValue` */ getPropertyValue(propertyId: string): any; /** * Given a property id, returns its annotated value. * If the source doesn't supply the annotated value, then it falls back to whatever * 'getPropertyValue' as the sample value and metadata would be undefined. * * @param propertyId - One of the property ids exposed from the dynamic data source. * @deprecated - This API is deprecated. Please use the asynchronous version `getAsyncAnnotatedPropertyValue` */ getAnnotatedPropertyValue(propertyId: string): IDynamicDataAnnotatedPropertyValue; } //# sourceMappingURL=IDynamicDataSource.d.ts.map