import { ActionTypeEnum, AttributeType, TaskStatus } from './graphql-global-types'; import { ITypeOptions } from './typeOptions'; import type { IMobxActionStyle, IMobxActionWhen, IMobxFieldWhen } from './when'; import { ICollaborator } from '../types/cells'; /********************************* Section **********************************/ export interface IMobxSection { id: string; name: string | null; refreshListener: IMobxRefreshListener; control: IMobxControl | null; } /********************************* Refresh Listener **********************************/ export declare type IMobxRefreshListener = string[] | null; /********************************* Flow **********************************/ export interface IMobxFlowStage { id: string | null; page: string | null; name: string | null; label: string | null; icon: string | null; } export interface IMobxFlow { id: string; name: string | null; stages: IMobxFlowStage[]; } export interface IMobxFlowInstance { stage: string; state: FlowStageState; comment: string | null; page: string; entity: string; } export declare enum FlowStageState { COMPLETED = "COMPLETED", NORMAL = "NORMAL", REJECTED = "REJECTED", RETURN = "RETURN", PENDING = "PENDING" } /********************************* Action **********************************/ export declare enum ConditionValueTypeEnum { CONSTANT = "CONSTANT", FUNC = "FUNC", VARIABLE = "VARIABLE" } export interface Condition { type: OperatorType; binding: string | null; valueType?: ConditionValueTypeEnum | null; value?: any | null; } export interface IMobxControlAction { label: string | null; action: string | null; actionType: ActionTypeEnum | null; view: string | null; page: string | null; entity: string; flow: string | null; stage: string | null; useEntityId: boolean; createNew: boolean; args: any | null; when: IMobxActionWhen[]; style: IMobxActionStyle; confirmModal?: { label: string; comment?: boolean; feedback?: boolean; }; toast?: { label: string; }; validation: boolean | null; } /********************************* Control **********************************/ export declare enum ControlType { GRID_CONTROL = "GRID_CONTROL", FORM_CONTROL = "FORM_CONTROL", CHART_CONTROL = "CHART_CONTROL", CUSTOM_CONTROL = "CUSTOM_CONTROL" } export interface IMobxField { id: string; entity: string; label: string | null; editable: boolean | null; required: boolean | null; sortable: boolean | null; type: AttributeType; typeOptions: ITypeOptions; refreshListener: IMobxRefreshListener; fixed: boolean | null; when: IMobxFieldWhen[]; } export declare enum OperatorType { EQUALS = "EQUALS", NOT_EQUAL = "NOT_EQUAL", CONTAINS = "CONTAINS", NOT_CONTAINS = "NOT_CONTAINS", IS_EMPTY = "IS_EMPTY", IS_NOT_EMPTY = "IS_NOT_EMPTY", LESS_THAN = "LESS_THAN", LESS_THAN_OR_EQUAL = "LESS_THAN_OR_EQUAL", GREATER_THAN = "GREATER_THAN", GREATER_THAN_OR_EQUAL = "GREATER_THAN_OR_EQUAL", AND = "AND", OR = "OR", LIKE = "LIKE", IN = "IN", NOT_IN = "NOT_IN", RANGE = "RANGE" } export interface IMobxFilter { id: string; label: string | null; type: AttributeType; typeOptions: ITypeOptions; defaultOperator: OperatorType | null; } export declare type FilterValue = any; interface IMobxBaseControl { id: string; name: string | null; type: ControlType; } declare type IMobxControlTypeMap = { [ControlType.GRID_CONTROL]: IMobxGridControl; [ControlType.FORM_CONTROL]: IMobxFormControl; [ControlType.CHART_CONTROL]: IMobxChartControl; [ControlType.CUSTOM_CONTROL]: never; }; export declare type IMobxControl = IMobxControlTypeMap[T]; /********************************* Grid Control **********************************/ interface IMobxGridControlOption { pagination: { size: number | null; showTotal: boolean | null; }; } export interface IMobxGridControl extends IMobxBaseControl { entity: string | null; type: ControlType.GRID_CONTROL; loadAction: IMobxControlAction | null; recordActions: IMobxControlAction[] | null; actions: IMobxControlAction[] | null; fields: IMobxField[]; filterFields: IMobxField[]; option: IMobxGridControlOption; } /********************************* Form Control **********************************/ export interface IMobxFormControl extends IMobxBaseControl { entity: string | null; type: ControlType.FORM_CONTROL; loadAction: IMobxControlAction | null; fields: IMobxField[]; } /********************************* Chart Control **********************************/ export interface IMobxChartControl extends IMobxBaseControl { type: ControlType.CHART_CONTROL; loadAction: IMobxControlAction | null; } export interface IMobxTask { id: string; title: string; subTitle: string | null; status: TaskStatus; assignees: ICollaborator[]; showProcess: boolean | null; count: number | null; expectedCount: number | null; expectedEndTime: string | null; actualEndTime: string | null; } export {};