UNPKG

tinacms

Version:

[![GitHub license](https://img.shields.io/github/license/tinacms/tinacms?color=blue)](https://github.com/tinacms/tinacms/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/tinacms.svg?style=flat)](https://www.npmjs.com/package/tinacms) [![Bui

43 lines (41 loc) 1.1 kB
/** */ import { AddContentPlugin, TinaCMS } from '@tinacms/toolkit'; type CollectionShape = { label: string; format: string; slug: string; }; interface CreateContentButtonOptions { label: string; fields: any[]; collections: CollectionShape[]; onNewDocument?: OnNewDocument; onChange: (values: any) => void; initialValues: any; } type FormShape = { collection: string; template: string; relativePath: string; }; export type OnNewDocument = (args: { collection: { slug: string; }; relativePath: string; breadcrumbs: string[]; path: string; }) => void; export declare class ContentCreatorPlugin implements AddContentPlugin<FormShape> { __type: "content-creator"; fields: AddContentPlugin<FormShape>['fields']; onNewDocument?: OnNewDocument; onChange: (values: any) => void; name: string; collections: CollectionShape[]; initialValues: any; constructor(options: CreateContentButtonOptions); onSubmit({ collection, template, relativePath }: FormShape, cms: TinaCMS): Promise<void>; } export {};