import { DataStoreType } from "../config/config.js"; declare let isObject: (value: any) => boolean; declare let makeId: (n: any) => string; declare let createPassword: (size: any) => string; declare let isAdmin: (roles: any) => boolean; declare class Deferred { resolve: any; reject: any; promise: any; constructor(); } declare let isSuperAdmin: (roles: any) => boolean; declare let anonymizePhoneNumber: (number: any) => any; declare let equalIgnoreCase: (s1: string, s2: string) => boolean; declare let isNullOrEmpty: (value: any) => boolean; declare let isDefined: (value: any) => boolean; declare let isDefinedAndNotEmpty: (value: any) => boolean; declare let isNotDefined: (value: any) => boolean; declare let isNotDefinedOrEmpty: (value: any) => boolean; declare let isNumber: (data: any) => boolean; /** * * @name isPlainObject * @description * Vérifier si c'est un objet JSON (littéral) * @returns {boolean} * * * example: * ''' * console.log(isPlainObject(jsonObject)); // true * console.log(isPlainObject(instance)); // false * ''' * */ declare let isPlainObject: (obj: any) => boolean; /** * * @name isInstanceOfClass * @description * Combinaison pour différencier un JSON et une instance * @returns {boolean} * * * example: * ''' * console.log(isInstanceOfClass(instance)); // true (instance de classe) * console.log(isInstanceOfClass(jsonObject)); // false (objet JSON) * console.log(isInstanceOfClass(null)); // false * console.log(isInstanceOfClass([])); // false * ''' * */ declare let isInstanceOfClass: (obj: any) => boolean; /** * * @name isJsonObject * @description * Détection avancée : présence du constructeur * @param obj * @returns {boolean} * * example: * ''' * console.log(isJsonObject(jsonObject)); // true * console.log(isJsonObject(instance)); // false * ''' * */ declare let isJsonObject: (obj: any) => boolean; /** * @name toBoolean * @param value * @returns {boolean} * * * exemples : * ``` * console.log(toBoolean(true)); // true * console.log(toBoolean(false)); // false * console.log(toBoolean(1)); // true * console.log(toBoolean(0)); // false * console.log(toBoolean("Hello")); // true * console.log(toBoolean("false")); // false * console.log(toBoolean("False")); // false * console.log(toBoolean(" FaLsE ")); // false * console.log(toBoolean("")); // false * console.log(toBoolean(null)); // false * console.log(toBoolean(undefined)); // false * ``` */ declare function toBoolean(value: any): boolean; /** * @name setTimeoutPromised * @description * function to wait for milliseconds and return a resolved promise. * @param {number} timeOutMs milliseconds to wait. * @returns {Promise} */ declare let setTimeoutPromised: (timeOutMs: number) => Promise; /** * @name pause * @description * function to wait for milliseconds and return a resolved promise. * @param {number} timeOutMs milliseconds to wait. * @returns {Promise} */ declare let pause: (timeOutMs: number) => Promise; declare function pauseSync(milliseconds: number): void; /** * @name until * @description * function to wait for a condition for a few time before it is resolved of rejected. * To be used with asynchrone function : * myFunction() is the code using until function. * * async function myFunction(number) { * let x=number; * ... more initializations * * await until(_ => flag == true); * ... * ... do something when until is resolved/rejected * } * * @param conditionFunction * @param labelOfWaitingCondition * @param waitMsTimeBeforeReject * @returns {Promise} */ declare function until(conditionFunction: Function, labelOfWaitingCondition: string, waitMsTimeBeforeReject?: number): Promise; declare function doWithinInterval({ promise, timeout, error }: { promise: any; timeout: any; error: any; }): Promise; declare function orderByFilter(originalArray: any, filterFct: any, flag: any, sortFct: any): any[]; declare function addDaysToDate(date: any, days: any): Date; declare function addParamToUrl(urlParams: Array, paramName: string, paramValue: any, addEmptyParam?: boolean): void; declare function addPropertyIfNotAlreadyExistToObj(objetToUpdate: Object, methodName: string, methodValue: any, addEmptyProperty?: boolean): void; declare function addPropertyToObj(objetToUpdate: Object, methodName: string, methodValue: any, addEmptyProperty?: boolean): void; declare function updatePropertyToObj(objetToUpdate: Object, methodName: string, methodValue: any, addEmptyProperty?: boolean): void; declare function updateObjectPropertiesFromAnOtherObject(dstObjectArray: number | any[], srcObject: { [x: string]: any; }): {}; declare function cleanEmptyMembersFromObject(objParams: Object): void; declare function isStart_upService(serviceoptions: any): boolean; declare function isStarted(_methodsToIgnoreStartedState?: Array): any; declare function logEntryExit(LOG_ID: any): any; /** * @private * @param avatarImg * @param maxWidth * @param maxHeight */ declare function resizeImage(avatarImg: any, maxWidth: any, maxHeight: any): Promise; /** * @private * @param image */ declare function getBinaryData(image: any): { type: any; data: Uint8Array; }; /** * * @param max The greater number which can be generated. If not defined the default value is 10. * @description * generate an integer number between 1 and max value param. * @return {number} Return an integer number between 1 and max value param. */ declare function getRandomInt(max: any): number; /** * @private * @description * Genere un code avec le format suivant : l'année + le mois + le jour + l'heure + les minutes + un nombre aléatoire sur 5 chiffres. * un code au format : * YYYYMMDDHHmm + un nombre aléatoire sur 5 chiffres * @returns {string} */ declare function genererCode(): string; declare function stackTrace(): any; declare function isPromise(x: any): any; declare function promiseState(p: any): Promise; declare function isString(variable: any): variable is string; declare const resolveDns: (cname: any) => Promise; declare function getJsonFromXML(xml: string): Promise; declare function getTextFromJSONProperty(property: any): string; declare function getAttrFromJSONObj(obj: any, name: any): any; declare function getAlternateMessageFromJSONObj(content: any): { message: any; type: string; }; declare function getValueFromVariable(variable: any, defaultValue: any): any; declare function getObjectFromVariable(variable: any): any; type JsonObject = { [key: string]: any; }; declare function getAllValuesFromPropInJSONByPropertyName(obj: JsonObject, propertyName: string, maxDepth?: number, cond?: (key: any, value: any, tabToSaveObjFound: any) => void): any[] | any; declare function findAllPropInJSONByPropertyName(obj: JsonObject, propertyName: string, maxDepth?: number, cond?: (key: any, value: any, tabToSaveObjFound: any) => void): any[] | any; declare function findAllPropInJSONByPropertyNameByXmlNS(obj: JsonObject, propertyName: string, xmlNsStr: string, maxDepth?: number): any; declare function safeJsonParse(str: any): any[]; declare function randomString(length: any, chars: any): string; declare function generateRamdomEmail(email: any): string; declare function callerName(): string; declare function functionName(functionPtr: any): any; declare function functionSignature(functionPtr: any): string; declare function traceExecutionTime(thisToUse: any, methodName: any, methodDefinition: any, parameters?: any): Promise; /** * convert time in milliseconds to hours, minutes ands seconds in human readable time. * @param {number} duration in milliseconds * @returns {string} time */ declare function msToTime(duration: number): string; /** * @description * Voici une fonction TypeScript qui transforme un objet JSON avec une arborescence en un objet JSON plat : * Cette fonction prend en paramètre un objet JSON obj et une chaîne parentKey (optionnelle, par défaut vide) qui est utilisée pour conserver le chemin dans l'objet JSON plat résultant. * Elle parcourt récursivement l'objet JSON d'entrée et construit l'objet JSON plat en combinant les clés parentes avec les clés enfants séparées par des points. */ declare function flattenObject(obj: any, parentKey?: string, withparentKey?: boolean): any; declare function formattStringOnNbChars(variableString: any, nbChars?: number): any; declare function loadConfigFromIniFile(): any; declare function saveConfigFromIniFile(config: any): void; declare function writeArrayToFile(array: Array, path: string): void; declare function readArrayFromFile(path: string): any; declare function findPackageJson(startDir: string): string | null; declare function getStoreStanzaValue(storeMessages: boolean, messagesDataStore: DataStoreType, p_messagesDataStore: DataStoreType): string; export declare let objToExport: { makeId: (n: any) => string; createPassword: (size: any) => string; isAdmin: (roles: any) => boolean; anonymizePhoneNumber: (number: any) => any; equalIgnoreCase: (s1: string, s2: string) => boolean; isNullOrEmpty: (value: any) => boolean; isObject: (value: any) => boolean; isDefined: (value: any) => boolean; isDefinedAndNotEmpty: (value: any) => boolean; isNotDefined: (value: any) => boolean; isNotDefinedOrEmpty: (value: any) => boolean; isNumber: (data: any) => boolean; isString: typeof isString; isPlainObject: (obj: any) => boolean; isInstanceOfClass: (obj: any) => boolean; isJsonObject: (obj: any) => boolean; toBoolean: typeof toBoolean; Deferred: typeof Deferred; isSuperAdmin: (roles: any) => boolean; setTimeoutPromised: (timeOutMs: number) => Promise; until: typeof until; orderByFilter: typeof orderByFilter; updateObjectPropertiesFromAnOtherObject: typeof updateObjectPropertiesFromAnOtherObject; isStart_upService: typeof isStart_upService; isStarted: typeof isStarted; logEntryExit: typeof logEntryExit; resizeImage: typeof resizeImage; getBinaryData: typeof getBinaryData; getRandomInt: typeof getRandomInt; genererCode: typeof genererCode; pause: (timeOutMs: number) => Promise; pauseSync: typeof pauseSync; stackTrace: typeof stackTrace; addDaysToDate: typeof addDaysToDate; addParamToUrl: typeof addParamToUrl; cleanEmptyMembersFromObject: typeof cleanEmptyMembersFromObject; resolveDns: (cname: any) => Promise; isPromise: typeof isPromise; promiseState: typeof promiseState; doWithinInterval: typeof doWithinInterval; addPropertyIfNotAlreadyExistToObj: typeof addPropertyIfNotAlreadyExistToObj; addPropertyToObj: typeof addPropertyToObj; updatePropertyToObj: typeof updatePropertyToObj; generateRamdomEmail: typeof generateRamdomEmail; randomString: typeof randomString; getJsonFromXML: typeof getJsonFromXML; getTextFromJSONProperty: typeof getTextFromJSONProperty; getAttrFromJSONObj: typeof getAttrFromJSONObj; getAlternateMessageFromJSONObj: typeof getAlternateMessageFromJSONObj; getValueFromVariable: typeof getValueFromVariable; getObjectFromVariable: typeof getObjectFromVariable; getAllValuesFromPropInJSONByPropertyName: typeof getAllValuesFromPropInJSONByPropertyName; findAllPropInJSONByPropertyName: typeof findAllPropInJSONByPropertyName; findAllPropInJSONByPropertyNameByXmlNS: typeof findAllPropInJSONByPropertyNameByXmlNS; callerName: typeof callerName; functionName: typeof functionName; functionSignature: typeof functionSignature; traceExecutionTime: typeof traceExecutionTime; msToTime: typeof msToTime; flattenObject: typeof flattenObject; formattStringOnNbChars: typeof formattStringOnNbChars; loadConfigFromIniFile: typeof loadConfigFromIniFile; saveConfigFromIniFile: typeof saveConfigFromIniFile; safeJsonParse: typeof safeJsonParse; writeArrayToFile: typeof writeArrayToFile; readArrayFromFile: typeof readArrayFromFile; findPackageJson: typeof findPackageJson; getStoreStanzaValue: typeof getStoreStanzaValue; }; export { makeId, createPassword, isAdmin, anonymizePhoneNumber, equalIgnoreCase, isNullOrEmpty, isObject, isDefined, isDefinedAndNotEmpty, isNotDefined, isNotDefinedOrEmpty, isNumber, isString, isPlainObject, isInstanceOfClass, isJsonObject, toBoolean, Deferred, isSuperAdmin, setTimeoutPromised, until, orderByFilter, updateObjectPropertiesFromAnOtherObject, isStart_upService, isStarted, logEntryExit, resizeImage, getBinaryData, getRandomInt, genererCode, pause, pauseSync, stackTrace, addDaysToDate, addParamToUrl, cleanEmptyMembersFromObject, resolveDns, isPromise, promiseState, doWithinInterval, addPropertyIfNotAlreadyExistToObj, addPropertyToObj, updatePropertyToObj, generateRamdomEmail, randomString, getJsonFromXML, getTextFromJSONProperty, getAttrFromJSONObj, getAlternateMessageFromJSONObj, getValueFromVariable, getObjectFromVariable, getAllValuesFromPropInJSONByPropertyName, findAllPropInJSONByPropertyName, findAllPropInJSONByPropertyNameByXmlNS, callerName, functionName, functionSignature, traceExecutionTime, msToTime, flattenObject, formattStringOnNbChars, loadConfigFromIniFile, saveConfigFromIniFile, safeJsonParse, writeArrayToFile, readArrayFromFile, findPackageJson, getStoreStanzaValue }; declare const _default: { makeId: (n: any) => string; createPassword: (size: any) => string; isAdmin: (roles: any) => boolean; anonymizePhoneNumber: (number: any) => any; equalIgnoreCase: (s1: string, s2: string) => boolean; isNullOrEmpty: (value: any) => boolean; isObject: (value: any) => boolean; isDefined: (value: any) => boolean; isDefinedAndNotEmpty: (value: any) => boolean; isNotDefined: (value: any) => boolean; isNotDefinedOrEmpty: (value: any) => boolean; isNumber: (data: any) => boolean; isString: typeof isString; isPlainObject: (obj: any) => boolean; isInstanceOfClass: (obj: any) => boolean; isJsonObject: (obj: any) => boolean; toBoolean: typeof toBoolean; Deferred: typeof Deferred; isSuperAdmin: (roles: any) => boolean; setTimeoutPromised: (timeOutMs: number) => Promise; until: typeof until; orderByFilter: typeof orderByFilter; updateObjectPropertiesFromAnOtherObject: typeof updateObjectPropertiesFromAnOtherObject; isStart_upService: typeof isStart_upService; isStarted: typeof isStarted; logEntryExit: typeof logEntryExit; resizeImage: typeof resizeImage; getBinaryData: typeof getBinaryData; getRandomInt: typeof getRandomInt; genererCode: typeof genererCode; pause: (timeOutMs: number) => Promise; pauseSync: typeof pauseSync; stackTrace: typeof stackTrace; addDaysToDate: typeof addDaysToDate; addParamToUrl: typeof addParamToUrl; cleanEmptyMembersFromObject: typeof cleanEmptyMembersFromObject; resolveDns: (cname: any) => Promise; isPromise: typeof isPromise; promiseState: typeof promiseState; doWithinInterval: typeof doWithinInterval; addPropertyIfNotAlreadyExistToObj: typeof addPropertyIfNotAlreadyExistToObj; addPropertyToObj: typeof addPropertyToObj; updatePropertyToObj: typeof updatePropertyToObj; generateRamdomEmail: typeof generateRamdomEmail; randomString: typeof randomString; getJsonFromXML: typeof getJsonFromXML; getTextFromJSONProperty: typeof getTextFromJSONProperty; getAttrFromJSONObj: typeof getAttrFromJSONObj; getAlternateMessageFromJSONObj: typeof getAlternateMessageFromJSONObj; getValueFromVariable: typeof getValueFromVariable; getObjectFromVariable: typeof getObjectFromVariable; getAllValuesFromPropInJSONByPropertyName: typeof getAllValuesFromPropInJSONByPropertyName; findAllPropInJSONByPropertyName: typeof findAllPropInJSONByPropertyName; findAllPropInJSONByPropertyNameByXmlNS: typeof findAllPropInJSONByPropertyNameByXmlNS; callerName: typeof callerName; functionName: typeof functionName; functionSignature: typeof functionSignature; traceExecutionTime: typeof traceExecutionTime; msToTime: typeof msToTime; flattenObject: typeof flattenObject; formattStringOnNbChars: typeof formattStringOnNbChars; loadConfigFromIniFile: typeof loadConfigFromIniFile; saveConfigFromIniFile: typeof saveConfigFromIniFile; safeJsonParse: typeof safeJsonParse; writeArrayToFile: typeof writeArrayToFile; readArrayFromFile: typeof readArrayFromFile; findPackageJson: typeof findPackageJson; getStoreStanzaValue: typeof getStoreStanzaValue; }; export default _default;