Interface EngineDefinition<TControllers, TEngineOptions, TSolutionType>

interface EngineDefinition<
    TControllers extends ControllerDefinitionsMap<Controller>,
    TEngineOptions,
    TSolutionType extends SolutionType,
> {
    build: Build<
        TEngineOptions,
        InferControllersMapFromDefinition<TControllers, TSolutionType>,
        InferControllerPropsMapFromDefinitions<TControllers>,
        TControllers,
        TSolutionType,
    >;
    fetchStaticState: FetchStaticState<
        InferControllersMapFromDefinition<TControllers, TSolutionType>,
        UnknownAction,
        InferControllerStaticStateMapFromDefinitionsWithSolutionType<
            TControllers,
            TSolutionType,
        >,
        InferControllerPropsMapFromDefinitions<TControllers>,
        TControllers,
        TSolutionType,
    >;
    hydrateStaticState: HydrateStaticState<
        InferControllersMapFromDefinition<TControllers, TSolutionType>,
        UnknownAction,
        InferControllerPropsMapFromDefinitions<TControllers>,
        TControllers,
        TSolutionType,
    >;
    setNavigatorContextProvider: (
        navigatorContextProvider: NavigatorContextProvider,
    ) => void;
}

Type Parameters

Hierarchy (View Summary)

Properties

Builds an engine and its controllers from an engine definition.

Fetches the static state on the server side using your engine definition.

Fetches the hydrated state on the client side using your engine definition and the static state.

setNavigatorContextProvider: (
    navigatorContextProvider: NavigatorContextProvider,
) => void

Sets the navigator context provider. This provider is essential for retrieving navigation-related data such as referrer, userAgent, location, and clientId, which are crucial for handling both server-side and client-side API requests effectively.

Note: The implementation specifics of the navigator context provider depend on the Node.js framework being utilized. It is the developer's responsibility to appropriately define and implement the navigator context provider to ensure accurate navigation context is available throughout the application. If the user fails to provide a navigator context provider, a warning will be logged either on the server or the browser console.