<commit_before>import * as React from 'react';
import { List } from 'rc-field-form';
import warning from '../_util/warning';

interface FieldData {
  name: number;
  key: number;
  fieldKey: number;
}

interface Operation {
  add: () => void;
  remove: (index: number) => void;
}

interface FormListProps {
  name: string | number | (string | number)[];
  children: (fields: FieldData[], operation: Operation) => React.ReactNode;
}

const FormList: React.FC<FormListProps> = ({ children, ...props }) => {
  warning(!!props.name, 'Form.List', 'Miss `name` prop.');

  return (
    <List {...props}>
      {(fields, operation) => {
        return children(fields.map(field => ({ ...field, fieldKey: field.key })), operation);
      }}
    </List>
  );
};

export default FormList;<commit_msg>feat: Form list add move typescript (#20406)<commit_after>import * as React from 'react';
import { List } from 'rc-field-form';
import warning from '../_util/warning';

interface FieldData {
  name: number;
  key: number;
  fieldKey: number;
}

interface Operation {
  add: () => void;
  remove: (index: number) => void;
  move: (from: number, to: number) => void;
}

interface FormListProps {
  name: string | number | (string | number)[];
  children: (fields: FieldData[], operation: Operation) => React.ReactNode;
}

const FormList: React.FC<FormListProps> = ({ children, ...props }) => {
  warning(!!props.name, 'Form.List', 'Miss `name` prop.');

  return (
    <List {...props}>
      {(fields, operation) => {
        return children(
          fields.map(field => ({ ...field, fieldKey: field.key })),
          operation,
        );
      }}
    </List>
  );
};

export default FormList;
{'fraction_non_alphanumeric': 0.17793594306049823, 'fraction_numerical': 0.0029655990510083037, 'mean_word_length': 3.3035714285714284, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5188873', 'n_tokens_mistral': 535, 'n_tokens_neox': 530, 'n_words': 146}