import type { IActivityHandler } from "../../IActivityHandler"; import type { Item } from "../../forms/FormDefinition"; export interface GetFormElementItemsFromCollectionInputs { collection: any[]; labelFieldName?: string; valueFieldName?: string; } export interface GetFormElementItemsFromCollectionOutputs { /** @description The result items collection. */ items: Record; } export declare class GetFormElementItemsFromCollection implements IActivityHandler { static readonly action = "gcx:wf:forms::GetFormElementItemsFromCollection"; static readonly suite = "gcx:wf:builtin"; execute(inputs: GetFormElementItemsFromCollectionInputs): GetFormElementItemsFromCollectionOutputs; /** * Returns the property name to use based on the supplied value. * If no match is found, `undefined` is returned. * @param propertyName The user-input name of the property. * @param propertyNames The names of all valid properties. * @returns The name of the matching field, or `undefined` if no match was found. */ private _getPropertyName; /** * Attempt to get the value of the specified property. * If no match is found, `undefined` is returned. * Values of `null` and `undefined` are converted to empty strings to prevent confusion with a "no match found" result. * @param propertyName The user-input name of the property. * @param propertyNames The names of all valid properties. * @param item An item from the collection. */ private _getPropertyValue; private _getTokenValues; /** * Checks if there is a field name that matches the supplied label. * @param label The label input to be checked. * @param propertyNames The names of all valid properties. */ private _isLabelFieldName; /** * Gets all of the property names that are valid for the specified object. * We can't simply rely on `Object.keys(obj)` as it could be inheriting properties. * Instead, we check every prototype. */ private getPropertyNames; }