UNPKG

tinacms

Version:

> The Fastest Way to Edit Next.js Content

45 lines (44 loc) 1.36 kB
/// <reference types="react" /> import { Field, Form } from '../../forms'; declare 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) => JSX.Element; export declare const ListFieldPlugin: { name: string; Component: ({ tinaForm, form, field, input, meta, index }: ListProps) => JSX.Element; validate(value: any, values: any, meta: any, field: any): string; }; export {};