export interface StartCaseOptions { /** * Should insert a space before digit present in string. E.g. "every10Month" => "Every 10 Month" */ insertSpaceBeforeDigits?: boolean; /** * Should insert a space after digit present in string. E.g. "calculate10e" => "Calculate 10 e" */ insertSpaceAfterDigits?: boolean; /** * Should insert a space before abbreviation present in string. E.g. "FaceID" => "Face ID" */ insertSpaceBeforeAbbreviations?: boolean; /** * Should make single letter part present in string. E.g. "pH" => "PH" */ capitalizeSingleLetters?: boolean; } declare global { interface StartCaseOptions { /** * Should insert a space before digit present in string. E.g. "every10Month" => "Every 10 Month" */ insertSpaceBeforeDigits?: boolean; /** * Should insert a space after digit present in string. E.g. "calculate10e" => "Calculate 10 e" */ insertSpaceAfterDigits?: boolean; /** * Should insert a space before abbreviation present in string. E.g. "FaceID" => "Face ID" */ insertSpaceBeforeAbbreviations?: boolean; /** * Should make single letter part present in string. E.g. "pH" => "PH" */ capitalizeSingleLetters?: boolean; } interface String { trim(this: string, charList?: string): string; trimStart(this: string, charList?: string): string; trimEnd(this: string, charList?: string): string; toStartCase(this: string, options?: StartCaseOptions): string; } interface Dictionary { [index: string]: T; } interface Group { key: TKey; items: TValue[]; } interface FormData { fromObject(data: { [key: string]: File | File[] | any; }): FormData; } interface Date { /** * Returns zero-based index of day of week assuming that week starts with Monday * * @param this * @returns Local date without changing time */ getDayOfWeek(this: Date): number; /** * Date wont provide Timezone information during serialization. * * @example * new Date("2020-01-01T00:00:00.000+02:00").toJSON(); // returns "2019-12-31T22:00:00.000Z" * new Date("2020-01-01T00:00:00.000+02:00").withoutTimezone().toJSON(); // returns "2020-01-01T00:00:00.000" * * @param this * @returns UTC date keeping local time */ withoutTimezone(this: Date): Date; /** * Converts local date to UTC date keeping local time * * @param this * @returns UTC date keeping local time */ asUtcDate(this: Date): Date; /** * Converts local date to UTC date with shifted local time * * @param this * @returns UTC date with shifted local time */ toUtcDate(this: Date): Date; /** * Converts UTC date to local date without changing time * * @param this * @returns Local date without changing time */ asLocalDate(this: Date): Date; } function nameOf(func: Func | Class): string; function nameOfFull(func: Func): string; } export declare type Func = (obj: T) => any; export declare type Class = new (...params: any[]) => T; export declare function nameOf(func: Func | Class): string; export declare function nameOfFull(func: Func): string; declare type FunctionLike = (...args: any) => any; export declare function overrideFunction(context: TIntance, funcProvider: (instance: TIntance) => TFunc, newFunc: (originalFunc: TFunc, functionContext: TIntance, ...args: Parameters) => ReturnType): void; export declare function overrideProperty(context: TIntance, propertyProvider: (instance: TIntance) => TProp, propertyConfig: { get?: (originalProperty: TProp, propertyContext: TIntance) => TProp; set?: (originalProperty: ((value: TProp) => void) | null, propertyContext: TIntance, value: TProp) => void; }): void; export declare function isValidDateString(date: string): boolean; export declare function parseDates(model: any, excludePaths?: RegExp[]): void; export declare function parseDateProperty(object: T, prop: keyof T): void; /** * Date wont provide Timezone information during serialization. * * @example * new Date("2020-01-01T00:00:00.000+02:00").toJSON(); // returns "2019-12-31T22:00:00.000Z" * new Date("2020-01-01T00:00:00.000+02:00").withoutTimezone().toJSON(); // returns "2020-01-01T00:00:00.000" * * @param this * @returns UTC date keeping local time */ export declare function withoutTimezone(this: Date): Date; /** * Converts local date to UTC date keeping local time * * @param this * @returns UTC date keeping local time */ export declare function asUtcDate(this: Date): Date; /** * Converts local date to UTC date with shifted local time * * @param this * @returns UTC date with shifted local time */ export declare function toUtcDate(this: Date): Date; /** * Converts UTC date to local date without changing time * * @param this * @returns Local date without changing time */ export declare function asLocalDate(this: Date): Date; /** * Returns zero-based index of day of week assuming that week starts with Monday * * @param this * @returns Local date without changing time */ export declare function getDayOfWeek(this: Date): number; export declare function trim(this: string, charlist?: string): string; export declare function trimStart(this: string, charlist?: string): string; export declare function trimEnd(this: string, charlist?: string): string; export declare function handleError(action: () => any): void; export declare function formDataFromObject(this: FormData, data: { [key: string]: File | File[] | any; }): FormData; export declare function toStartCase(this: string, options?: StartCaseOptions): string; export {};