import React from 'react'; import { ButtonProps } from 'acud/lib/button'; import { DialogBoxProps } from 'acud/lib/dialog-box/dialogbox'; import { ModalProps } from 'acud/lib/modal/Modal'; import { DrawerProps } from 'acud/lib/drawer'; import { EmptyStatusProps } from '../../../components/biz/EmptyStatus'; export declare type TActionType = 'link' | 'ajax' | 'dialog' | 'drawer' | 'custom'; export interface IAjaxOption extends DialogBoxProps { apiAction: string | Function; $payloadFields?: string[] | string[][]; $extraPayload?: object; confirmText?: React.ReactNode; confirmTitle?: React.ReactNode; $toastMessage?: React.ReactNode; $onRequest?: (requestPayload: any) => any; $onResponse?: (response: any, requestPayload: any) => any; $onError?: (error: any, requestPayload: any) => void; } export interface IHooksTableCommonDialogProps { payload: Record; onSuccess: () => void; onCancel: () => void; onConfirmLoading: (confirmLoadingText?: React.ReactNode) => void; onCancelConfirmLoading: () => void; } export interface IDialogBodyOption { type: 'alert' | 'plain' | 'common'; content?: React.ReactNode | React.ComponentType; $payloadFields?: string[] | string[][]; $extraPayload?: object; $onBeforeOpen?: (payload: any) => any; } export interface IDialogOption extends Omit, Omit { width?: number | string; title?: React.ReactNode; body?: IDialogBodyOption; foot?: boolean; cancelWithSuccess?: boolean; confirmLoadingText?: React.ReactNode; } export interface IDrawerBodyOption { content?: React.ReactNode; $payloadFields?: string[] | string[][]; $extraPayload?: object; $onBeforeOpen?: (payload: any) => any; } export interface IDrawerOption extends DrawerProps { title?: React.ReactNode; body?: IDrawerBodyOption; foot?: boolean; cancelWithSuccess?: boolean; confirmLoadingText?: React.ReactNode; } export interface IBulkItemConfig extends ButtonProps { id?: string; text?: React.ReactNode; skin?: 'primary' | 'text' | 'highlight' | 'enhance' | 'default' | 'danger'; select?: boolean; actionType?: TActionType; link?: string; ajax?: IAjaxOption; dialog?: IDialogOption; drawer?: IDrawerOption; action?: string; } export interface IFilterControl extends IBulkItemConfig { name?: string; label?: React.ReactNode; control?: React.ComponentType; controlProps?: any; } export interface IFilterConfig { controls?: IFilterControl[]; } export interface ICommand { [actionName: string]: { actionType?: TActionType; link?: string; ajax?: IAjaxOption; dialog?: IDialogOption; drawer?: IDrawerOption; action?: string; $payloadFields?: string[] | string[][]; $extraPayload?: object; }; } export interface ITableOptions { title?: React.ReactNode; className?: string; fetchListAction: string | Function; abort?: boolean; interval?: number; errorToast?: boolean; $onRequest?: (payload: any) => any; $onResponse?: (page: any, requestPayload?: any) => any; $onError?: (error: any) => void; queryParamKeys?: boolean | string[]; $onQueryParamsChange?: (queryParams: Record, searchParamsString: string) => void; bulkConfig?: IBulkItemConfig[]; bulkComp?: React.ComponentType; filterConfig?: IFilterConfig; filterComp?: React.ComponentType; rowKey?: string; select?: 'multi' | 'single' | 'none'; pageNo?: number; pageSize?: number; pageSizeOptions?: (string | number)[]; tableConfig?: any; tableComp?: React.ComponentType; card?: React.ComponentType; emptyConfig?: { default?: EmptyStatusProps; create?: EmptyStatusProps; search?: EmptyStatusProps; }; emptyComp?: React.ComponentType; commands?: ICommand; } export declare type TGetTableOptions = (...args: any) => ITableOptions;