@apollo/client-react-streaming
Version:
This package provides building blocks to create framework-level integration of Apollo Client with React's streaming SSR. See the [@apollo/client-integration-nextjs](https://github.com/apollographql/apollo-client-integrations/tree/main/packages/nextjs) pac
24 lines • 940 B
TypeScript
import React from "react";
import type { RehydrationContextValue } from "./types.js";
import type { Stringify } from "./serialization.js";
/**
* @public
*/
export interface HydrationContextOptions {
/**
* Props that will be passed down to `script` tags that will be used to transport
* data to the browser.
* Can e.g. be used to add a `nonce`.
*/
extraScriptProps?: ScriptProps;
}
type SerializableProps<T> = Pick<T, {
[K in keyof T]: T[K] extends string | number | boolean | undefined | null ? K : never;
}[keyof T]>;
type ScriptProps = SerializableProps<React.ScriptHTMLAttributes<HTMLScriptElement>>;
export declare function buildApolloRehydrationContext({ insertHtml, stringify, extraScriptProps, }: HydrationContextOptions & {
insertHtml: (callbacks: () => React.ReactNode) => void;
stringify: Stringify;
}): RehydrationContextValue;
export {};
//# sourceMappingURL=RehydrationContext.d.ts.map