/**
 * Template binding resolution utilities.
 *
 * Resolves binding definitions to actual content values from entry fields and metadata.
 * Used by SDK, site-renderer, and dashboard for template block rendering.
 */
export type { BindingSource, BindingDescriptor, BindingInput, BindingMap, BindingContext, BindingPath, BindingTransformName, KnownBindingTransformName, FieldBindingDescriptor, MetaBindingDescriptor, LiteralBindingDescriptor, TransformBindingDescriptor, FallbackBindingDescriptor, } from './types';
export { TRANSFORMS, BINDING_SOURCES } from './types';
export { asDesignBlockId, asContentTemplateDesignBlockId, asLayoutVariantKey, buildPageDesignEditorReadModel, compileContentTemplateRuntimeFields, parsePageDesignIntent, surfaceResolutionContextFromTheme, type DesignBlockId, parseContentTemplateDesignIntent, type CompiledBlockRuntimeFields, type LayoutVariantKey, type PageDesignEditorBlockInput, type PageDesignIntent, type SurfaceResolutionContext, applyBlockContentVariantPolicy, deriveSiteStyleBlockPolicy, } from '../../../theme-core/src/site-styles/index';
export { applyCompiledRuntimeFieldsToContent, buildEditorModelRuntimeFieldsByBlockId, } from '../../../theme-core/src/site-styles/previewCompiler';
export { blockDesignMetadataMapFromDefinitions } from '../system/designCapabilities';
export { systemBlockDefinitions } from '../system/blocks';
import type { BindingContext, BindingDescriptor, BindingInput, BindingMap, BindingPath, FieldBindingDescriptor, FallbackBindingDescriptor, KnownBindingTransformName, LiteralBindingDescriptor, MetaBindingDescriptor, TransformBindingDescriptor } from './types';
import { isRecord } from '../lib/typeGuards';
export { isRecord };
export declare function fieldBinding<TFields extends Record<string, unknown>, TPath extends BindingPath<TFields>>(path: TPath): FieldBindingDescriptor<TPath>;
export declare function metaBinding<TMeta extends Record<string, unknown>, TPath extends BindingPath<TMeta>>(path: TPath): MetaBindingDescriptor<TPath>;
export declare function literalBinding<TValue>(value: TValue): LiteralBindingDescriptor<TValue>;
export declare function transformBinding<TTransform extends KnownBindingTransformName>(transform: TTransform, options?: {
    input?: BindingInput;
    path?: string;
}): TransformBindingDescriptor<TTransform>;
export declare function fallbackBinding<const TOptions extends readonly [BindingInput, ...BindingInput[]]>(...options: TOptions): FallbackBindingDescriptor;
/**
 * Resolves a binding map to actual content values.
 *
 * Returns only keys whose binding resolved to a non-null, non-undefined value.
 * To merge resolved bindings over a base content object (the dashboard
 * template preview's use case), see {@link applyBindingsToContent}.
 *
 * @param bindings - Map of field keys to binding descriptors
 * @param context - Entry data context (fields and meta)
 * @returns Resolved content object with actual values
 *
 * @example
 * ```typescript
 * const content = applyBindings(
 *   {
 *     headline: { source: 'meta', path: 'title' },
 *     body: { source: 'field', path: 'content' },
 *   },
 *   {
 *     fields: { content: 'Hello world' },
 *     meta: { title: 'My Post', slug: 'my-post' },
 *   }
 * );
 * // Result: { headline: 'My Post', body: 'Hello world' }
 * ```
 */
export declare function applyBindings(bindings: BindingMap, context: BindingContext): Record<string, unknown>;
/**
 * Resolve a binding map and merge the result over a base content object.
 *
 * Use this when a block has *some* hard-coded content (from a template's
 * `block.content`) and *some* values driven by template bindings against
 * an entry. The base provides defaults; resolved bindings override them.
 *
 * Same null-handling as {@link applyBindings}: keys whose binding resolves
 * to `null`/`undefined` do NOT overwrite the base. This means "no resolved
 * value" leaves the base value (or absence) intact, which is the correct
 * semantic for both the SDK/frontend render paths and the dashboard preview.
 *
 * Replaces the dashboard's bespoke `applyBindings` that lived in
 * `apps/dashboard/src/lib/templates/applyBindings.ts` — its divergent
 * "always-set-null" behaviour produced the `subheadline: null` regression
 * documented in Phase 1.
 *
 * @example
 * ```typescript
 * const content = applyBindingsToContent(
 *   { eyebrow: 'Default eyebrow', headline: 'Default headline' },
 *   { headline: { source: 'meta', path: 'title' } },
 *   { fields: {}, meta: { title: 'Entry title' } },
 * );
 * // Result: { eyebrow: 'Default eyebrow', headline: 'Entry title' }
 * ```
 */
export declare function applyBindingsToContent(baseContent: Record<string, unknown>, bindings: BindingMap, context: BindingContext): Record<string, unknown>;
/**
 * Resolves a single binding descriptor to its value.
 */
export declare function resolveBindingValue(descriptor: BindingDescriptor, context: BindingContext): unknown;
/**
 * Gets a nested path from an object.
 */
export declare function getPath(source: Record<string, unknown>, path: string): unknown;
/**
 * Applies a transform function to a value.
 */
export declare function applyTransform(name: string | undefined, value: unknown): unknown;
/**
 * Extracts the first paragraph text from a TipTap/ProseMirror document.
 *
 * Accepts either the canonical unwrapped form (`{ type: 'doc', content: [...] }`)
 * or the legacy envelope (`{ doc: { type: 'doc', content: [...] } }`). New
 * producers must emit the unwrapped form; this tolerance only exists to read
 * data that pre-dates the unwrap migration.
 */
export declare function extractFirstParagraph(value: unknown): string | null;
/**
 * Formats a date string using Intl.DateTimeFormat.
 */
export declare function formatDate(value: unknown, options: Intl.DateTimeFormatOptions): string | null;
/**
 * Type guard to check if a value is a valid binding descriptor.
 */
export declare function isBindingDescriptor(value: unknown): value is BindingDescriptor;
/**
 * Type guard to check if a value is binding-descriptor-like (can be normalized).
 */
export declare function isBindingDescriptorLike(value: unknown): value is BindingInput;
/**
 * Normalizes a binding input to a binding descriptor.
 *
 * Converts string shorthand to field descriptors and validates
 * that objects have valid binding source values.
 */
export declare function normalizeBindingInput(value: BindingInput): BindingDescriptor | null;
/**
 * Normalizes binding output by unwrapping doc wrappers.
 * Rich text fields are sometimes wrapped as { doc: { type: 'doc', content: [...] } }
 * This unwraps them to just the doc content.
 */
export declare function normalizeBindingOutput<T>(value: T): T;
