/********************************************************************
 * @author:      Kaven
 * @email:       kaven@wuwenkai.com
 * @website:     http://kavenblog.com
 * @file:        [Kaven-Basic] /src/libs/Extensions.ts
 * @create:      2019-04-25 12:45:36.310
 * @modify:      2019-04-25 12:45:45.659
 * @version:     1.1.21
 * @times:       2
 * @lines:       1179
 * @copyright:   Copyright © 2019 Kaven. All Rights Reserved.
 * @description: [description]
 * @license:
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 ********************************************************************/
import { TimeUnit } from "./Enums";
import { StringPosition } from "./StringPosition";
declare global {
    interface Date {
        /**
         * @version 1.0.0
         * @since 1.0.5
         * @see https://momentjs.com/docs/
         */
        Format(format?: string): string;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddMilliseconds(ms: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddSeconds(seconds: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddMinutes(minutes: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddHours(hours: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddDays(days: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddWeeks(weeks: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddMonths(months: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddQuarters(quarters: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        AddYears(years: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractMilliseconds(ms: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractSeconds(seconds: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractMinutes(minutes: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractHours(hours: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractDays(days: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractWeeks(weeks: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractMonths(months: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractQuarters(quarters: number): Date;
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        SubtractYears(years: number): Date;
        /**
         * @version 2018-08-18 16:21:20.512
         * @since 1.1.5
         */
        DiffMilliseconds(anotherDate: Date): number;
        /**
         * @version 2018-08-18 16:21:20.512
         * @since 1.1.5
         */
        DiffMonths(anotherDate: Date): number;
        /**
         * @version 2018-08-18 16:21:20.512
         * @since 1.1.5
         */
        DiffYears(anotherDate: Date): number;
    }
    interface DateConstructor {
        /**
         * @version 2018-08-18 15:49:37.293
         * @since 1.1.5
         */
        Create(): Date;
    }
    interface Console {
        /**
         *
         * @param message
         * @param optionalParams
         * @version 1.0.0
         * @since 1.0.5
         */
        logOrigin(message?: any, ...optionalParams: any[]): void;
        /**
         *
         * @param message
         * @param optionalParams
         * @version 1.0.0
         * @since 1.0.5
         */
        infoOrigin(message?: any, ...optionalParams: any[]): void;
        /**
         *
         * @param message
         * @param optionalParams
         * @version 1.0.0
         * @since 1.0.5
         */
        warnOrigin(message?: any, ...optionalParams: any[]): void;
        /**
         *
         * @param message
         * @param optionalParams
         * @version 1.0.0
         * @since 1.0.5
         */
        errorOrigin(message?: any, ...optionalParams: any[]): void;
    }
    interface String {
        /**
         *
         * @param old
         * @param rep
         * @version 1.0.0
         * @since 1.0.5
         */
        ReplaceAll(old: string, rep: string): string;
        /**
         *
         * @param index
         * @param rep
         * @version 1.0.0
         * @since 1.0.5
         */
        ReplaceAt(index: number, rep: string, length?: number): string;
        /**
         *
         * @param pos
         * @since 1.1.7
         * @version 2018-09-01
         */
        ReplaceAtPos(pos: StringPosition, rep: string): string;
        /**
         *
         * @param trim
         * @version 2018-08-31
         * @since 1.0.5
         */
        TrimStart(trim: string, max?: number): string;
        /**
         *
         * @param trim
         * @version 2018-08-31
         * @since 1.0.5
         */
        TrimEnd(trim: string, max?: number): string;
        /**
         *
         * @param trim
         * @param max
         * @since 1.1.7
         * @version 2018-08-31
         */
        TrimAll(trim: string, max?: number): string;
        /**
         * @version 1.0.0
         * @since 1.0.5
         */
        IsNotEmpty(): boolean;
        /**
         *
         *
         * @returns {boolean}
         * @memberof String
         * @version 1.0.0
         * @since 1.1.1
         */
        IsEmpty(): boolean;
        /**
         *
         * @param targetLength
         * @param padString
         * @version 1.0.0
         * @since 1.0.5
         */
        padStart(targetLength: number, padString?: string): string;
        /**
         *
         * @param searchString
         * @param length
         * @version 1.0.0
         * @since 1.0.5
         */
        endsWith(searchString: string, length?: number): boolean;
        /**
         *
         *
         * @returns {string}
         * @memberof String
         * @version 1.0.0
         * @since 1.0.10
         */
        GetIndent(): string;
        /**
         *
         *
         * @param {*} characters
         * @returns {boolean}
         * @memberof String
         * @version 1.0.0
         * @since 1.0.12
         */
        OnlyContains(...characters: string[]): boolean;
        /**
         *
         * @param substrings
         * @version 1.1.10
         * @since 2018-10-15
         */
        ContainsSubstringOnlyOnce(...substrings: string[]): boolean;
        /**
         *
         * @param characters
         * @version 1.1.10
         * @since 2018-10-15
         */
        CharactersCount(...characters: string[]): number;
        /**
         *
         *
         * @returns {string[]}
         * @memberof String
         * @version 1.0.0
         * @since 1.0.12
         */
        ToArray(): string[];
        /**
         *
         *
         * @returns {string}
         * @memberof String
         * @version 1.0.0
         * @since 1.0.12
         */
        Distinct(): string;
        /**
         *
         * @param pos
         * @since 1.1.7
         * @version 2018-09-01
         */
        GetSubstring(pos: StringPosition): string;
        /**
         *
         * @since 1.1.16
         * @version 2018-11-15
         */
        CapitalizeSentences(): string;
        /**
         *
         * @since 1.1.16
         * @version 2018-11-15
         */
        CapitalizeWords(): string;
        /**
         * @since 1.1.20
         * @version 2019-03-30
         */
        UTF8Encode(): string;
        /**
         * @since 1.1.20
         * @version 2019-03-30
         */
        ToUTF8ByteArray(): number[];
        /**
         *
         * @param n
         * @param fromLeft
         * @since 1.1.20
         * @version 2019-04-01
         */
        SplitByN(n: number, fromLeft?: boolean): string[];
        /**
         * @since 1.1.20
         * @version 2019-04-03
         */
        Reverse(): string;
    }
    interface Array<T> {
        /**
         * @version 1.0.1
         * @since 1.0.5
         */
        IsNotEmpty(): boolean;
        /**
         *
         * @param index
         * @version 1.0.0
         * @since 1.0.5
         */
        Remove(index: number): T[];
        /**
         *
         *
         * @returns {Array<T>}
         * @memberof Array
         * @version 1.0.0
         * @since 1.0.7
         */
        Distinct(): T[];
        /**
         *
         *
         * @returns {T}
         * @memberof Array
         * @version 1.0.0
         * @since 1.0.12
         */
        First(): T | undefined;
        /**
         *
         *
         * @returns {T}
         * @memberof Array
         * @version 1.0.0
         * @since 1.0.12
         */
        Last(): T | undefined;
        /**
         *
         * @param size
         * @param fromLeft
         * @since 1.1.20
         * @version 2019-04-02
         */
        Split(size: number, fromLeft?: boolean): T[][];
        /**
         * @since 1.1.20
         * @version 2019-04-05
         */
        ToHEX<T = number>(): string;
    }
    interface Number {
        ToMilliseconds(currentUnit: TimeUnit): number;
        ToSeconds(currentUnit: TimeUnit): number;
        ToMinutes(currentUnit: TimeUnit): number;
        ToHours(currentUnit: TimeUnit): number;
        ToDays(currentUnit: TimeUnit): number;
        ToWeeks(currentUnit: TimeUnit): number;
        ToMonths(currentUnit: TimeUnit): number;
        ToYears(currentUnit: TimeUnit): number;
        /**
         * Rotates left (circular left shift) value by n positions
         * @param value
         * @param n
         * @since 1.1.20
         * @version 2019-03-30
         */
        LeftRotate(n: number, bits?: number): number;
        RightRotate(n: number, bits?: number): number;
        ToUInt32(): number;
        /**
         *
         * @param bits
         * @since 1.1.20
         * @version 2019-04-05
         */
        Swap32(bits?: number): number;
        /**
         * @since 1.1.20
         * @version 2019-04-05
         */
        ToHEX(): string;
        /**
         *
         * @param baseNumber
         * @since 1.1.20
         * @version 2019-04-06
         */
        GetBaseLog(baseNumber: number): number;
        /**
         *
         * @example 11 mod 5=1, and -11 mod 5=4.
         * @param n
         * @since 1.1.20
         * @version 2019-04-08
         */
        Mod(n: number): number;
    }
}
export {};
//# sourceMappingURL=Extensions.d.ts.map