import { IEvaServiceDefinition } from '@springtree/eva-services-core'; import { AnyAction } from 'redux'; import { IEvaServiceCallOptions } from '@springtree/eva-sdk-core-service'; import { IStateOptions } from './options'; /** * The data payload for an EVA Request Redux action * * @export * @interface IEvaServiceRequestAction * @extends {AnyAction} * @template SVC */ export interface IEvaServiceRequestActionPayload { data: SVC['request']; endpoint?: string; serviceOptions?: IEvaServiceCallOptions; serviceContext: string; chainContext: string; promise: Promise; promiseChain: Promise; } export interface IEvaServiceRequestAction extends AnyAction { type: TYPE; payload: IEvaServiceRequestActionPayload; } /** * The parameters for the create request action helper * * @export * @interface ICreateServiceRequestActionParams * @template SVC */ export interface ICreateServiceRequestActionParams { /** * The EVA Service repository definition * */ service: new () => SVC; /** * The EVA endpoint to use for the call. * Must be supplied if `endpointUrl` is not set in store state * * @type {EvaEndpoint} */ endpoint?: string; /** * The typed EVA service request payload * * @type {SVC['request']} */ payload?: SVC['request']; /** * The XHR call parameters to use * * @type {IEvaServiceCallOptions} */ serviceOptions?: IEvaServiceCallOptions; /** * Optional configuration parameters to for the action and state engine * * @type {IStateOptions} */ stateOptions?: IStateOptions; /** * Each service call has a unique context identifier. * Should be auto-generated but can also be supplied * * @type {string} */ serviceContext?: string; /** * If a service request is part of a chain of calls this chainContext will be used * to identify the chain * * @type {string} */ chainContext?: string; /** * By default the action postfix will be REQUEST. * This property can be used to make other custom actions using the normal * context and promise setup. * The custom action not perform any function if no corresponding logic exists. * * @type {string} */ customActionType?: string; } /** * Helper method to create a typed EVA Service request action * * @export * @template SVC * @param {ICreateServiceRequestAction} params The request action parameters * @returns */ export declare function createServiceRequestAction(params: ICreateServiceRequestActionParams): IEvaServiceRequestAction; //# sourceMappingURL=request.d.ts.map