UNPKG

@itwin/presentation-components

Version:

React components based on iTwin.js Presentation library

53 lines 1.73 kB
/** @packageDocumentation * @module DisplayLabels */ import { IModelConnection } from "@itwin/core-frontend"; import { InstanceKey } from "@itwin/presentation-common"; /** * Interface for presentation rules-driven labels provider. * @public */ export interface IPresentationLabelsProvider { /** [IModelConnection]($core-frontend) used by this data provider */ readonly imodel: IModelConnection; /** * Get label for instance identified with the given key. */ getLabel(key: InstanceKey): Promise<string>; /** * Get labels for instances identified with the given keys. */ getLabels(keys: InstanceKey[]): Promise<string[]>; } /** * Properties for creating a `LabelsProvider` instance. * @public */ export interface PresentationLabelsProviderProps { /** IModel to pull data from. */ imodel: IModelConnection; } /** * Presentation Rules-driven labels provider implementation. * @public */ export declare class PresentationLabelsProvider implements IPresentationLabelsProvider { readonly imodel: IModelConnection; /** Constructor. */ constructor(props: PresentationLabelsProviderProps); private getLabelInternal; private getMemoizedLabel; /** * Returns label for the specified instance key. Memoizes *the last* response. * @param key Key of instance to get label for */ getLabel(key: InstanceKey): Promise<string>; private getLabelsInternal; private getMemoizedLabels; /** * Returns labels for the specified instance keys. Memoizes *the last* response. * @param keys Keys of instances to get labels for */ getLabels(keys: InstanceKey[]): Promise<string[]>; } //# sourceMappingURL=LabelsProvider.d.ts.map