tinacms
Version:
[](https://github.com/tinacms/tinacms/blob/main/LICENSE) [](https://www.npmjs.com/package/tinacms) [![Bui
43 lines (41 loc) • 1.1 kB
TypeScript
/**
*/
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 {};