UNPKG

1.99 kBTypeScriptView Raw
1/**
2 * Custom JSX module designed specifically for TypeDoc's needs.
3 * When overriding a default TypeDoc theme output, your implementation must create valid {@link Element}
4 * instances, which can be most easily done by using TypeDoc's JSX implementation. To use it, set up
5 * your tsconfig with the following compiler options:
6 * ```json
7 * {
8 * "jsx": "react",
9 * "jsxFactory": "JSX.createElement",
10 * "jsxFragmentFactory": "JSX.Fragment"
11 * }
12 * ```
13 * @module
14 */
15import type { IntrinsicElements, JsxElement, JsxChildren, JsxComponent } from "./jsx.elements";
16import { JsxFragment as Fragment } from "./jsx.elements";
17export type { JsxElement as Element, JsxChildren as Children, JsxComponent, } from "./jsx.elements";
18export { JsxFragment as Fragment } from "./jsx.elements";
19/**
20 * Used to inject HTML directly into the document.
21 */
22export declare function Raw(_props: {
23 html: string;
24}): null;
25/**
26 * TypeScript's rules for looking up the JSX.IntrinsicElements and JSX.Element
27 * interfaces are incredibly strange. It will find them if they are included as
28 * a namespace under the createElement function, or globally, or, apparently, if
29 * a JSX namespace is declared at the same scope as the factory function.
30 * Hide this in the docs, hopefully someday TypeScript improves this and allows
31 * looking adjacent to the factory function and we can get rid of this phantom namespace.
32 * @hidden
33 */
34export declare namespace JSX {
35 export { IntrinsicElements, JsxElement as Element };
36}
37/**
38 * JSX factory function to create an "element" that can later be rendered with {@link renderElement}
39 * @param tag
40 * @param props
41 * @param children
42 */
43export declare function createElement(tag: typeof Fragment | string | JsxComponent<any>, props: object | null, ...children: JsxChildren[]): JsxElement;
44export declare function setRenderSettings(options: {
45 pretty: boolean;
46}): void;
47export declare const renderElement: (element: JsxElement | null | undefined) => string;