Files
SnowLuma/.pnpm-store/v11/files/38/5ac63f7c937f85d6c3c1ef6b19c009fdd096fc6a7c383df33bbae986e68cfb2a85365a2a352b3b110f48d6679afc3bc40c5da091f36be2a4982da6545131ec
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

64 lines
3.0 KiB
Plaintext

import { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from "../utils/html.js";
import { DOM_MEMO } from "./constants.js";
import { JSX as JSX$1 } from "./intrinsic-elements.js";
import { Context } from "./context.js";
//#region src/jsx/base.d.ts
export type Props = Record<string, any>;
type FunctionComponentResult = HtmlEscapedString | JSXNode | Child[] | Promise<HtmlEscapedString | JSXNode | Child[]> | null;
export type FC<P = Props> = {
(props: P): FunctionComponentResult;
defaultProps?: Partial<P> | undefined;
displayName?: string | undefined;
};
export type DOMAttributes = JSX$1.HTMLAttributes;
export declare namespace JSX {
type Element = HtmlEscapedString | Promise<HtmlEscapedString>;
type ElementType = string | ((props: never) => FunctionComponentResult);
interface ElementChildrenAttribute {
children: Child;
}
interface IntrinsicElements extends JSX$1.IntrinsicElements {
[tagName: string]: Props;
}
interface IntrinsicAttributes {
key?: string | number | bigint | null | undefined;
}
}
export declare const getNameSpaceContext: () => Context<string> | undefined;
export declare const booleanAttributes: string[];
export type Child = string | Promise<string> | number | JSXNode | null | undefined | boolean | Child[];
export declare const renderChildren: (children: Child[]) => HtmlEscapedString | Promise<HtmlEscapedString>;
export declare const isUntrustedObject: (value: unknown) => boolean;
export declare const renderUntrustedObject: (value: unknown) => HtmlEscapedString | Promise<HtmlEscapedString>;
export declare class JSXNode implements HtmlEscaped {
tag: string | Function;
props: Props;
key?: string;
children: Child[];
isEscaped: true;
constructor(tag: string | Function, props: Props, children: Child[]);
get type(): string | Function;
get ref(): any;
toString(): string | Promise<string>;
toStringToBuffer(buffer: StringBufferWithCallbacks): void;
}
export declare class JSXFragmentNode extends JSXNode {
toStringToBuffer(buffer: StringBufferWithCallbacks): void;
}
export declare const jsx: (tag: string | Function, props: Props | null, ...children: Child[]) => JSXNode;
export declare const jsxFn: (tag: string | Function, props: Props, children: Child[]) => JSXNode;
export declare const shallowEqual: (a: Props, b: Props) => boolean;
export type MemorableFC<T> = FC<T> & {
[DOM_MEMO]: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean;
};
export declare const memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
export declare const Fragment: ({ children }: {
key?: string;
children?: Child | HtmlEscapedString;
}) => HtmlEscapedString;
export declare const isValidElement: (element: unknown) => element is JSXNode;
export declare const cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Partial<Props>, ...children: Child[]) => T;
export declare const reactAPICompatVersion = "19.0.0-hono-jsx";
//#endregion
export {};