// UI组件值的类型
export declare type ValueType = string | number | boolean;
// 接口请求参数
export interface RequestParams extends Record<string, any> {
  readonly page?: number;
}
// checkbox配置项属性
export interface OptionsParams {
  label: ValueType;
  value: ValueType;
  disabled?: boolean;
}
// checkbox组件自带参数
export interface OriginalProps extends Record<string, unknown> {
  disabled?: boolean;
  name?: string;
  style?: any;
}
// ui组件配置项属性
export interface ConfigParams {
  label?: string;
  options?: Array<OptionsParams>;
  separator?: string;
  originalProps?: OriginalProps;
  maxChoice?: number;
  toast?: string;
  show?: (checkedValue: Array<ValueType>) => void;
  request?: (params: RequestParams) => void;
}
// 组件Props
export interface YCheckboxProps {
  value?: Array<ValueType>;
  onChange?: (checkedValue: Array<ValueType>) => void;
  config: ConfigParams;
  style?: any;
}
// 检查规则属性
export interface CheckRuleParams {
  rule: CheckRuleStatus;
  value: ValueType | Array<ValueType>;
  check?: (checkedValue: Array<ValueType>) => boolean;
}

type CheckRuleStatus =
  | 'equal'
  | 'notEqual'
  | 'contain'
  | 'notContain'
  | 'containOr'
  | 'notContainOr';
