import { ActionThunk } from '../Core/WdkMiddleware'; import { AttributeField, RecordClass, Question, Answer, ParameterValues } from "../Utils/WdkModel"; export declare type DisplayInfo = { customName: string; pagination: { offset: number; numRecords: number; }; attributes: string[]; tables: string[]; sorting: Sorting[]; }; export declare type Sorting = { attributeName: string; direction: 'ASC' | 'DESC'; }; export declare type AnswerOptions = { parameters?: ParameterValues; displayInfo: DisplayInfo; }; export declare type Action = ChangeColumnPositionAction | ChangeSortingAction | ChangeVisibleColumnsAction | EndLoadingWithAnswerAction | EndLoadingWithErrorAction | StartLoadingAction; export declare const START_LOADING = "answer/start-loading"; export interface StartLoadingAction { type: typeof START_LOADING; } export declare function startLoading(): StartLoadingAction; export declare const END_LOADING_WITH_ERROR = "answer/end-loading-with-error"; export interface EndLoadingWithErrorAction { type: typeof END_LOADING_WITH_ERROR; payload: { error: Error; }; } export declare function endLoadingWithError(error: Error): EndLoadingWithErrorAction; export declare const END_LOADING_WITH_ANSWER = "answer/end-loading-with-answer"; interface AnswerData { answer: Answer; question: Question; recordClass: RecordClass; displayInfo: DisplayInfo; parameters: ParameterValues; } export interface EndLoadingWithAnswerAction { type: typeof END_LOADING_WITH_ANSWER; payload: AnswerData; } export declare function endLoadingWithAnswer(payload: AnswerData): EndLoadingWithAnswerAction; export declare const CHANGE_SORTING = "answer/change-sorting"; export interface ChangeSortingAction { type: typeof CHANGE_SORTING; payload: { sorting: Sorting[]; }; } export declare function changeSorting(sorting: Sorting[]): ChangeSortingAction; export declare const CHANGE_COLUMN_POSITION = "answer/change-column-position"; export interface ChangeColumnPositionAction { type: typeof CHANGE_COLUMN_POSITION; payload: { columnName: string; newPosition: number; }; } export declare function changeColumnPosition(columnName: string, newPosition: number): ChangeColumnPositionAction; export declare const CHANGE_VISIBLE_COLUMNS = "answer/change-visible-columns"; export interface ChangeVisibleColumnsAction { type: typeof CHANGE_VISIBLE_COLUMNS; payload: { attributes: AttributeField[]; }; } export declare function changeVisibleColumns(attributes: AttributeField[]): ChangeVisibleColumnsAction; declare type LoadAction = StartLoadingAction | EndLoadingWithErrorAction | EndLoadingWithAnswerAction; /** * Retrieve's an Answer resource from the WDK REST Service and dispatches an * action with the resource. * * Request data format, POSTed to service: * * { * "searchConfig": { * "parameters": Object (map of paramName -> paramValue), * "filters": [ { * “name": String, value: Any * } ], * "viewFilters": [ { * “name": String, value: Any * } ] * }, * reporterConfig: { * pagination: { offset: Number, numRecords: Number }, * attributes: [ attributeName: String ], * sorting: [ { attributeName: String, direction: Enum[ASC,DESC] } ] * } * } * * @param {string} questionUrlSegment * @param {Object} opts Addition data to include in request. * @param {Object} opts.parameters Object map of parameters. * @param {Array} opts.filters Array of filter spec objects: { name: string; value: any } * @param {Array} opts.viewFilters Array of view filter spec objects: { name: string; value: any } * @param {string} opts.displayInfo.customName Custom name for the question to display on the page * @param {Object} opts.displayInfo.pagination Pagination specification. * @param {number} opts.displayInfo.pagination.offset 0-based index for first record. * @param {number} opts.displayInfo.pagination.numRecord The number of records to include. * @param {Array} opts.displayInfo.attributes Array of attribute names to include. * @param {Array} opts.displayInfo.sorting Array of sorting spec objects: { attributeName: string; direction: "ASC" | "DESC" } */ export declare function loadAnswer(questionUrlSegment: string, recordClassUrlSegment: string, opts: AnswerOptions): ActionThunk; export {}; //# sourceMappingURL=AnswerActions.d.ts.map