UNPKG

@antdv/pro-utils

Version:

@antdv/pro-utils

26 lines (25 loc) 1.06 kB
import type { NamePath } from 'ant-design-vue/lib/form/interface'; import type { ProFieldValueType } from '../typing'; import dayjs from 'dayjs'; type DateFormatter = (string & Record<string, unknown>) | 'number' | 'string' | ((value: dayjs.Dayjs, valueType: string) => string | number) | false; export declare const dateFormatterMap: { time: string; timeRange: string; date: string; dateWeek: string; dateMonth: string; dateQuarter: string; dateYear: string; dateRange: string; dateTime: string; dateTimeRange: string; }; export declare function isPlainObject(o: { constructor: any; }): boolean; export declare function convertMoment(value: dayjs.Dayjs, dateFormatter: DateFormatter, valueType: string): string | number | dayjs.Dayjs; export declare function conversionMomentValue<T extends Record<string, unknown> = any>(value: T, dateFormatter: DateFormatter, valueTypeMap: Record<string, { valueType: ProFieldValueType; dateFormat: string; } | any>, omitNil?: boolean, parentKey?: NamePath): T; export {};