import { default as dayjs } from 'dayjs';
import { FieldDisableConfig } from './constant';

export declare const isJsonParse: (jsonString?: string) => any;
export declare const generateRandomId: (concatString?: string) => {
    uniqueStringId: string;
    uniqueNumberId: number;
};
export declare const generateAndFormatStringFromObj: (obj?: any, keysInOrder?: string[]) => string;
export declare const generateFields: (fieldsConfig: any) => any;
export declare const generateQueryString: (rule: any) => string;
export declare const getOperatorLabel: (rule: any, filterFields: any[]) => string;
export declare const formatAmount: (amount?: number | string, format?: string, position?: "after" | "before", symbol?: string, fraction?: number) => string;
export declare const filterCoaByCompanyIdOrNull: (allCoa: any[], { companyId }: {
    companyId?: number | string | null | any[];
}) => any[];
export declare const validateDiscountValidity: (date: any, discountDueDateBasedOn: any, discountValidity: any) => boolean;
export declare const postImportSheet: (request: any, moduleName: string) => Promise<any>;
export declare const getExcelTemplateGenerateTemplate: (request: any) => Promise<Response>;
export declare const getExcelExportTemplate: (request: any) => Promise<Response>;
export declare const getPdfExportTemplate: (request: any) => Promise<Response>;
export declare const removeIdStaticIdsFromMongoObject: (data: any) => any;
export interface UploadOptions {
    onProgress?: (progress: ProgressInfo) => void;
    chunkSize?: number;
    retryAttempts?: number;
    retryDelay?: number;
}
export interface ProgressInfo {
    fileName: string;
    progress: number;
    bytesUploaded: number;
    totalBytes: number;
    fileIndex?: number;
    totalFiles?: number;
}
export interface FileUploadResponse {
    data: {
        preSignedData: {
            uploadId: string;
            fileName: string;
            preSignedUrls: Array<{
                partNumber: number;
                presignedUrl: string;
            }>;
            location?: string;
            presignedUrl?: string;
        };
    };
}
export interface CompleteUploadResponse {
    data: {
        location: string;
    };
}
export interface UploadPart {
    partNumber: number;
    etag: string;
}
export declare const handleRegularUpload: (files: File[], controller: AbortController, module: string, options?: UploadOptions) => Promise<string[]>;
/**
 * Main upload function - handles file validation and orchestrates the upload process
 * @param files - Single file or array of files to upload
 * @param module - Module name for the upload endpoint (default: "sales")
 * @param options - Optional upload configuration
 * @returns Promise<string[]> - Array of uploaded file locations
 */
export declare const uploadFiles: (files: any, module?: string, options?: UploadOptions) => Promise<string[]>;
export declare const formatDateForPayload: (date: any) => string;
export declare const formatTimeForPayload: (date: any) => string;
export declare const formatDateTimeForPayload: (date: any) => string;
export declare function isJSONString(str: string | undefined): any;
export declare const getErrorMessage: (error?: any) => any;
export declare const InvoiceStatus: {
    Approved: string;
    Rejected: string;
};
/**
 * Get the default currency symbol from localStorage user data.
 * This is a utility function (not a hook) so it can be safely called anywhere.
 * @param currencyData - Optional pre-fetched currency data to avoid localStorage lookup
 */
export declare const defaultCurrencySymbol: (currencyData?: {
    symbol?: string;
}) => any;
export declare const getCurrencySymbol: (currencyData?: {
    symbol?: string;
    company_id?: number;
}) => any;
/**
 * Get the default currency format from localStorage user data.
 * This is a utility function (not a hook) so it can be safely called anywhere.
 * @param currencyData - Optional pre-fetched currency data to avoid localStorage lookup
 */
export declare const defaultCurrencyFormat: (currencyData?: {
    number_format?: string;
}) => any;
export declare const getCurrencyFormat: (currencyData?: {
    number_format?: string;
    company_id?: number;
}) => any;
/**
 * Get the default company from localStorage user data.
 * This is a utility function (not a hook) so it can be safely called anywhere.
 * @param userData - Optional pre-fetched user data to avoid localStorage lookup
 */
export declare const defaultCompany: (userData?: {
    accessCompanies?: number[];
    company_id?: number | null;
}) => number;
export declare function omitDataKeys<T>(obj: T, extra?: Array<string>): T;
export interface DataObject {
    [key: string]: any;
}
export interface LabelValueObject extends DataObject {
    label: string;
    value: string | number | null;
}
/**
 * A global function to process an array of objects and return formatted label-value pairs.
 *
 * @param {Array<T>} dataArray - The array of objects to be processed.
 * @param {Array<T>} fallbackArray - The fallback array if dataArray is empty.
 * @param {Array<keyof T | string>} labelKeys - The keys to be concatenated for the label.
 * @param {keyof T | string} valueKey - The key to be used for the value.
 * @param {Function} [labelFormatter] - Optional custom formatter for label.
 * @returns {Array<LabelValueObject>} - The processed array of label-value objects.
 */
export declare const getLabelValuePairs: <T extends DataObject>(dataArray: T[], fallbackArray: T[], labelKeys: (keyof T | string)[], valueKey: keyof T | string, labelFormatter?: (item: T) => string) => LabelValueObject[];
export declare function formatEmptyDataToNull<T>(obj: T): T;
export declare function downloadFile(fileUrl: string, fileName?: string): void;
export declare const downloadDoc: ({ api, raw }: {
    api: string;
    fileName: string;
    raw: any;
}) => Promise<void>;
export declare function formatResponseDatesToDayJS<T>(obj: T): T;
export declare const toFixedWithNumbers: (num: number, fraction?: number) => string | number;
export declare const findById: (arr: Array<any>, id: any) => any;
export declare const getTaxAmountFromMultipleTaxCodes: (amount: number, taxCodes?: any[], detail?: boolean) => number | {
    id: any;
    name: any;
    rate: any;
    tax_amount: number;
}[];
export declare const getTaxAmountDataFromMultipleTaxCodes: (grossAmount: number, netAmount: number, taxCodes?: any[], detail?: boolean) => {
    id: any;
    name: any;
    rate: any;
    tax_amount: number;
}[] | {
    amount: number;
    rate: number;
};
export declare const calculateAmountData: (quantity: number, rate: number, discount_rate: number | null, discounted_items: any, taxCodes?: any[]) => {
    grossAmount: number;
    taxAmount: any;
    taxRate: any;
    discountAmount: number;
    netAmount: number;
    totalAmount: number;
};
export type AnyObject = Record<string, any>;
export declare const hasValue: (object: AnyObject, skipFields?: string[]) => boolean;
export declare const formatAmountWithCurrency: (amount: number, currencySymbol?: string) => string;
export declare const formatAmountWithCurrencyData: (amount: number, currencySymbol?: string) => string;
export type ManageItemsOptions = {
    key: string;
    action: "add" | "update" | "delete";
    value: any;
    items: any[];
    itemIndex: number;
};
export declare const manageItems: ({ key, action, value, items, itemIndex }: ManageItemsOptions) => any[];
export declare function getPartyName(party: Record<any, any> | null | undefined): string;
export declare const partyEmailIds: (json: any) => string;
export declare function formatResponseOnlyDatesToDayJS<T>(obj: T): T;
export declare const fetchExchageRate: (id: string, type?: string) => Promise<{
    exchange_rate: any;
    reverse_rate: any;
}>;
export declare const showSnackBar: (error: any) => void;
export declare const fetchCompanyLocations: (companyId: number) => Promise<{
    label: any;
    value: any;
}[]>;
export declare const fetchItems: (itemId: number, attributes?: string) => Promise<{
    label: any;
    value: any;
}[]>;
export declare const getOptionsData: (key: string, id: number, select?: any, isArray?: boolean) => Promise<{
    label: any;
    value: any;
} | {
    label: any;
    value: any;
}[]>;
export declare const fetchOptions: (key: string, filters: any, select?: any, isArray?: boolean) => Promise<{
    label: any;
    value: any;
} | {
    label: any;
    value: any;
}[]>;
export declare const createdOnAndBy: (data: any) => string;
/**
 * Returns the full name of an object based on the provided keys.
 * The object is expected to have the keys as its properties.
 * If the object is empty, returns a default value.
 * @param {Record<string, any>} obj - The object to process
 * @param {string[]} keys - The keys to use for forming the name
 * @returns {string} The full name of the object
 */
export declare const getName: (obj: Record<string, any>, keys: string[]) => string;
export declare const getToken: (token?: any) => {
    "x-token": any;
    "x-timezone": number;
};
export declare const checkForDuplicate: (payload: any) => Promise<any>;
export declare const partyDuplicateCheck: (activeTab: number | string, fValues: Record<string, any>, defaultValues?: Record<string, any>) => Promise<string | null>;
export declare const displayPhone: (data: Record<string, any>) => any;
export declare const getPartyDependentData: (id: number, options?: any) => Promise<{
    addresses: any[];
    contacts: any[];
    currencies: any;
    currencyIds: any;
    companies: any;
    companyIds: any;
    paymentTerm: any;
    defaultShipping: any;
    defaultBilling: any;
    salesperson: any;
}>;
export interface PayloadMapping {
    [key: string]: string | string[] | ((values: Record<string, any>) => any);
}
export declare const mapApiPayload: (payloadMapping: PayloadMapping, values: Record<string, any>) => Record<string, any>;
export declare const mapAsyncApiPayload: (payloadMapping: PayloadMapping, values: Record<string, any>) => Promise<Record<string, any>>;
export declare const isBetweenTheDates: (startDate: any, endDate: any) => boolean;
export declare const setRateBasedOnPriceRules: (salesPrice: any, priceRules: any, addedQuantity: any) => any;
export declare const uploadAttachments: (files: any) => Promise<string>;
export declare const addOrEditArray: (array: any[], data: any) => any[];
export declare const getDefaultUserData: () => any;
export declare const getDefaultFraction: () => number;
export declare const getAccessibleModules: (moduleNames?: string[]) => string[];
export declare const filterAccessibleModules: (menu: any, moduleNames?: string[]) => any;
export declare const checkDuplicateTracking: (data: any, typeOfTrcebility: string, trackRows: any[]) => {
    isDuplicate: boolean;
    errorMsg?: undefined;
} | {
    isDuplicate: boolean;
    errorMsg: any;
};
export declare function getNestedValue(obj: any, path: any): any;
export declare const calculatePeriods: (startDateTime: Date, endDateTime: Date, mode?: "Day" | "Week" | "Month" | "Calendar Month" | "Year" | "Hour") => string;
export declare const removeIdFromObject: (array: any) => any;
export declare const fetchRentalResponseItems: (filters: string) => Promise<any>;
export declare const fetchRfqItemsByIdForResponse: (filters: string) => Promise<any>;
export declare const appendConditionSafely: (original: string | undefined, newCondition: string) => string;
export declare const fetchAssemblyItemData: (itemId: number) => Promise<any>;
export declare const getFileName: (file: any) => string;
export declare const getFieldFilters: (fields: any[], fieldNames: string | string[]) => any;
export declare const getNextScheduleDate: (currentDate: any, billingCycle: any) => dayjs.Dayjs;
export declare const getCountryIdByName: (name: string) => Promise<any>;
export declare const getSlicedValue: (value: string, length: number) => string;
export declare const skuGenerator: ({ name, category, sequence }: {
    name: string;
    category: string;
    sequence?: string;
}) => string;
export declare const checkSkuAndItemName: (payload: any) => Promise<any>;
export declare const checkUniqueFields: (payload: any) => Promise<any>;
export interface FormValues {
    [key: string]: any;
}
export interface UpdateFieldsDisabledConfig {
    data: any[];
    materialCostingType: string;
    formValues: FormValues;
    fieldsConfig?: FieldDisableConfig;
    isEditMode?: boolean;
    isAddMode?: boolean;
    alwaysDisabledFields?: string[];
    editModeDisabledFields?: string[];
    addModeDisabledFields?: string[];
    customDisabledFields?: string[];
}
export declare const updateFieldsDisabledState: ({ data, materialCostingType, formValues, fieldsConfig, isEditMode, isAddMode, alwaysDisabledFields, editModeDisabledFields, addModeDisabledFields, customDisabledFields }: UpdateFieldsDisabledConfig) => any[];
export declare const remainingMaterialCostingTypes: (type: string | string[]) => string[];
export declare const matchedMaterialCostingTypeLabel: (type: string | string[]) => string;
export declare const fetchDataLocally: (params: any, arr: any) => {
    data: any;
    pagination: {
        totalCount: any;
    };
};
