import * as react from 'react';
import { RefObject } from 'react';
import { AxiosRequestConfig } from 'axios';
import * as Yup from 'yup';

interface UseAxiosResponse<T> {
    data: T | null;
    loading: boolean;
    error: string | null;
    makeRequest: (url: string, method?: string, requestData?: any) => void;
    cancelRequest: () => void;
}
interface UseAxiosConfig extends AxiosRequestConfig {
    baseURL?: string;
    headers?: {
        [key: string]: string;
    };
}
declare const useAxios: <T>(config?: UseAxiosConfig) => UseAxiosResponse<T>;
declare const useAdvReducer: <State, Action extends {
    type: string;
}>(initialState: State, actions: Record<string, (state: State, action: Action) => State>) => (state: State | undefined, action: Action) => State;
interface FetchState<T> {
    data: T | null;
    loading: boolean;
    error: string | null;
}
declare function useFetch<T>(url: string): FetchState<T>;
declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T) => void];
declare function useToggle(initialValue?: boolean): [boolean, () => void];
declare function useDebounce<T>(value: T, delay: number): T;
declare function useThrottle<T>(value: T, limit: number): T;
declare function usePrevious<T>(value: T): T | undefined;
declare function useMediaQuery(query: string): boolean;
declare function useClipboard(): [boolean, (text: string) => Promise<void>];
declare function useInterval(callback: () => void, delay: number | null): void;
interface WindowSize {
    width: number;
    height: number;
}
declare function useWindowSize(): WindowSize;
declare function useKeyPress(targetKey: string): boolean;
declare function useOnlineStatus(): boolean;
interface ScrollPosition {
    x: number;
    y: number;
}
declare function useScrollPosition(): ScrollPosition;
declare function useTimeout(callback: () => void, delay: number | null): void;
declare function useDarkMode(): [boolean, () => void];
declare function useForm<T extends Record<string, any>>(initialValues: T): {
    values: T;
    errors: Partial<Record<keyof T, string>>;
    handleChange: (name: keyof T, value: any) => void;
    validate: (validators: Partial<Record<keyof T, (value: any) => string | null>>) => boolean;
};
declare function useArray<T>(initialArray: T[]): {
    array: T[];
    set: react.Dispatch<react.SetStateAction<T[]>>;
    push: (item: T) => void;
    removeByIndex: (index: number) => void;
    clear: () => void;
};
declare function useStep<T>(steps: T[]): {
    currentStep: T;
    currentStepIndex: number;
    next: () => void;
    previous: () => void;
    reset: () => void;
    isFirstStep: boolean;
    isLastStep: boolean;
};
declare function useTimeoutFn(callback: () => void, delay: number | null): {
    reset: () => void;
    clear: () => void;
};
declare function useDebouncedCallback(callback: () => void, delay: number): () => void;
declare function useScrollLock(lock: boolean): void;
declare function useResizeObserver<T extends HTMLElement>(ref: RefObject<T>): WindowSize | null;
interface MousePosition {
    x: number;
    y: number;
}
declare function useMousePosition(): MousePosition;
type ScrollDirection = 'up' | 'down';
declare function useScrollDirection(): ScrollDirection;
declare function useImageLoader(src: string): {
    loaded: boolean;
    error: boolean;
};
declare function usePersistedState<T>(key: string, initialValue: T): [T, React.Dispatch<React.SetStateAction<T>>];
declare function useReducedMotion(): boolean;
declare function useCookie(key: string): [string | null, (value: string, options?: any) => void, () => void];
declare function useFetchRetry<T>(url: string, options: RequestInit, retries?: number): {
    data: T | null;
    error: string | null;
    loading: boolean;
};
declare function useDelay<T>(value: T, delay: number): T;
declare function useVisibilityChange(): boolean;
declare function useDebouncedValue<T>(value: T, delay: number): T;
type Status = 'idle' | 'pending' | 'success' | 'error';
type AsyncFunction<T> = () => Promise<T>;
interface UseAsyncReturn<T> {
    execute: () => void;
    status: Status;
    value: T | null;
    error: Error | null;
}
declare function useAsync<T>(asyncFunction: AsyncFunction<T>, immediate?: boolean): UseAsyncReturn<T>;
type ScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';
declare function useScript(src: string, removeOnUnmount?: boolean): ScriptStatus;
declare function useIndexedDB<T>(dbName: string, storeName: string): {
    data: T | null;
    error: Error | null;
};
declare function useGeoLocation(): {
    position: GeolocationPosition | null;
    error: Error | null;
};
declare function useTimer(initialTime: number): {
    time: number;
    error: Error | null;
};
declare function useIsMounted(): boolean;
declare function useCss(css: string): {
    error: Error | null;
};
declare function useSpeak(text: string): {
    speak: () => void;
    error: Error | null;
};
declare function useCountUp(target: number, duration: number): {
    count: number;
    error: Error | null;
};
declare function useCountDown(start: number): {
    count: number;
    error: Error | null;
};
interface BatteryState {
    supported: boolean;
    loading: boolean;
    level: number | null;
    charging: boolean | null;
    chargingTime: number | null;
    dischargingTime: number | null;
}
declare const useBattery: () => BatteryState;
declare const useEventListener: (eventName: string, handler: (event: Event) => void, elementRef?: React.RefObject<HTMLElement>, options?: boolean | AddEventListenerOptions) => void;
interface HistoryState {
    [key: string]: any;
}
interface UseHistory {
    history: History;
    state: HistoryState | null;
    push: (path: string, state?: HistoryState) => void;
    replace: (path: string, state?: HistoryState) => void;
    goBack: () => void;
    goForward: () => void;
}
declare const useHistory: () => UseHistory;
interface UsePreferredLanguage {
    language: string;
    languages: Array<string>;
    isSupported: boolean;
}
declare const usePreferredLanguage: () => UsePreferredLanguage;
interface UseSessionStorage<T> {
    (key: string, initialValue: T): [T, (value: T) => void];
}
declare const useSessionStorage: UseSessionStorage<any>;
interface UseSound {
    play: () => void;
    pause: () => void;
    stop: () => void;
    setVolume: (volume: number) => void;
    isPlaying: boolean;
    error: Error | null;
}
declare const useSound: (url: string) => UseSound;
interface TouchPosition {
    x: number | null;
    y: number | null;
}
interface UseTouch {
    (elementRef: React.RefObject<HTMLElement>): {
        touchStart: TouchPosition;
        touchMove: TouchPosition;
        touchEnd: TouchPosition;
    };
}
declare const useTouch: UseTouch;
declare const useUpdateEffect: (effect: React.EffectCallback, deps: React.DependencyList) => void;

interface FormRef {
    current: {
        validateForm: () => Promise<Record<string, any>>;
    } | null;
}
type ValidationResult = {
    isValid: boolean;
    errors: Record<string, any> | [];
};
type MenuItem = {
    path?: string;
    data?: MenuItem[];
    [key: string]: any;
};
type ReducerActionHandler<State, Action> = (state: State, action: Action) => State;
type StorageType = 'local' | 'session';
type StorageAction = 'SET' | 'GET' | 'REMOVE' | 'CLEAR';
interface UseStorageParams {
    action: StorageAction;
    type: StorageType;
    key: string;
    value?: any;
}
type FlattenedObject = {
    [key: string]: any;
};

declare const isWindowReady: () => boolean;
declare const _encryptJson: (decrypted: any, secretKey: string) => string | null;
declare const _decryptJson: (encrypted: string, secretKey: string) => any;
declare const _encryptString: (text: string, secretKey: string, isRandom?: boolean) => {
    ciphertext: string;
    iv: string;
};
declare const _decryptString: (ciphertext: string, ivBase64: string, secretKey: string) => string;
declare const _encryptPayload: (jsonData: any, secretKey: string) => {
    data: string;
    header: string;
    iv: string;
} | undefined;
declare const _generatePassword: (length?: number) => string;
declare const _getStartStopTime: (sdate: Date, format?: string) => "Invalid Date" | {
    startTime: string;
    stopTime: string;
};
declare const _isEmptyArray: (value: unknown) => boolean;
declare const _isEmptyObject: (obj: object) => boolean;
declare const _isValueInArray: <T>(array: unknown, value: T) => boolean;
declare const _exportToExcel: (jsonData: object[], fileName: string, fileExtension?: string) => void;
declare const _promise: (time: number) => Promise<unknown>;
declare const _hasItem: (menuItems: MenuItem[], path: string, key?: string) => any | null;
declare const _hasElement: (arr: MenuItem[], key: string, value: any) => any | null;
declare const _flattenArray: (arr: any[]) => any[];
declare const _dynamicReducer: (initialState: any) => (state: any, action: any) => any;
declare const _genericReducer: <State, Action extends {
    type: string;
}>(initialState: State, actions: Record<string, ReducerActionHandler<State, Action>>) => (state: State | undefined, action: Action) => State;
declare const _thousandSeparator: (num: number) => {
    allDecimal: string;
    twoDecimal: string;
};
declare const _getFinancialYear: () => string;
declare const _getStorage: ({ action, type, key, value }: UseStorageParams) => any | null;
declare const _deepClone: <T>(obj: T) => T;
declare const _getCookie: (name: string) => string | null;
declare const _setCookie: (name: string, value: string, days: number) => void;
declare const _mergeObjects: <T extends Record<string, any>>(obj1: T, obj2: T) => T;
declare const _mapObject: <T>(obj: {
    [key: string]: any;
}, callback: (key: string, value: any) => T) => T[];
declare const _isEqual: <T>(value1: T, value2: T) => boolean;
declare const _capitalize: (str: string | null | undefined) => string;
declare const _convertToCurrency: (amount: number, currency?: string) => string;
declare const _getBrowserInfo: () => string;
declare const _isMobile: () => boolean;
declare const _parseJSON: <T>(json: string) => T | null;
declare const _stringifyJSON: <T>(value: T) => string | null;
declare const _scrollToTop: () => void;
declare const _batchProcess: <T>(data: T[], batchSize: number, processFn: (item: T) => Promise<void>) => Promise<void>;
declare const _flattenObject: (obj: any, prefix?: string) => FlattenedObject;
declare const _deepMerge: (target: any, source: any) => any;
declare const _chunk: <T>(arr: T[], size: number) => T[][];
declare const _asyncDebounce: (fn: (...args: any[]) => Promise<void>, delay: number) => (...args: any[]) => Promise<void>;
declare const _deepCloneArray: <T>(arr: T[]) => T[];
declare const _getMaxMinValue: (arr: number[]) => {
    max: number;
    min: number;
};
declare const _asyncMap: <T, U>(arr: T[], asyncFn: (item: T) => Promise<U>) => Promise<U[]>;
declare const _transformAsyncData: <T, U>(arr: T[], transformer: (item: T) => Promise<U>) => Promise<U[]>;
declare const _getNestedProperty: (obj: Record<string, any>, path: string) => Record<string, any>;
declare const _deepEqual: (obj1: any, obj2: any) => boolean;
declare const _mergeArrays: <T>(arr1: T[], arr2: T[]) => T[];
declare const _filterDuplicates: <T>(arr: T[], uniqueKey: keyof T) => T[];
declare const _sortByKey: <T>(arr: T[], key: keyof T) => T[];
declare const _mapAsync: <T, U>(arr: T[], asyncFn: (item: T) => Promise<U>) => Promise<U[]>;
declare const _formatDate: (date: Date, format: string) => string;
declare const _calPercentage: (value: number, total: number) => number;
declare const _sum: (numbers: number[]) => number;
declare const _average: (numbers: number[]) => number;
declare const _getPriceAfterTax: (price: number, taxRate: number) => number;
declare const _calculateTimeDifference: (startDate: Date, endDate: Date) => string;
declare const _arrayIncludesObject: (arr: any[], obj: any) => boolean;
declare const _toCamelCase: (str: string) => string;
declare const _freeze: <T extends Record<string, unknown>>(obj: T) => Readonly<T> | null;
declare const _isFreeze: <T extends Record<string, unknown>>(obj: T | null) => boolean;
declare const _seal: <T extends Record<string, unknown>>(obj: T) => T | null;
declare const _isSeal: <T extends Record<string, unknown>>(obj: T | null) => boolean;
declare const _arrayToObject: (arr: [string, any][]) => {
    [key: string]: any;
};
declare const _objectToArray: (obj: any) => any[][];
declare const _arrayToObjectByKey: (arr: any[], key: string) => any;
declare const _isInArray: (arr: any[], value: any) => boolean;
declare const _getObjectValues: (obj: object) => any[];
declare const _swapArrayElements: (arr: any[], index1: number, index2: number) => void;
declare const _filterObjectByKey: (obj: object, keys: string[]) => {
    [k: string]: any;
};
declare const _getScrollPosition: () => {
    scrollX: number;
    scrollY: number;
};
declare const _arrayIntersection: (arr1: any[], arr2: any[]) => any[];
declare const _getArrayOfObjectsByProperty: (arr: any[], key: string, value: any) => any[];
declare const _downloadBlob: (blob: Blob, filename: string) => void;
declare const _base64ToBlob: (base64: string) => Blob;
declare const _initializeFormValues: (fields: string[]) => {
    [key: string]: any;
};
declare const _dynamicRequiredValidation: (requiredFields: string[]) => Yup.ObjectSchema<any>;
declare const _generateYupValidation: (fields: string[]) => Yup.ObjectSchema<any>;
declare const _initializeFormikFields: (fields: string[]) => {
    [key: string]: string;
};
declare const _setNestedProperty: (obj: any, path: string, value: any) => any;
declare const _transformArray: <T, R>(arr: T[], transformFn: (item: T) => R) => R[];
declare const _findObjectById: <T>(arr: T[], id: string) => T | undefined;
declare const _getUniqueValues: (arr: any[]) => any[];
declare const _mergeArraysByKey: (arr1: any, arr2: any, key: string) => any[];
declare const _removeDuplicates: (arr: any, key: string) => any;
declare const _groupBy: (arr: any, key: string) => any;
declare const _arrayDiff: <T>(arr1: T[], arr2: T[]) => T[];
declare const _deepCompareArrays: <T>(arr1: T[], arr2: T[]) => boolean;
declare const _updateObjectInArray: (arr: [], key: string, value: any, update: any) => any[];
declare const _getKeyByValue: (obj: Record<string, any> | null | undefined, value: any) => string | null;
declare const _getValueByKey: (obj: Record<string, any> | null | undefined, key: string) => any;
declare const _getKeysByValue: (obj: Record<string, any> | null | undefined, value: any) => string[];
declare const _dateFormat: (date: Date, format?: string) => string;
declare const _dateTransformer: (data: any) => any;
declare const _escapeRegExpMatch: (s: string) => string;
declare const _isExactMatch: (str: string, match: string) => boolean;
declare const _bytesToSize: (bytes: number, decimals?: number) => string;
declare const _swapArrayByKey: (arr: any, key: string) => any;
declare const _setTouchedFields: (formRef: any, errors: any) => void;
declare const _isValidForm: (formRef: any) => Promise<boolean>;
declare const _validateFormRef: (formRef: FormRef) => Promise<ValidationResult>;
declare const _handleParentsMenu: (currentArr: any, menuID: string) => void;
declare const _handleParentNode: (currentArr: any, menuID: string, permissionKey: string) => void;
declare const _handleChildrenMenu: (currentArr: any, parentKey: any, checked: boolean) => void;
declare const _handlePermissions: (currentArr: any, currentObj: any, permissionKey: string, isChecked: boolean) => any;
declare const _allowDecimalKeys: (event: any) => void;
declare const _allowAlphaKeys: (event: any) => void;
declare const _handlePasteDecimalKeys: (a: any) => void;
declare const _handlePasteAlphabetKeys: (event: any) => void;
declare const _allowAlphaNumericKeys: (event: KeyboardEvent) => void;

export { type AsyncFunction, type ScriptStatus, type Status, type UseAsyncReturn, _allowAlphaKeys, _allowAlphaNumericKeys, _allowDecimalKeys, _arrayDiff, _arrayIncludesObject, _arrayIntersection, _arrayToObject, _arrayToObjectByKey, _asyncDebounce, _asyncMap, _average, _base64ToBlob, _batchProcess, _bytesToSize, _calPercentage, _calculateTimeDifference, _capitalize, _chunk, _convertToCurrency, _dateFormat, _dateTransformer, _decryptJson, _decryptString, _deepClone, _deepCloneArray, _deepCompareArrays, _deepEqual, _deepMerge, _downloadBlob, _dynamicReducer, _dynamicRequiredValidation, _encryptJson, _encryptPayload, _encryptString, _escapeRegExpMatch, _exportToExcel, _filterDuplicates, _filterObjectByKey, _findObjectById, _flattenArray, _flattenObject, _formatDate, _freeze, _generatePassword, _generateYupValidation, _genericReducer, _getArrayOfObjectsByProperty, _getBrowserInfo, _getCookie, _getFinancialYear, _getKeyByValue, _getKeysByValue, _getMaxMinValue, _getNestedProperty, _getObjectValues, _getPriceAfterTax, _getScrollPosition, _getStartStopTime, _getStorage, _getUniqueValues, _getValueByKey, _groupBy, _handleChildrenMenu, _handleParentNode, _handleParentsMenu, _handlePasteAlphabetKeys, _handlePasteDecimalKeys, _handlePermissions, _hasElement, _hasItem, _initializeFormValues, _initializeFormikFields, _isEmptyArray, _isEmptyObject, _isEqual, _isExactMatch, _isFreeze, _isInArray, _isMobile, _isSeal, _isValidForm, _isValueInArray, _mapAsync, _mapObject, _mergeArrays, _mergeArraysByKey, _mergeObjects, _objectToArray, _parseJSON, _promise, _removeDuplicates, _scrollToTop, _seal, _setCookie, _setNestedProperty, _setTouchedFields, _sortByKey, _stringifyJSON, _sum, _swapArrayByKey, _swapArrayElements, _thousandSeparator, _toCamelCase, _transformArray, _transformAsyncData, _updateObjectInArray, _validateFormRef, isWindowReady, useAdvReducer, useArray, useAsync, useAxios, useBattery, useClipboard, useCookie, useCountDown, useCountUp, useCss, useDarkMode, useDebounce, useDebouncedCallback, useDebouncedValue, useDelay, useEventListener, useFetch, useFetchRetry, useForm, useGeoLocation, useHistory, useImageLoader, useIndexedDB, useInterval, useIsMounted, useKeyPress, useLocalStorage, useMediaQuery, useMousePosition, useOnlineStatus, usePersistedState, usePreferredLanguage, usePrevious, useReducedMotion, useResizeObserver, useScript, useScrollDirection, useScrollLock, useScrollPosition, useSessionStorage, useSound, useSpeak, useStep, useThrottle, useTimeout, useTimeoutFn, useTimer, useToggle, useTouch, useUpdateEffect, useVisibilityChange, useWindowSize };
