import { Moment } from 'moment-timezone'; import { IAvvenimento, Avvenimento } from '../model'; /** * @param functionToCheck the object to check. * @return true if `functionToCheck` is a function * @example * ```typescript * const check = isFunction(()=>)); * ``` */ export declare function isFunction(functionToCheck: any): any; /** * @param array array of promises. * @param callback callback for each promise. * @return true if `functionToCheck` is a function * @example * ```typescript * const collection = [promise1, promise2]; * * let documents: any = []; * await asyncForEach(collection, (docs: any) => { * documents = [...documents, ...docs]; * }); * return documents; * ``` */ export declare function asyncForEach(array: any[], callback: any): Promise; /** * @param date any. * @return instance of {@link moment.Moment} moment * now() is provided when data is unparsable. * the {@link firebase.firestoreTimestamp.toDate()} when `date` is {@link firebase.firestoreTimestamp} * @example * ```typescript * const res = convertToMoment(new Date()); * const res = convertToMoment('20201212 12:00'); * const res = convertToMoment(firestoreTimestamp); * ``` */ export declare function convertToMoment(date?: any): Moment | null; /** * @param array array of any. * @return flattened array * @example * ```typescript * const array = [[1,2],[3,4]] * const res = flattenArray(array); * * # output * [1,2,3,4] * ``` */ export declare function flattenArray(array: any[]): never[]; /** * @return x.betradar_id || x.event_id; */ export declare const getIdOfAvvenimento: (x: IAvvenimento) => string; export declare const getUrlOfAvvenimento: (leagueUrl: string, uid: string) => string; /** * @return list of leagues * @example * ```typescript * leagues = Crawler.splitByServerIndex(data); * * ``` */ export declare function splitByServerIndex(array: any[]): any[]; export declare function shuffle(array: any[]): any[]; export declare var groupBy: (xs: any, key: any) => any; export declare function isChanged(x: IAvvenimento, mapOfAvvenimenti: Map): boolean; export declare function keepPreviousMarket(x: IAvvenimento, mapOfAvvenimenti: Map): void; export declare function getCacheKey(url: string, x: Avvenimento): string;