import type { ReactNode } from 'react'; export interface PropValue { [key: string]: PropValue | PropValue[] | string[] | boolean | number | string | null | undefined; } export interface AppliedThemeColor { id: number; name: string; value: string; } export interface AppliedThemeStyle { id: number; name: string; value: Record; } export interface AppliedTheme { colors: AppliedThemeColor[]; styles: AppliedThemeStyle[]; } export interface LayoutBuilderObject { id: string; type: string; type_id?: number; version?: number; childObjects?: LayoutBuilderObject[]; /** * @description Props that will be defaulted to for every child of * this object. These props are merged deeply. */ defaultChildProps?: PropValue; props?: PropValue; metadata?: PropValue; appliedTheme?: AppliedTheme; } /** * @deprecated Use LayoutBuilderObject instead. */ export interface LayoutData { id: string; type: string; childObjects?: LayoutData[]; props?: PropValue; } export interface ContentModelInstanceMetadata { /** * Unique identifier for the content model instance * * @example yadj1kx9rmg0 */ id: string; /** * Human readable identifier for the content model instance * * @example Home Page Shop Now Button Card */ title?: string; /** * Human readable identifier for the content model type * * @example Button Card */ type?: string; } export interface ContentModelQuery { /** * Search all content for a particular term or phrase * * @example Button */ term?: string; } export interface LayoutDataSource { fetchLayoutData: (id: string) => Promise; fetchComponents: (id: string) => Promise; fetchAvailableModels?: (query?: ContentModelQuery) => Promise; fetchContentModelData?: (id: string) => Promise>; }