import { BasketStatusErrorAction, BasketStatusLoadingAction, BasketStatusReceivedAction, FavoritesStatusErrorAction, FavoritesStatusLoadingAction, FavoritesStatusReceivedAction } from '../Actions/UserActions'; import { ActionThunk, EmptyAction } from '../Core/WdkMiddleware'; import { CategoryTreeNode } from '../Utils/CategoryUtils'; import { RecordClass, RecordInstance } from '../Utils/WdkModel'; import { ServiceError } from '../Service/ServiceError'; import WdkService from '../Service/WdkService'; export declare type Action = RecordReceivedAction | RequestPartialRecord | RecordUpdatedAction | RecordLoadingAction | RecordErrorAction | SectionVisibilityAction | SetCollapsedSectionsAction | AllFieldVisibilityAction | NavigationVisibilityAction | CategoryExpansionAction | NavigationQueryAction; export declare const RECORD_RECEIVED = "record-view/record-received"; export declare type RecordReceivedAction = { type: typeof RECORD_RECEIVED; id: string; payload: { record: RecordInstance; recordClass: RecordClass; categoryTree: CategoryTreeNode; }; }; export declare function recordReceived(id: string, payload: RecordReceivedAction['payload']): RecordReceivedAction; export declare const REQUEST_PARTIAL_RECORD = "record-view/request-partial-record"; export declare type RequestPartialRecord = { type: typeof REQUEST_PARTIAL_RECORD; id: string; payload: { recordClassName: string; primaryKeyValues: string[]; attributes?: string[]; tables?: string[]; }; }; export declare function requestPartialRecord(id: string, recordClassName: string, primaryKeyValues: string[], attributes?: string[], tables?: string[]): RequestPartialRecord; export declare const RECORD_UPDATE = "record-view/record-update"; export declare type RecordUpdatedAction = { type: typeof RECORD_UPDATE; id: string; payload: { record: RecordInstance; }; }; export declare function recordUpdate(id: string, record: RecordInstance): RecordUpdatedAction; export declare const RECORD_LOADING = "record-view/record-loading"; export declare type RecordLoadingAction = { type: typeof RECORD_LOADING; id: string; payload: { recordClassUrlSegment: string; primaryKeyValues: string[]; }; }; export declare function recordLoading(id: string, payload: RecordLoadingAction['payload']): RecordLoadingAction; export declare const RECORD_ERROR = "record-view/record-error"; export declare type RecordErrorAction = { type: typeof RECORD_ERROR; id: string; payload: { error: ServiceError; }; }; export declare function recordError(id: string, error: ServiceError): RecordErrorAction; export declare const SECTION_VISIBILITY = "record-view/section-visibility-changed"; export declare type SectionVisibilityAction = { type: typeof SECTION_VISIBILITY; payload: { name: string; isVisible: boolean; }; }; /** Update a section's collapsed status */ export declare function updateSectionVisibility(sectionName: string, isVisible: boolean): SectionVisibilityAction; export declare const SET_COLLAPSED_SECTIONS = "record-view/set-collapsed-sections"; export declare type SetCollapsedSectionsAction = { type: typeof SET_COLLAPSED_SECTIONS; payload: { names: string[]; }; }; /** Update a section's collapsed status */ export declare function setCollapsedSections(names: string[]): SetCollapsedSectionsAction; export declare const ALL_FIELD_VISIBILITY = "record-view/all-field-visibility-changed"; export declare type AllFieldVisibilityAction = { type: typeof ALL_FIELD_VISIBILITY; payload: { isVisible: boolean; }; }; /** Change the visibility for all record fields (attributes and tables) */ export declare function updateAllFieldVisibility(isVisible: boolean): AllFieldVisibilityAction; export declare const NAVIGATION_VISIBILITY = "record-view/navigation-visibility-changed"; export declare type NavigationVisibilityAction = { type: typeof NAVIGATION_VISIBILITY; payload: { isVisible: boolean; }; }; /** Change the visibility of the navigation panel */ export declare function updateNavigationVisibility(isVisible: boolean): NavigationVisibilityAction; export declare const CATEGORY_EXPANSION = "record-view/navigation-category-expansion-changed"; export declare type CategoryExpansionAction = { type: typeof CATEGORY_EXPANSION; payload: { expandedCategories: string[]; }; }; /** Change the visibility of subcategories in the navigation section */ export declare function updateNavigationCategoryExpansion(expandedCategories: string[]): CategoryExpansionAction; export declare const NAVIGATION_QUERY = "record-view/navigation-query-changed"; export declare type NavigationQueryAction = { type: typeof NAVIGATION_QUERY; payload: { query: string; }; }; /** Update navigation section search term */ export declare function updateNavigationQuery(query: string): NavigationQueryAction; declare type BasketAction = BasketStatusLoadingAction | BasketStatusErrorAction | BasketStatusReceivedAction; declare type FavoriteAction = FavoritesStatusLoadingAction | FavoritesStatusReceivedAction | FavoritesStatusErrorAction; declare type LoadRecordAction = RecordLoadingAction | RecordErrorAction | RecordReceivedAction | RecordUpdatedAction; declare type UserAction = BasketAction | FavoriteAction; export interface RecordRequestOptions { attributes: string[]; tables: string[]; } interface RequestRequestOptionsGetter { (recordClass: RecordClass, categoryTree: CategoryTreeNode): RecordRequestOptions[]; } /** Fetch page data from services */ export declare function loadRecordData(recordClass: string, primaryKeyValues: string[], getRecordRequestOptions: RequestRequestOptionsGetter): ActionThunk; /** * Get the base record request payload object * @param wdkService * @param recordClassUrlSegment * @param primaryKeyValues * @returns Promise */ export declare function getPrimaryKey(wdkService: WdkService, recordClassUrlSegment: string, primaryKeyValues: string[]): Promise<{ name: string; value: string; }[]>; export {}; //# sourceMappingURL=RecordActions.d.ts.map