UNPKG

@mendix/pluggable-widgets-tools

Version:
16 lines (15 loc) 858 B
import { Properties, Property, SystemProperty } from "./WidgetXml"; export declare function extractProperties(props: Properties): Property[]; export declare function extractSystemProperties(props: Properties): SystemProperty[]; export declare function capitalizeFirstLetter(text: string): string; export declare function commasAnd(arr: string[]): string; /** * Factory method for creating an `Array.reduce()` callback for partitioning the array into groups. * @example * ```js * [1, 4, 3, 13].reduce(groupBy(x => x % 2 ? "odd" : "even")).even // [ 4 ] * ``` * @param groupSelector Callback that maps array members to their group * @returns Callback for Array.reduce() */ export declare function groupBy<T, Groups extends string>(groupSelector: (item: T) => Groups): (reduction: { [Group in Groups]?: T[]; }, item: T) => { [Group in Groups]?: T[]; };