UNPKG

@lit-labs/ssr-react

Version:
41 lines 1.76 kB
/** * @license * Copyright 2024 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import type { jsx, jsxs } from 'react/jsx-runtime'; import type { jsxDEV } from 'react/jsx-dev-runtime'; import { type ReactNode, type ElementType } from 'react'; /** * Produces a wrapped jsx-runtime `jsx` function that will server render Lit * components' shadow DOM. * * @param originalJsx The original `jsx` function to wrap. * @param originalJsxs The original `jsxs` function to be used for creating * React elements with static children. * @returns Wrapped `jsx` function to be used for production builds. */ export declare function wrapJsx(originalJsx: typeof jsx, originalJsxs: typeof jsxs): <P extends { children?: ReactNode; }>(type: ElementType<P>, props: P, key: string | undefined) => any; /** * Produces a wrapped jsx-runtime `jsxs` function that will server render Lit * components' shadow DOM. * * @param originalJsxs The original `jsxs` function to wrap. * @returns Wrapped `jsxs` function to be used for production builds. */ export declare function wrapJsxs(originalJsxs: typeof jsxs): <P extends { children: ReactNode[]; }>(type: ElementType<P>, props: P, key: string | undefined) => any; /** * Produces a wrapped jsx-dev-runtime `jsxDEV` function that will server render * Lit components' shadow DOM. * * @param originalJsxDEV The original `jsxDEV` function to wrap. * @returns Wrapped `jsxs` function to be used for development builds. */ export declare function wrapJsxDev(originalJsxDEV: typeof jsxDEV): <P extends { children?: ReactNode[] | ReactNode; }>(type: ElementType<P>, props: P, key: string | undefined, isStaticChildren: boolean, source: Object, self: Object) => any; //# sourceMappingURL=wrap-jsx.d.ts.map