UNPKG

radius-read

Version:

Realtime Dashboard

59 lines (58 loc) 1.89 kB
import express from "express"; /** * UtilService is a utility service class that provides various helper methods for data manipulation and formatting. */ export declare class UtilService { /** * Creates an instance of UtilService. */ constructor(); /** * Gets a unique array of objects based on a specified property. * @param arrayObject * @param property * @returns */ static getUniqueArray(arrayObject: any | undefined, property: any): any[]; /** * Sorts an array of objects by a specified property in ascending order. * @param arrayObject * @param property * @returns */ static sortByProperty(arrayObject: any | undefined, property: any): any; /** * Sorts an array of objects by date in ascending order based on a specified property. * @param arrayObject * @param property * @returns */ static sortAscByDate(arrayObject: any | undefined, property: any): any; /** * Sorts an array of objects by date in descending order based on a specified property. * @param arrayObject * @param property * @returns */ static sortDescByDate(arrayObject: any | undefined, property: any): any; /** * Gets the duration between two dates in the format "HH:mm:ss" or "mm:ss" if hours are zero. * @param fromDate * @param toDate * @returns */ static getDuration(fromDate: any, toDate: any): string; /** * Gets the base URL for Socket.IO connections based on the provided port and SSL status. * @param port * @param isSSL * @returns */ static getSocketIoBaseURL(port: any, isSSL: boolean): string; /** * Gets the Bearer token from the Authorization header of an Express request. * @param req * @returns */ static getBearerToken(req: express.Request): string | null; }