interface ClassInfo { resolver?: (props: Record) => Function; } interface PropertyInfo { type?: Function; indexed?: boolean; aliases?: string[]; } declare class Builder { /** * Creates new instance of `T` class. * @param props properties to pass to the constructor of the instance. * @returns new instance of `T` */ static create(props: Partial): T; save(): Record; with(props: Partial): T; } declare function Entity(info?: ClassInfo): ClassDecorator; declare function Property(info?: PropertyInfo): PropertyDecorator; declare function rgbFromHex(color: string): { r: number; g: number; b: number; }; declare function rgbToHex(r: number, g: number, b: number): string; declare function colorContrast(color: string): "black" | "white"; declare function colorTint(color: string, factor?: number): string; declare function colorShade(color: string, factor?: number): string; declare function deepEqual(a: any, b: any): boolean; declare function ensuresNonNull(value?: T, message?: string): value is T; declare function ensuresNonNullArray(value?: T[], message?: string): value is T[]; declare function ensuresNonNullString(value?: string, message?: string): value is string; declare function ensures(condition: any, message?: string): asserts condition; declare function deepCopy(obj: T): T; declare function epoch(): Date; declare function addDays(date: Date, days: number): Date; /** Gets current value of unix timestamp */ declare function timestamp(): number; /** * Gets unix timestamp value of `date` * @param date the date. */ declare function toTimestamp(date: Date): number; /** * Converts an unix timestamp to a Date object * @param time an unix timestamp */ declare function dateFromTimestamp(time: number): Date; /** * Converts an unix timestamp to a date in the format 'day month hours mins' * @param time an unix timestamp. * @param locale target language locale tag. * @returns string representation of the date. */ declare function fullDate(time: number, locale?: string): string; /** * Converts an unix timestamp to a date in the format 'day month' * @param time an unix timestamp. * @param locale target language locale tag. * @returns string representation of the date. */ declare function shortDate(time: number, locale?: string): string; /** * Converts an unix timestamp to a date in the format 'hours mins' * @param time an unix timestamp. * @returns string representation of the date. */ declare function hours(time: number): string; /** * Gets a value indicating whether the timestamp is today. * @param time an unix timestamp. */ declare function isToday(time: number): boolean; /** * Gets a value indicating whether the given dates representes the same year, month and day. * @param d1 the first date. * @param d2 the second date. */ declare function compareDays(d1: Date, d2: Date): boolean; declare function convertDate(time: number, format: Intl.DateTimeFormatOptions, locale?: string): string; declare function weeksDiff(d1: Date, d2: Date): number; declare function dateRangeOverlaps(a_start: Date, a_end: Date, b_start: Date, b_end: Date): boolean; declare function isImage(extension: string): boolean; declare function isPdf(extension: string): boolean; declare function isWordDoc(extension: string): boolean; declare function isText(extension: string): boolean; declare function isExcelDoc(extension: string): boolean; declare function isPowerPointDoc(extension: string): boolean; /** * Gets the extension of the file (without the dot '.'). * Throws an exception if the file is undefined. * @param file the file * @returns the extension of the file. */ declare function extensionOf(file: File | Blob): string; declare function isNullOrEmpty(text: string): boolean; declare function anyNullOrEmpty(...args: string[]): boolean; declare const urlPattern: string; declare function isURL(str: string): boolean; declare function hashCode(str: string): number; export { Builder, Entity, Property, addDays, anyNullOrEmpty, colorContrast, colorShade, colorTint, compareDays, convertDate, dateFromTimestamp, dateRangeOverlaps, deepCopy, deepEqual, ensures, ensuresNonNull, ensuresNonNullArray, ensuresNonNullString, epoch, extensionOf, fullDate, hashCode, hours, isExcelDoc, isImage, isNullOrEmpty, isPdf, isPowerPointDoc, isText, isToday, isURL, isWordDoc, rgbFromHex, rgbToHex, shortDate, timestamp, toTimestamp, urlPattern, weeksDiff };