import type { Action } from '@reduxjs/toolkit'; import { type CommerceEngine, type CommerceEngineOptions } from '../../../app/commerce-engine/commerce-engine.js'; import type { Controller } from '../../../controllers/controller/headless-controller.js'; import { SolutionType } from '../types/controller-constants.js'; import type { ControllerDefinitionsMap } from '../types/controller-definitions.js'; import type { BuildParameters, CommerceControllerDefinitionsMap, EngineDefinitionOptions } from '../types/engine.js'; /** * The SSR commerce engine. * * @group Engine */ export interface SSRCommerceEngine extends CommerceEngine { /** * Waits for the request to be completed and returns a promise that resolves to an `Action`. */ waitForRequestCompletedAction(): Promise[]; } /** * SSR-specific commerce engine options with deprecated context property. */ export type SSRCommerceEngineOptions = Omit & { configuration: Omit & { /** * @deprecated In the future major release, context should be provided through `fetchStaticState` rather than in the engine definition. * * @example * ```ts * engineDefinition = defineCommerceEngine({...}); * engineDefinition.fetchStaticState({ * context: {...}, * }); * ``` */ context: CommerceEngineOptions['configuration']['context']; }; }; export type CommerceEngineDefinitionOptions = ControllerDefinitionsMap> = EngineDefinitionOptions & { /** * Callback invoked when the access token changes. */ onAccessTokenUpdate?: (updateCallback: (token: string) => void) => void; }; export declare const buildFactory: (controllerDefinitions: TControllerDefinitions | undefined, options: CommerceEngineDefinitionOptions) => (solutionType: T) => (...[buildOptions]: BuildParameters) => Promise<{ engine: SSRCommerceEngine; controllers: import("../types/controller-inference.js").InferControllersMapFromDefinition; }>;