Skip to main content
Version: 1.x

@microsoft/fast-foundation > ElementDisambiguationCallback

ElementDisambiguationCallback type

The callback type that is invoked when two elements are trying to define themselves with the same name.

Signature:
export declare type ElementDisambiguationCallback = (nameAttempt: string, typeAttempt: Constructable, existingType: Constructable) => ElementDisambiguationResult;

Remarks

The callback should return either: 1. A string to provide a new name used to disambiguate the element 2. ElementDisambiguation.ignoreDuplicate to ignore the duplicate element entirely 3. ElementDisambiguation.definitionCallbackOnly to skip defining the element but still call the provided callback passed to DesignSystemRegistrationContext.tryDefineElement