import { LimeProperty } from './property'; import { LimeType } from './limetype'; /** * Creates a function to check if a given object has a specific label. * * The returned function takes an object (a `LimeType` or `LimeProperty`) and * checks whether it contains the specified label. This function is typically * used as a callback for array methods like `.find` or `.filter`. * * @param label - The label to check for. * @returns A function that takes an optional object and returns `true` if the label matches, or `false` otherwise. * * @example Finding the property that holds the primary email address * ```ts * import { PlatformServiceName, hasLabel } from '@limetech/lime-web-components'; * * const repository = platform.get(PlatformServiceName.LimeTypeRepository); * const personType = repository.getLimeType('person'); * * const properties = Object.values(personType?.properties ?? {}); * const emailProperty = properties.find(hasLabel('primaryemailaddress')); * ``` * * @public * @group Lime types */ export declare const hasLabel: (label: string) => (object?: LimeType | LimeProperty) => boolean;