react-intlayer
Version:
Easily internationalize i18n your React applications with type-safe multilingual content management.
45 lines (44 loc) • 1.41 kB
TypeScript
import { HTMLComponents } from "./HTMLComponentTypes.js";
import { FC, JSX } from "react";
//#region src/html/HTMLRenderer.d.ts
type RenderHTMLProps = {
/**
* Component overrides for HTML tags.
* Allows you to customize how specific HTML elements are rendered.
*/
components?: HTMLComponents<'permissive', {}>;
};
/**
* Renders HTML-like content to JSX with the provided components.
*
* This function does not use context from HTMLProvider. Use `useHTMLRenderer`
* hook if you want to leverage provider context.
*/
declare const renderHTML: (content: string, {
components
}?: RenderHTMLProps) => JSX.Element;
/**
* Hook that returns a function to render HTML content.
*
* This hook considers the configuration from the `HTMLProvider` context if available,
* falling back to the provided components.
*/
declare const useHTMLRenderer: ({
components
}?: RenderHTMLProps) => (content: string) => JSX.Element;
type HTMLRendererProps = RenderHTMLProps & {
/**
* The HTML content to render as a string.
*/
children: string;
};
/**
* React component that renders HTML-like content to JSX.
*
* This component uses the components from the `HTMLProvider` context
* if available.
*/
declare const HTMLRenderer: FC<HTMLRendererProps>;
//#endregion
export { HTMLRenderer, HTMLRendererProps, RenderHTMLProps, renderHTML, useHTMLRenderer };
//# sourceMappingURL=HTMLRenderer.d.ts.map