forket
Version:
A library (not a framework) that brings the support of React Server Components in your React application.
29 lines (26 loc) • 867 B
TypeScript
export type ForketOptions = {
sourceDir?: string;
buildDir?: string;
serverDirName?: string;
clientDirName?: string;
forketServerActionsHandler?: string;
serverActionsEndpoint?: string;
clientCopyableFiles?: string[];
watch?: boolean;
printGraph?: boolean;
exposeReactGlobally?: boolean;
enableLogging?: boolean;
serverLogsColor?: string;
clientLogsColor?: string;
};
export interface ForketInstance {
process(): Promise<void>;
resetId(): void;
getGraphs(): Object;
printGraph(node: any): void;
forketServerActions(forketServerActionsHandler?: Function): Promise<void>;
serveApp({ factory: Function }): (req: any, res: any) => void;
setRenderer(renderer: Function): void;
setRequestContext(requestContext: any): void;
}
export default function Forket(options?: ForketOptions, configPath?: string): Promise<ForketInstance>;