import dayjs from 'dayjs'; import type { SuperTableColumn, SuperTableFormItem, SuperTableQueryScene } from '../interface'; /** 查询项是否参与查询区展示与 getFormValues(_selected 与 visible 同时满足) */ export declare const isFormItemActive: (item: SuperTableFormItem) => boolean; /** 无场景时:setFormItem / 配置变更 visible 后,同步 _selected 以便查询区与 getFormValues 一致 */ export declare const syncFormItemSelectedByVisible: (formItem: SuperTableFormItem, enableScene: boolean) => void; /** 无场景时:批量按 visible 同步 _selected(如 localStorage 恢复后) */ export declare const syncAllFormItemsSelectedByVisible: (formConfigMap: Record, enableScene: boolean) => void; /** * 获取数据类型 * @param value - 需要获取类型的值 * @returns 类型名称(小写) */ export declare const getDataType: (value: any) => string; /** * @description 初始化表单项配置项列表 * @param { SuperTableFormItem [] } formItems 表单项配置 * @returns SuperTableFormItem [] * */ export declare const initFormItems: (formItems: SuperTableFormItem[]) => { props: Record; visible: boolean; _order: number; _defaultValue: any; type: import("..").SuperTableFormItemType; name: string; modelPropName?: string; label: string; tooltip?: string | number; value?: any; component?: import("vue").Component; span?: number; addonBeforeProps?: import("ant-design-vue").SelectProps; addonAfter?: import("..").SuperTableFormItemAddonAfter; addonAffter?: import("..").SuperTableFormItemAddonAfter; addonAter?: import("..").SuperTableFormItemAddonAfter; quiet?: boolean; requestOnChange?: boolean; showLabel?: boolean; fixed?: boolean; group?: string; cache?: boolean; selected?: boolean; _selected?: boolean; _orderInScene?: number; }[]; /** * 初始化表格列配置项列表 * @param columns - 表格列配置 * @returns 初始化后的表格列列表 */ export declare const initTableColumns: (columns: SuperTableColumn[]) => { dataIndex: string | undefined; width: number; visible: boolean; resizable: any; ellipsis: boolean; component: import("vue").VNode | undefined; index: number; key: string; type?: import("..").SuperTableColumnType | ((row: import("..").SuperTableDataItem, index: number) => import("..").SuperTableColumnType); title: string; titleTooltip?: string | ((row: import("..").SuperTableDataItem, index: number) => string); content?: string | ((row: import("..").SuperTableDataItem, index: number) => any); customRender?: (value: any, row: import("..").SuperTableDataItem, index: number) => any; tooltip?: string | boolean | ((row: import("..").SuperTableDataItem, index: number) => string); props?: Record | ((row: import("..").SuperTableDataItem, index: number) => Record); slotName?: string; copyable?: boolean; minWidth?: number; maxWidth?: number; fixed?: import("..").SuperTableColumnFixedType; sorter?: boolean | ((a: import("..").SuperTableDataItem, b: import("..").SuperTableDataItem) => number); defaultSortOrder?: import("..").SuperTableSortOrders; showInExpand?: boolean; expandItemProps?: Record; flexDirection?: "row" | "column"; expandFlexDirection?: "row" | "column"; maxRows?: number; group?: string; groupTitle?: string; }[]; /** * 格式化场景配置项数据 * @param sceneList - 场景配置项 * @param formConfigMap - 表单项配置列表 * @param sortCodes - 排序码数组 * @returns 格式化后的场景数据 */ export declare const formatSceneData: (sceneList: SuperTableQueryScene[], formConfigMap: Record, sortCodes: string[]) => SuperTableQueryScene[]; /** * 规范化 DatePicker 值:仅允许 dayjs 或空值 */ export declare function normalizeDatePickerValue(value: any): dayjs.Dayjs | undefined; /** * 规范化 RangePicker 值:空值只能是 undefined;有效值必须是 [dayjs|null, dayjs|null] */ export declare function normalizeRangePickerValue(value: any): [dayjs.Dayjs | null, dayjs.Dayjs | null] | undefined; /** * 将 localStorage / JSON 恢复出的查询项值还原为 antd 可用的形态(如 DatePicker / RangePicker 需 dayjs) */ export declare function reviveStoredFormFieldValue(formItem: SuperTableFormItem | undefined, value: any): any; /** * 写入本地前序列化,避免 dayjs 被 JSON 成空对象导致下次无法使用 */ export declare function serializeStoredFormFieldValue(formItem: SuperTableFormItem | undefined, value: any): any; /** * 错误提示信息 * @param args - 需要打印的参数 */ export declare function logError(...args: any[]): void; /** * 校验表单项配置 * @param formItems - 表单项配置 */ export declare const validateFormItems: (formItems: SuperTableFormItem[]) => void; /** * 校验表格列配置 * @param columns - 表格列配置 */ export declare const validateTableColumns: (columns: SuperTableColumn[]) => void; /** * 获取文本的宽度 * @param text - 文本内容 * @param font - 字体设置(包含字号、字体等信息) * @returns 文本宽度(像素) */ export declare const getTextWidth: (text: string, font?: { fontSize?: number; fontFamily?: string; fontWeight?: number; }) => number; /** * 安全解析 JSON 字符串 * @param jsonString - 需要解析的 JSON 字符串 * @param defaultVal - 解析失败时的默认值 * @returns 解析后的值或默认值 */ export declare const parseJsonSafe: >(jsonString: string, defaultVal: T) => T; /** * @description 生成固定输出的32位字符串ID * @param {string} input - 需要生成唯一id的值 * @returns {string} 唯一id * */ export declare const generateID: (input: string) => string; /** * 获取指定名称的 cookie 值 * @param {string} sKey - cookie 的键名 * @returns {string} cookie 的值,如果不存在则返回空字符串 * @example * ```ts * const token = getCookie('token'); * ``` */ export declare const getCookie: (sKey: string) => string;