/**
 * SDK Content Scaffolding Types
 *
 * These types define the schema for SDK content configuration that allows
 * SDK sites to define content types and local content scaffolding in code.
 * `riverbankcms push-config` syncs content type schema; document content
 * such as pages, entries, and navigation is synced through explicit
 * `riverbankcms push` scopes.
 */
import type { FieldDefinition } from './field-definitions';
import type { BlockKind } from '../types';
import type { NavigationLinkInput } from '../public-api/contracts';
import type { BindingTransformName } from '../contracts/bindings';
export type { FieldDefinition } from './field-definitions';
export declare const TEMPLATE_BINDING_META_PATHS: readonly ["title", "slug", "publishedAt", "createdAt", "updatedAt"];
export type TemplateBindingMetaPath = typeof TEMPLATE_BINDING_META_PATHS[number];
export declare function describeInvalidTemplateBindingMetaPath(path: string): string;
/**
 * Binding source for template blocks.
 * Defines how block field values are populated from content entry data.
 */
export type BindingSource = {
    source: 'field';
    path: string;
} | {
    source: 'meta';
    path: TemplateBindingMetaPath;
} | {
    source: 'literal';
    value: unknown;
} | {
    source: 'transform';
    path: string;
    transform: BindingTransformName;
} | {
    source: 'fallback';
    sources: BindingSource[];
};
/**
 * Template block definition for SDK config.
 *
 * Two scopes are available:
 * - 'entry': Block content is bound to entry data via bindings
 * - 'template': Block content is static, defined in config
 *
 * @example
 * ```typescript
 * // Entry-scoped block with bindings
 * {
 *   identifier: 'hero',
 *   kind: 'block.hero',
 *   scope: 'entry',
 *   bindings: {
 *     headline: { source: 'meta', path: 'title' },
 *     backgroundImage: { source: 'field', path: 'image' },
 *   },
 * }
 *
 * // Template-scoped block with static content
 * {
 *   identifier: 'more-posts',
 *   kind: 'block.blog-listing',
 *   scope: 'template',
 *   content: {
 *     heading: 'More Posts',
 *     layout: 'grid',
 *   },
 * }
 * ```
 */
export interface TemplateBlockConfig {
    /** Unique identifier within the template. Required for SDK sync. */
    identifier: string;
    /** Block kind (e.g., 'block.hero', 'block.body-text', 'custom.myBlock') */
    kind: BlockKind;
    /** Block scope: 'entry' for data-bound blocks, 'template' for static blocks */
    scope: 'entry' | 'template';
    /** Bindings for entry-scoped blocks. Maps block field IDs to data sources. */
    bindings?: Record<string, BindingSource>;
    /** Static content for template-scoped blocks. */
    content?: Record<string, unknown>;
}
/**
 * Template configuration for a content type.
 *
 * Defines the default template blocks for entries of this content type.
 *
 * @example
 * ```typescript
 * {
 *   blocks: [
 *     { identifier: 'hero', kind: 'block.hero', scope: 'entry', bindings: {...} },
 *     { identifier: 'body', kind: 'block.body-text', scope: 'entry', bindings: {...} },
 *     { identifier: 'related', kind: 'block.blog-listing', scope: 'template', content: {...} },
 *   ],
 * }
 * ```
 */
export interface TemplateConfig {
    /** Template blocks in display order */
    blocks: TemplateBlockConfig[];
}
/**
 * Content type definition for SDK config.
 *
 * Defines the structure of a content type that SDK sites can declare.
 * When pushed, the dashboard will ensure this content type exists.
 *
 * @example
 * ```typescript
 * // Regular content type with multiple entries
 * {
 *   key: 'testimonial',
 *   name: 'Testimonial',
 *   hasPages: false,
 *   fields: [
 *     { id: 'quote', type: 'richText', label: 'Quote', required: true },
 *     { id: 'author', type: 'text', label: 'Author', required: true },
 *   ],
 * }
 *
 * // Singleton content type (only one entry allowed)
 * {
 *   key: 'site-settings',
 *   name: 'Site Settings',
 *   isSingleton: true,
 *   hasPages: false,
 *   fields: [
 *     { id: 'contactEmail', type: 'text', label: 'Contact Email' },
 *   ],
 * }
 * ```
 */
export interface ContentTypeConfig {
    /** Unique key for this content type (e.g., 'post', 'event'). Must be lowercase with hyphens. */
    key: string;
    /** Display name shown in dashboard UI */
    name: string;
    /** Optional description */
    description?: string;
    /** Whether entries of this type have routable pages */
    hasPages: boolean;
    /**
     * Route pattern for routable content types. Required if hasPages=true.
     * - For regular types: must include {slug} placeholder (e.g., '/blog/{slug}')
     * - For singletons: can be a fixed path without {slug} (e.g., '/')
     */
    routePattern?: string;
    /** Field definitions for this content type */
    fields: FieldDefinition[];
    /** Field ID to use as the entry title source */
    titleField?: string;
    /**
     * When true, only one entry can exist for this content type.
     * The entry is auto-created when the content type is created.
     * Use for homepage content, site-wide settings, etc.
     */
    isSingleton?: boolean;
    /**
     * Template configuration for content types with pages.
     * Defines the default blocks for entries, with support for data bindings.
     */
    template?: TemplateConfig;
}
/**
 * Block content for page scaffolding.
 *
 * Represents initial block content that can be added to SDK-defined pages.
 */
export interface BlockConfig {
    /** Block kind (e.g., 'block.hero', 'block.body-text', 'custom.myBlock') */
    kind: BlockKind;
    /** Block content data matching the block's field definitions */
    content: Record<string, unknown>;
    /** Order index (optional, defaults to array position) */
    orderIndex?: number;
}
/**
 * Page definition for SDK config.
 *
 * Defines a page that should exist on the site.
 * When pushed, the dashboard will ensure this page exists.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'home',
 *   title: 'Home',
 *   path: '/',
 *   status: 'published',
 *   blocks: [
 *     { kind: 'block.hero', content: { heading: 'Welcome' } },
 *   ],
 * }
 * ```
 */
export interface PageConfig {
    /** Unique identifier for this page. Required for SDK sync. */
    identifier: string;
    /** Page title */
    title: string;
    /** URL path (e.g., '/', '/about', '/contact'). Must start with /. */
    path: string;
    /** Page purpose (default: 'content') */
    purpose?: string;
    /** Initial block content (optional) */
    blocks?: BlockConfig[];
    /** Status: 'draft' or 'published' (default: 'draft') */
    status?: 'draft' | 'published';
    /** SEO meta title */
    metaTitle?: string;
    /** SEO meta description */
    metaDescription?: string;
}
/**
 * Content entry definition for SDK config.
 *
 * Defines a content entry that should exist.
 * When pushed, the dashboard will ensure this entry exists.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'testimonial-1',
 *   contentType: 'testimonial',
 *   status: 'published',
 *   data: {
 *     quote: '<p>Great product!</p>',
 *     author: 'Jane Doe',
 *   },
 * }
 * ```
 */
export interface EntryConfig {
    /** Unique identifier for this entry. Required for SDK sync. */
    identifier: string;
    /** Content type key this entry belongs to */
    contentType: string;
    /** Entry data matching the content type's field definitions */
    data: Record<string, unknown>;
    /** Status: 'draft' or 'published' (default: 'draft') */
    status?: 'draft' | 'published';
    /** Slug for routable entries. Defaults to identifier if content type hasPages. */
    slug?: string;
    /** Summary/description */
    summary?: string;
    /** SEO meta title */
    metaTitle?: string;
    /** SEO meta description */
    metaDescription?: string;
}
/**
 * Navigation link types for menu items.
 */
export type NavigationLinkType = NavigationLinkInput | {
    kind: 'dropdown';
};
/**
 * Navigation item definition.
 *
 * @example
 * ```typescript
 * {
 *   label: 'Products',
 *   link: { kind: 'dropdown' },
 *   children: [
 *     { label: 'Product 1', link: { kind: 'page', identifier: 'product-1' } },
 *   ],
 * }
 * ```
 */
export interface NavigationItemConfig {
    /** Display label */
    label: string;
    /** Link configuration */
    link: NavigationLinkType;
    /** Is this a CTA button? */
    isCta?: boolean;
    /** Child items (for dropdown menus, max 1 level) */
    children?: NavigationItemConfig[];
}
/**
 * Navigation menu definition.
 *
 * @example
 * ```typescript
 * {
 *   identifier: 'main',
 *   name: 'Main Navigation',
 *   isPrimary: true,
 *   items: [
 *     { label: 'Home', link: { kind: 'page', identifier: 'home' } },
 *     { label: 'About', link: { kind: 'page', identifier: 'about' } },
 *   ],
 * }
 * ```
 */
export interface NavigationMenuConfig {
    /** Unique identifier for this menu */
    identifier: string;
    /** Menu display name */
    name: string;
    /** Is this the primary/main menu? */
    isPrimary?: boolean;
    /** Is this the footer menu? */
    isFooter?: boolean;
    /** Menu items */
    items: NavigationItemConfig[];
}
/**
 * Site settings for SDK config.
 */
export interface SiteSettingsConfig {
    /** Homepage path (default: '/') */
    homepagePath?: string;
    /** Site title (for SEO/metadata) */
    siteTitle?: string;
    /** Site description (for SEO/metadata) */
    siteDescription?: string;
    /** Default template ID per content type key */
    defaultTemplates?: Record<string, string>;
}
/**
 * Complete content configuration for SDK sites.
 *
 * This is imported into riverbank.config.ts via the `content` field.
 *
 * @example
 * ```typescript
 * // content.config.ts
 * import { defineContentConfig } from '@riverbankcms/sdk/config';
 *
 * export const contentConfig = defineContentConfig({
 *   contentTypes: [...],
 *   pages: [...],
 *   entries: [...],
 *   navigationMenus: [...],
 *   settings: {...},
 * });
 * ```
 */
export interface ContentConfig {
    /** Content type definitions */
    contentTypes?: ContentTypeConfig[];
    /** Content entries */
    entries?: EntryConfig[];
    /** Page definitions */
    pages?: PageConfig[];
    /** Navigation menus */
    navigationMenus?: NavigationMenuConfig[];
    /** Site settings */
    settings?: SiteSettingsConfig;
}
