/** * Custom post-type field schemas + value shapes. * * Custom post types let merchants define their own content schemas — * e.g. "Recipe" with `cookTime` (number), `ingredients` (multiselect), * `photos` (gallery). Field values are stored on `BlogPost.meta` keyed * by `PostTypeField.key`. * * These types mirror the v6 API shape returned by * `/v6/merchant/cms/post-types/:id/fields`. */ /** All field types supported by the CMS. */ export declare const POST_TYPE_FIELD_TYPES: readonly ["text", "textarea", "richtext", "number", "boolean", "date", "datetime", "select", "multiselect", "url", "email", "image", "file", "gallery", "attachments", "repeater"]; export type PostTypeFieldType = (typeof POST_TYPE_FIELD_TYPES)[number]; /** Single image in a `gallery` field's value array. */ export interface GalleryItem { url: string; alt?: string; caption?: string; /** Captured at upload time; not edited by users. */ size?: number; mimeType?: string; } /** Single file in an `attachments` field's value array. */ export interface AttachmentItem { url: string; name: string; size?: number; mimeType?: string; } /** Choice for `select` / `multiselect` field types. */ export interface PostTypeFieldChoice { label: string; value: string; } /** Child field definition inside a `repeater` field. */ export interface PostTypeRepeaterSubField { key: string; label: string; fieldType: Exclude; required: boolean; options: PostTypeFieldOptions | null; helpText: string | null; sortOrder: number; } /** Parsed `options` for a field. Shape depends on the field type. */ export interface PostTypeFieldOptions { choices?: PostTypeFieldChoice[]; fields?: PostTypeRepeaterSubField[]; /** URL fields can opt into merchant upload UX while still storing a URL string. */ uploadable?: boolean; /** Optional file input accept string, e.g. "application/pdf,image/*". */ accept?: string; /** Optional per-field upload limit in bytes. Backend remains the source of truth. */ maxBytes?: number; [key: string]: unknown; } /** Single field definition on a post type. */ export interface PostTypeField { id: string; postTypeId: string; key: string; label: string; fieldType: PostTypeFieldType; required: boolean; options: PostTypeFieldOptions | null; /** Present for `repeater` fields. Mirrors `options.fields` after API normalization. */ fields?: PostTypeRepeaterSubField[]; helpText: string | null; sortOrder: number; createdAt: string; updatedAt: string; } /** Post type definition (built-in: `blog_post`, `page`; or custom). */ export interface PostType { id: string; slug: string; label: string; labelPlural: string; icon: string | null; isBuiltIn: boolean; supportsCategories: boolean; supportsFeaturedImage: boolean; supportsNesting: boolean; supportsExcerpt: boolean; supportsBlocks: boolean; sortOrder: number; createdAt: string; updatedAt: string; } /** * Type guard for `gallery` field values. Returns true if the value looks * like an array of GalleryItem records (each with a `url` string). */ export declare function isGalleryFieldValue(value: unknown): value is GalleryItem[]; /** * Type guard for `attachments` field values. Returns true if the value * looks like an array of AttachmentItem records (each with `url` + `name`). */ export declare function isAttachmentFieldValue(value: unknown): value is AttachmentItem[]; /** * Type guard for `repeater` field values. Returns true if the value is an * array of row objects. */ export declare function isRepeaterFieldValue(value: unknown): value is Array>; //# sourceMappingURL=post-types.d.ts.map