/** * @jorvel/ssr — remote SSR compatibility helpers * * Federated remotes are typically loaded at runtime via dynamic import * (`import('dashboard/App')`). During SSR, that import will succeed only if * the remote package has been installed locally (e.g. via `workspace:*` or * `npm install`). For truly runtime-fetched remotes (Workers, Edge), use the * `ssrLoadRemoteEdge(map)` form which takes a static `Record Promise>` * — dynamic specifier `import()` is not supported on most edge runtimes. */ import type { ComponentType } from 'react'; import type { SsrRenderResult } from './types.js'; export type SsrRemoteOptions = { /** * The Node.js module specifier to `import()`. * Used in Node SSR; on Workers/Edge use `ssrLoadRemoteEdge` instead. */ specifier: string; /** The named export to use as the component. Defaults to `'default'`. */ exportName?: string; }; export declare function ssrLoadRemote(options: SsrRemoteOptions): Promise | null>; /** * Edge-compatible remote loader. Pass a static map of name → loader. */ export type SsrEdgeRemoteMap = Record Promise<{ default?: ComponentType; } & Record>>; export declare function ssrLoadRemoteEdge(map: SsrEdgeRemoteMap, remoteName: string, exportName?: string): Promise | null>; export type SsrRenderRemoteOptions = SsrRemoteOptions & { /** Props to pass to the remote component. */ props?: Record; /** HTML rendered when the remote cannot be loaded. */ fallbackHtml?: string; /** Whether to use hydratable rendering. Defaults to true. */ hydratable?: boolean; }; export declare function ssrRenderRemote(options: SsrRenderRemoteOptions): Promise; export type SsrRemoteOutletConfig = { /** Map of remote name → Node.js module specifier. */ remotes: Record; /** Subpath forwarded to the remote component. */ subpath?: string; }; export declare function createSsrRemoteOutlet(config: SsrRemoteOutletConfig): (remoteName: string, subpath?: string) => Promise; //# sourceMappingURL=remote-ssr.d.ts.map