import type { BaseResourceParamType, TFType } from '../models/mp-client-sdk'; import type { MapLike } from './app-types'; import { ScaledSize } from 'react-native'; export declare class Utils { static triggerEvent(eventName: string, payload: any): void; static calculateMsp(dim: ScaledSize, limit: number): boolean; static _makeUniqueStringArray(input: string[]): string[]; static parseQueryParamsToObject(url?: string): Record; static isTablet(): boolean; static sleep(delay?: number): Promise; /** * deviceTypesMappings = {'1':'Desktop Web','2':'Mobile Web','3':'Tablet','4':'Other'}; * @param deviceType */ static dtToNum(deviceType: string): number; /** * static browserToOsMappings = {'101': 'ios','102': 'android', '7': 'Other'}; * @param browser */ static bwToNum(browser: string): number; static langToNum(language: string): number; static mergeMaps(input: MapLike, ...toMerge: Array>): MapLike; static applyTransformationResourceParam(paramValue: string, tf: TFType | undefined): any; /** * Verifies if the given 'toTest' string exists in any of the input array of strings. * By default, this method does a case sensitive match unless specified by the ignoreCase param. * @param toTest * @param inputs * @param ignoreCase - pass a value of 'true' to perform case-insensitive matching. * @param fullMatch */ static isMatch(toTest: string, inputs: string[], ignoreCase: boolean, fullMatch: boolean): boolean; static regExpEscape(input: string): string; static convertToRegex(input: string, ignoreCase: boolean, fullMatch: boolean): RegExp; static safeExecute(fn: (payload: any) => any, payload: any): any; /** * Encode string to Base64 - React Native compatible * Works with both ASCII and UTF-8 strings * @param str String to encode * @returns Base64 encoded string */ static toBase64(str: string): string; /** * Encode an object payload to Base64 string * @param payload Object to encode * @returns Base64 encoded string, or empty string on error */ static encodeToBase64(payload: Record): string; /** * Get the size of a payload in bytes * @param payload Object to measure * @returns Size in bytes */ static getPayloadSizeBytes(payload: Record): number; /** * Check if payload exceeds the maximum allowed size (250KB) * @param payload Object to check * @returns True if payload is oversized */ static isPayloadOversized(payload: Record): boolean; static getUniqueID(): string; /** * Make HTTP GET request - React Native implementation * @param url URL to fetch * @returns Promise with response data */ static getHttp(url: string): Promise; /** * Get value from AsyncStorage (React Native equivalent of sessionStorage) * @param key Storage key * @param defaultValue Default value if key not found * @returns Promise with stored value or default */ static getValueFromAsyncStorage(key: string, defaultValue: T): Promise; /** * Set value to AsyncStorage (React Native equivalent of sessionStorage) * @param key Storage key * @param value Value to store */ static setValueToAsyncStorage(key: string, value: any): Promise; static getSimpleDebugId(prefix?: string): string; static randomNumber(min: number, max: number): number; static unFlattenResourceParams(input: T[]): MapLike; static unFlattenObject(obj: any): Record; static flattenObject(obj: any): Record; }