@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
12 lines (11 loc) • 818 B
TypeScript
import React from "react";
import { ValidIconName } from "../Icon/canonicalIconNames";
import { TestIconProps } from "./../Icon/TestIcon";
import { SuggestFieldItemRendererModifierProps } from "./interfaces";
/**
* Returns a function to be used in an AutoComplete widget for rendering custom elements based on the query string.
*
* @param itemTextRenderer The text or element that should be displayed for the new custom item suggestion.
* @param iconName Optional icon to show left to the text.
*/
export declare const createNewItemRendererFactory: (itemTextRenderer: (query: string) => string | JSX.Element, iconName?: ValidIconName | React.ReactElement<TestIconProps>) => (query: string, modifiers: SuggestFieldItemRendererModifierProps, handleClick: React.MouseEventHandler<HTMLElement>) => React.JSX.Element;