import { ComponentType, PropsWithChildren } from 'react'; import { NodeComponentProps } from './types/node-component'; export type CustomComponentDisplayMode = 'inline' | 'block'; export type MarkstreamCustomComponent

= ComponentType

& { markstreamDisplay?: CustomComponentDisplayMode; }; export type CustomComponentMap = Record; export type StreamingComponent = ComponentType>; export type StreamingComponentMap = Record>; export type HtmlComponent

= ComponentType>; export type HtmlComponentMap = Record>; type IsAny = 0 extends (1 & T) ? true : false; type ComponentProps = T extends ComponentType ? P : T extends (props: infer P) => any ? P : never; export type StreamingComponentDefinitions> = { [K in keyof T]: ComponentProps extends infer P ? IsAny

extends true ? T[K] : P extends NodeComponentProps ? NodeComponentProps extends P ? T[K] : never : never : never; }; type ParserComponentOnlyProp = Exclude, 'children' | 'node'>; export type HtmlComponentDefinitions> = { [K in keyof T]: ComponentProps extends infer P ? IsAny

extends true ? T[K] : Extract extends never ? T[K] : never : never; }; export declare function subscribeCustomComponents(listener: () => void): () => void; export declare function getCustomComponentsRevision(): number; export declare function setCustomComponents(id: string, mapping: CustomComponentMap): void; export declare function setCustomComponents(mapping: CustomComponentMap): void; export declare function getCustomNodeComponents(customId?: string): CustomComponentMap; export declare function removeCustomComponents(id: string): void; export declare function clearGlobalCustomComponents(): void; export declare function getCustomComponentDisplay(component: ComponentType | null | undefined): CustomComponentDisplayMode | undefined; export declare function withMarkstreamComponentDisplay>(component: T, display: CustomComponentDisplayMode): T & { markstreamDisplay: CustomComponentDisplayMode; }; export declare function defineStreamingComponents>>(components: T & StreamingComponentDefinitions): T & StreamingComponentDefinitions; export declare function defineHtmlComponents>>(components: T & HtmlComponentDefinitions): T & HtmlComponentDefinitions; export declare function normalizeComponentMap(mapping?: Record): Record; export declare function warnComponentMapConflicts(streamingComponents: StreamingComponentMap, htmlComponents: HtmlComponentMap, warnedTags: Set): void; export {};