import React, { JSXElementConstructor } from 'react'; import type { StructuredContentFragment, ReferenceMapping } from '@financial-times/cp-content-pipeline-client'; import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'; import type { mapNodeToReference } from '@financial-times/cp-content-pipeline-schema/lib/resolvers/content-tree/references'; import type { ContentProps } from '../types'; type mapComponentToReference = T extends keyof typeof mapNodeToReference ? (typeof mapNodeToReference)[T] extends keyof ReferenceMapping ? ReferenceMapping[(typeof mapNodeToReference)[T]] : never : Record; export type RichTextComponentMapRecord = { [T in ContentTreeWorkarounds.AnyNode | { type: 'fallback'; } as T['type']]?: JSXElementConstructor>>>>; }; export declare const ComponentsContext: React.Context; type WithOptionalProperty = Pick, K> & Omit; export type RichTextProps = { structuredContent: WithOptionalProperty; components?: RichTextComponentMapRecord; }; declare const RichText: React.FC; export default RichText;