valueUtil.d.ts 931 B

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