UNPKG

1.08 kBTypeScriptView Raw
1import type { BaseOptionType, DefaultOptionType } from '../Select';
2import type { FieldNames } from '../Select';
3import type { FlattenOptionData } from '../interface';
4export declare function isValidCount(value?: number): boolean;
5export declare function fillFieldNames(fieldNames: FieldNames | undefined, childrenAsData: boolean): {
6 label: string;
7 value: string;
8 options: string;
9 groupLabel: string;
10};
11/**
12 * Flat options into flatten list.
13 * We use `optionOnly` here is aim to avoid user use nested option group.
14 * Here is simply set `key` to the index if not provided.
15 */
16export declare function flattenOptions<OptionType extends BaseOptionType = DefaultOptionType>(options: OptionType[], { fieldNames, childrenAsData }?: {
17 fieldNames?: FieldNames;
18 childrenAsData?: boolean;
19}): FlattenOptionData<OptionType>[];
20/**
21 * Inject `props` into `option` for legacy usage
22 */
23export declare function injectPropsWithOption<T extends object>(option: T): T;
24export declare const getSeparatedContent: (text: string, tokens: string[], end?: number) => string[];