import type { JSONSchemaType } from "ajv"; export type PieceFrontMatterValue = string | number | boolean | PieceFrontMatterValue[] | { [key: string]: PieceFrontMatterValue; }; type PieceFrontmatter = { [key: string]: PieceFrontMatterValue; }; type PieceFrontmatterSchema = JSONSchemaType; export type PieceFrontmatterPropertyScalar = { type: 'string' | 'boolean' | 'integer'; format?: 'asset' | 'date' | 'comma-separated' | 'paragraph' | 'markdown'; nullable?: boolean; pattern?: string; enum?: string[] | number[]; examples?: Array; default?: string | number | boolean; }; export type PieceFrontmatterPropertyList = { type: 'array'; format?: undefined; pattern?: undefined; examples?: undefined; default?: undefined; nullable?: boolean; enum?: string[] | number[]; items: PieceFrontmatterProperty; }; export type PieceFrontmatterPropertyObject = { type: 'object'; format?: undefined; pattern?: undefined; examples?: undefined; default?: undefined; nullable?: boolean; properties: { [key: string]: PieceFrontmatterProperty; }; required?: string[]; }; type PieceFrontmatterProperty = PieceFrontmatterPropertyScalar | PieceFrontmatterPropertyList | PieceFrontmatterPropertyObject; type PieceFrontmatterSchemaField = PieceFrontmatterProperty & { name: string; }; /** * Maps schema properties to a flat array of field definitions with names. */ declare function getPieceFrontmatterSchemaFields(schema: PieceFrontmatterSchema): Array; /** * Converts a frontmatter value to its database-compatible representation. * Arrays and objects are kept as structured data for JSON serialization. */ declare function pieceFrontmatterValueToDatabaseValue(value: unknown, property: PieceFrontmatterProperty): unknown; declare function databaseValueToPieceFrontmatterValue(value: unknown, property: PieceFrontmatterProperty): unknown; declare function initializePieceFrontMatterFromProperties(properties: { [key: string]: PieceFrontmatterProperty; }, requiredFields?: string[], minimal?: boolean): Record; declare function initializePieceFrontMatter(schema: PieceFrontmatterSchema, minimal?: boolean): M; export { type PieceFrontmatter, type PieceFrontmatterProperty, type PieceFrontmatterSchemaField, type PieceFrontmatterSchema, getPieceFrontmatterSchemaFields, pieceFrontmatterValueToDatabaseValue, databaseValueToPieceFrontmatterValue, initializePieceFrontMatter, initializePieceFrontMatterFromProperties, };