import { RemoteComponentRendererProps, RemoteTextRendererProps } from '@mittwald/remote-dom-react/host'; import { ReactNode } from 'react'; export declare function isRemoteComponentRendererProps(props: unknown): props is RemoteComponentRendererProps; /** * The text `children` are _themselves_ — plain strings and numbers locally, * `RemoteTextRenderer` elements remotely — joined and trimmed. `undefined` when * there is none. * * Text inside an element child is deliberately left out, because it belongs to * that element rather than to the component being described: * `` is the option * "Millennium Falcon", not "Millennium Falcon Latest". A fragment is grouping * rather than rendered output, so this looks through it. * * Use this over {@link extractTextFromFirstChild} when the question is "what * does this read as", not "are the children one single text node". */ export declare const extractTextFromChildren: (children: ReactNode) => string | undefined; /** * Whether `children` render any text of their own — what `Button` and `Link` * ask to tell a labelled control from an icon-only one. The same reading as * {@link extractTextFromChildren}, so fragments are transparent and children * that are only whitespace do not count as a label. */ export declare const containsTextChild: (children: ReactNode) => boolean; /** * The text of `children` when they are exactly one text node — locally a * string, remotely a `RemoteTextRenderer` element. `undefined` for anything * else, including a single string next to anything at all. * * That strictness is the point for its callers: `Markdown` takes it as the * markdown source, and `Initials` and `Truncate` operate on the whole content. * For "what does this read as", use {@link extractTextFromChildren}. */ export declare const extractTextFromFirstChild: (children: ReactNode) => string | undefined; export declare function isRemoteTextRenderProps(props: unknown): props is RemoteTextRendererProps;