@getcronit/pylon
Version:

39 lines (38 loc) • 1.3 kB
TypeScript
import { PageProps } from '.';
declare const DataClientProvider: React.FC<{
client: any;
children: React.ReactNode;
}>;
declare const useDataClient: () => any;
export { DataClientProvider, useDataClient };
/**
* Provides the route data to components. If a 'name' is provided, it
* registers the $refetch function in the global registry for remote calls.
*/
declare const RouteDataProvider: React.FC<{
children: React.ReactNode;
props: PageProps;
name?: string;
}>;
/**
* Hook to access the route data for the current provider layer.
*/
declare const useRouteData: () => PageProps;
/**
* Hook to trigger data refetching for the current layer and/or specified named layers.
* Returns a function that accepts an optional array of provider names.
*/
declare const useRouteDataRefetch: () => ((names?: string[]) => Promise<void[]>);
export { RouteDataProvider, useRouteData, useRouteDataRefetch };
/**
* Provider to signal which layout should be the "pruning target" during SSR.
* Components matching this target will skip rendering their children.
*/
export declare const SSRPruningProvider: React.FC<{
target: string | null;
children: React.ReactNode;
}>;
/**
* Hook to consume the SSR pruning target.
*/
export declare const useSSRPruning: () => string | null;