@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
52 lines (51 loc) • 2.24 kB
text/typescript
import CustomField from "../../custom-fields/custom-field.mjs";
import { FieldBuilderMeta } from "./types.mjs";
import { CFConfig, CFProps, FieldTypes } from "../../custom-fields/types.mjs";
//#region src/libs/collection/builders/field-builder/index.d.ts
type ContainerStackEntry = {
kind: "repeater" | "section" | "collapsible";
key: string;
};
declare class FieldBuilder {
fields: Map<string, CustomField<FieldTypes>>;
repeaterStack: string[];
containerStack: ContainerStackEntry[];
meta: FieldBuilderMeta;
activeTabKey: string | null;
private cachedFieldTree;
private cachedPersistedFieldTree;
private cachedClientFieldTree;
protected invalidateFieldTreeCache(): void;
private registerField;
addRepeater(key: string, props?: CFProps<"repeater">): this;
addSection(key: string, props?: CFProps<"section">): this;
addCollapsible(key: string, props?: CFProps<"collapsible">): this;
addTab(key: string, props?: CFProps<"tab">): this;
addToTab(key: string): this;
addText(key: string, props?: CFProps<"text">): this;
addRichText(key: string, props?: CFProps<"rich-text">): this;
addMedia(key: string, props?: CFProps<"media">): this;
addRelation(key: string, props: CFProps<"relation">): this;
addNumber(key: string, props?: CFProps<"number">): this;
addRange(key: string, props?: CFProps<"range">): this;
addCheckbox(key: string, props?: CFProps<"checkbox">): this;
addSelect(key: string, props?: CFProps<"select">): this;
addTextarea(key: string, props?: CFProps<"textarea">): this;
addJSON(key: string, props?: CFProps<"json">): this;
addCode(key: string, props?: CFProps<"code">): this;
addColor(key: string, props?: CFProps<"color">): this;
addDateTime(key: string, props?: CFProps<"datetime">): this;
addLink(key: string, props?: CFProps<"link">): this;
addUser(key: string, props?: CFProps<"user">): this;
endRepeater(): this;
endSection(): this;
endCollapsible(): this;
private nestFields;
get fieldTree(): CFConfig<FieldTypes>[];
get persistedFieldTree(): CFConfig<FieldTypes>[];
get clientFieldTree(): CFConfig<FieldTypes>[];
get flatFields(): CFConfig<FieldTypes>[];
}
//#endregion
export { FieldBuilder as default };
//# sourceMappingURL=index.d.mts.map