tinacms
Version:
> The Fastest Way to Edit Next.js Content
43 lines (41 loc) • 1.13 kB
TypeScript
/**
*/
import { AddContentPlugin, TinaCMS } from '@tinacms/toolkit';
declare type CollectionShape = {
label: string;
format: string;
slug: string;
};
interface CreateContentButtonOptions {
label: string;
fields: any[];
collections: CollectionShape[];
onNewDocument?: OnNewDocument;
onChange: (values: any) => void;
initialValues: any;
}
declare type FormShape = {
collection: string;
template: string;
relativePath: string;
};
export declare 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 {};