35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
import { HtmlEscapedString } from "../utils/html.js";
|
|
import { PropsWithChildren } from "./types.js";
|
|
import { Context } from "./context.js";
|
|
import { FC, JSXNode } from "./base.js";
|
|
//#region src/jsx/streaming.d.ts
|
|
/**
|
|
* Used to specify nonce for scripts generated by `Suspense` and `ErrorBoundary`.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* <StreamingContext.Provider value={{ scriptNonce: 'test-nonce' }}>
|
|
* <Suspense fallback={<p>Loading...</p>}>
|
|
* <Content />
|
|
* </Suspense>
|
|
* </StreamingContext.Provider>
|
|
* ```
|
|
*/
|
|
export declare const StreamingContext: Context<{
|
|
scriptNonce: string;
|
|
} | null>;
|
|
/**
|
|
* @experimental
|
|
* `Suspense` is an experimental feature.
|
|
* The API might be changed.
|
|
*/
|
|
export declare const Suspense: FC<PropsWithChildren<{
|
|
fallback: any;
|
|
}>>;
|
|
/**
|
|
* @experimental
|
|
* `renderToReadableStream()` is an experimental feature.
|
|
* The API might be changed.
|
|
*/
|
|
export declare const renderToReadableStream: (content: HtmlEscapedString | JSXNode | Promise<HtmlEscapedString>, onError?: (e: unknown) => string | void) => ReadableStream<Uint8Array>;
|
|
//#endregion |