import { type ErrorType, type Result } from '../ErrorResult.js'; import type { PublishedSchema } from '../schema/PublishedSchema.js'; import type { Schema } from '../schema/Schema.js'; import type { Component, EntityLike, RichTextNode } from '../Types.js'; import { type ContentValuePath } from './ContentPath.js'; export declare const IDENTITY_TRANSFORMER: ContentTransformer; export interface ContentTransformer { transformField: (schema: TSchema, path: ContentValuePath, fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number], value: unknown) => Result; transformFieldItem: (schema: TSchema, path: ContentValuePath, fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number], value: unknown) => Result; transformRichTextNode: (schema: TSchema, path: ContentValuePath, fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number], node: Readonly) => Result, TError>; } export interface ContentTransformerEntityFieldsOptions extends ContentTransformerOptions { excludeOmittedEntityFields?: boolean; } export interface ContentTransformerOptions { keepExtraFields?: boolean; } export declare function transformEntityFields, TError extends ErrorType>(schema: TSchema, path: ContentValuePath, entity: Readonly, transformer: ContentTransformer, options?: ContentTransformerEntityFieldsOptions): Result; export declare function transformComponent, TError extends ErrorType>(schema: TSchema, path: ContentValuePath, component: Readonly, transformer: ContentTransformer, options?: ContentTransformerOptions): Result; export declare function transformContentField(schema: TSchema, path: ContentValuePath, fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number], originalValue: unknown, transformer: ContentTransformer, options?: ContentTransformerOptions): Result;