export default class Helper { /** * Check if given date is not null, casts to date format * @return YYYY-MM-DD */ static parseDate(date: string): string | null; /** * Check if given date time is not null, casts to date time format * @return YYYY-MM-DD HH:mm:ss */ static parseDateTime(date: string): string | null; /** * Get current date time * @return YYYY-MM-DD HH:mm:ss */ static getCurrentDateTime(): string; /** * Die and dump */ static dd(...params: any): void; /** * Dump */ static dump(...params: any): void; /** * Sleep amount of milliseconds */ static sleep(milliseconds: number): Promise; /** * Path to the project with ending slash * @return e.g. /tmp/myproject/ */ static projectPath(): string; /** * Path to the storage with ending slash * @return e.g. /tmp/myproject/storage/ */ static storagePath(): string; /** * Pluck fields from object or from array of objects * @return object or array with needed fields * * @example * Helper.pluckMany([{name: 'alex', age: 10}, {name: 'sharon', age: 11}], ['age']) -> [{age: 10}, {age: 11}] * * @example * Helper.pluckMany({name: 'igor', age: 33, birthday: 'foobar'}, ['age', 'birthday']) -> {age: 33, birthday: 'foobar'} */ static pluckMany(collection: unknown, fields: string[]): unknown; /** * Start profiling * Creates a time measurement label */ static timeMeasurementLabel: number; static startProfiling(): void; /** * Stop profiling * Displays past time after last startProfiling method call */ static stopProfiling(): void; /** * Paginate any array with data * @return part of array on specific page and size */ static paginateArray(data: any[], page: number, pageSize: number): any[]; /** * Assemble pagination * @return pagination object */ static assemblePagination(data: any[], page: number, pageSize: number): { page: number; pageSize: number; totalPages: number; totalElements: number; }; }