import type { IDynamicDataPropertyDefinition } from './IDynamicDataPropertyDefinition'; import type { IDynamicDataEventDefinition } from './IDynamicDataEventDefinition'; import type { IDynamicDataAnnotatedPropertyValue } from './IDynamicDataAnnotatedPropertyValue'; /** * Interface for components to implement in order to be dynamic data sources. * This can be implemented as an object with state, or a set of loose functions that * returns the data. * * @privateRemarks * Please note that, if you add any api here, if you want that to be surfaced to the * consumers then you have to add an equivalent api in the 'IDynamicDataSource'. * * @public */ export interface IDynamicDataCallables { /** * Returns all the property definitions that the DataSource will provide. */ getPropertyDefinitions(): ReadonlyArray; /** * Given a property id, returns the value of the property. * * @remarks * It is assumed that when this function returns an array, it is homogeneous. */ 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' returns as * the sample value and metadata would be undefined. * * @param propertyId - One of the property ids exposed from the dynamic data source. */ getAnnotatedPropertyValue?(propertyId: string): IDynamicDataAnnotatedPropertyValue | undefined; /** * Returns list of allowed events on the dynamic data source. * * When this function returns a non-empty result, then source must define 'sendEvent' api. * * If this api is not defined or returns an empty array, then no consumer will be able * to talk to this source. * * @beta */ allowedEvents?(): ReadonlyArray; /** * 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; } //# sourceMappingURL=IDynamicDataCallables.d.ts.map