tinacms
Version:
[](https://github.com/tinacms/tinacms/blob/main/LICENSE) [](https://www.npmjs.com/package/tinacms) [![Bui
45 lines (44 loc) • 1.37 kB
TypeScript
import * as React from 'react';
import { Field, Form } from '../../forms';
type DefaultItem = string | number | (() => string | number);
interface ListFieldDefinititon extends Field {
component: 'list';
defaultItem?: DefaultItem;
field: {
component: 'text' | 'textarea' | 'number' | 'select' | 'image';
};
type?: string;
list?: boolean;
parentTypename?: string;
/**
* An optional function which generates `props` for
* this items's `li`.
*/
itemProps?: (_item: object) => {
/**
* The `key` property used to optimize the rendering of lists.
*
* If rendering is causing problems, use `defaultItem` to
* generate a unique key for the item.
*
* Reference:
* * https://reactjs.org/docs/lists-and-keys.html
*/
key?: string;
};
}
interface ListProps {
input: any;
meta: any;
field: ListFieldDefinititon;
form: any;
tinaForm: Form;
index?: number;
}
export declare const ListField: ({ tinaForm, form, field, input, meta, index }: ListProps) => React.JSX.Element;
export declare const ListFieldPlugin: {
name: string;
Component: ({ tinaForm, form, field, input, meta, index }: ListProps) => React.JSX.Element;
validate(value: any, values: any, meta: any, field: any): string;
};
export {};