import { Plugin } from "@webiny/plugins"; import type { CmsModel as CmsModelBase, CmsModelField as CmsModelFieldBase, CmsModelFieldSettings as BaseCmsModelFieldSettings } from "../types/index.js"; interface CmsModelFieldSettings extends Omit { /** * Object field has child fields. */ fields?: CmsModelFieldInput[]; } interface CmsModelFieldInput extends Omit { /** * If defined, it must be camelCased string. * This is for backwards compatibility - before fields had storageId. * * This should only be populated in old model fields. * New ones must have this empty. */ storageId?: string; /** * We must have a possibility to have a nested field defined without the storageId. */ settings?: CmsModelFieldSettings; } export interface CmsApiModel extends Omit { isPrivate?: never; noValidate?: boolean; singularApiName?: string; pluralApiName?: string; fields: CmsModelFieldInput[]; } export interface CmsApiModelFull extends Omit { fields: CmsModelFieldBase[]; } interface CmsPrivateModel extends Omit { noValidate?: boolean; titleFieldId?: string; singularApiName?: never; pluralApiName?: never; isPrivate: true; fields: CmsModelFieldInput[]; } export interface CmsPrivateModelFull extends Omit { fields: CmsModelFieldBase[]; } export type CmsModelInput = CmsApiModel | CmsPrivateModel | CmsApiModelFull | CmsPrivateModelFull; export interface CmsModelPluginModel extends Omit { tenant?: string; } interface CmsModelPluginOptions { validateLayout?: boolean; } export declare class CmsModelPlugin extends Plugin { static readonly type: string; readonly contentModel: CmsModelPluginModel; private readonly options; constructor(contentModel: CmsModelInput, options?: CmsModelPluginOptions); private buildModel; private buildFields; private validateLayout; } /** * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package! * @internal */ export declare const createModelPlugin: (model: CmsModelInput, options?: CmsModelPluginOptions) => CmsModelPlugin; /** * IMPORTANT! This function should NOT be used outside the `api-headless-cms` package! * @internal */ export declare const createPrivateModelPlugin: (input: Omit) => CmsModelPlugin; export {};