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 ContentTraverseNodeType: { readonly component: "component"; readonly entity: "entity"; readonly error: "error"; readonly field: "field"; readonly fieldItem: "fieldItem"; readonly richTextNode: "richTextNode"; }; export type ContentTraverseNodeType = (typeof ContentTraverseNodeType)[keyof typeof ContentTraverseNodeType]; export declare const ContentTraverseNodeErrorType: { readonly generic: "generic"; readonly missingTypeSpec: "missingTypeSpec"; }; export type ContentTraverseNodeErrorType = (typeof ContentTraverseNodeErrorType)[keyof typeof ContentTraverseNodeErrorType]; export type ContentTraverseNode = ContentTraverseNodeComponent | ContentTraverseNodeEntity | ContentTraverseNodeErrorGeneric | ContentTraverseNodeErrorMissingTypeSpec | ContentTraverseNodeField | ContentTraverseNodeFieldItem | ContentTraverseNodeRichTextNode; interface ContentTraverseNodeEntity { path: ContentValuePath; type: 'entity'; entitySpec: TSchema['spec']['entityTypes'][number]; entity: EntityLike; } interface ContentTraverseNodeErrorGeneric { path: ContentValuePath; type: 'error'; errorType: 'generic'; message: string; } interface ContentTraverseNodeErrorMissingTypeSpec { path: ContentValuePath; type: 'error'; errorType: 'missingTypeSpec'; message: string; typeName: string; kind: 'entity' | 'component'; } interface ContentTraverseNodeField { path: ContentValuePath; type: 'field'; fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number]; value: unknown; } interface ContentTraverseNodeFieldItem { path: ContentValuePath; type: 'fieldItem'; fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number]; value: unknown; } interface ContentTraverseNodeComponent { path: ContentValuePath; type: 'component'; componentSpec: TSchema['spec']['componentTypes'][number]; component: Component; } interface ContentTraverseNodeRichTextNode { path: ContentValuePath; type: 'richTextNode'; fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number]; node: RichTextNode; } export declare function traverseEntity(schema: TSchema, path: ContentValuePath, entity: EntityLike): Generator>; export declare function traverseComponent(schema: TSchema, path: ContentValuePath, component: Component): Generator>; export declare function traverseContentField(schema: TSchema, path: ContentValuePath, fieldSpec: TSchema['spec']['entityTypes' | 'componentTypes'][number]['fields'][number], value: unknown): Generator>; export {};