/********************************************************************
 * @author:      Kaven
 * @email:       kaven@wuwenkai.com
 * @website:     http://kavenblog.com
 * @file:        [Kaven-Basic] /src/libs/KavenBasic.ts
 * @create:      2018-08-30 16:08:33.658
 * @modify:      2019-08-03 21:25:23.365
 * @version:     1.1.22
 * @times:       121
 * @lines:       1594
 * @copyright:   Copyright © 2018 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 { KavenSHA3 } from "./hashing_algorithms/KavenSHA3";
import { IMIME } from "./Interfaces";
import { StringPosition } from "./StringPosition";
export declare class KavenBasic {
    readonly SHA3: KavenSHA3;
    private readonly memoryCacheCollection;
    private readonly memoryCollection;
    /**
     *
     * @param name
     * @param value
     * @param absoluteExpiration
     * @version 1.0.0
     * @since 1.0.5
     */
    SetCacheWithDate(name: string, value: any, absoluteExpiration: Date): void;
    /**
     *
     * @param name
     * @param value
     * @param millisecond
     * @version 1.0.0
     * @since 1.0.5
     */
    SetCacheWithMilliseconds(name: string, value: any, millisecond: number): void;
    /**
     *
     * @param name
     * @param value
     * @param minute
     * @version 1.0.0
     * @since 1.0.5
     */
    SetCacheWithMinute(name: string, value: any, minute: number): void;
    /**
     *
     * @param name
     * @param value
     * @param hour
     * @version 1.0.0
     * @since 1.0.5
     */
    SetCacheWithHour(name: string, value: any, hour: number): void;
    /**
     *
     * @param name
     * @since 1.0.5
     * @version 2018-11-02
     */
    GetCache<T>(name: string): T | undefined;
    /**
     *
     * @param name
     * @param removeExpired
     * @since 1.0.5
     * @version 2018-11-02
     */
    RemoveCache(name?: string, removeExpired?: boolean): void;
    /**
     *
     * @param dt
     * @param format
     * @version 1.0.0
     * @since 1.0.5
     */
    FormatDate(dt?: Date, format?: string): string;
    /**
     * @version 1.0.0
     * @since 1.0.5
     */
    GetFileNameByDateTime(): string;
    /**
     * Module wrapper of @substack's `caller.js`
     * @original: https://github.com/substack/node-resolve/blob/master/lib/caller.js
     * @blessings: https://twitter.com/eriktoth/statuses/413719312273125377
     * @see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
     * @version 1.0.0
     * @since 1.0.5
     */
    GetStackInfo(depth?: number, type?: "getFileName" | "getFunctionName" | "getLineNumber"): any;
    /**
     * Returns a random number between min (inclusive) and max (exclusive)
     * @param min
     * @param max
     * @version 1.0.0
     * @since 1.0.5
     */
    GetRandomArbitrary(min: number, max: number): number;
    /**
     * Returns a random integer between min (inclusive) and max (inclusive)
     * Using Math.round() will give you a non-uniform distribution!
     * @param min
     * @param max
     * @version 1.0.0
     * @since 1.0.5
     */
    GetRandomInt(min: number, max: number): number;
    /**
     *
     * @param length
     * @version 1.0.0
     * @since 1.0.5
     */
    GenerateNumberString(length: number): string;
    /**
     * just for backward-compatible with earlier versions, recommend use {@link GenerateYearMonthIdAsync} instead
     * @param randomLength
     * @param validFunc
     * @param ignoreIDs
     * @param candidatesGUID
     * @version 1.0.0
     * @since 1.0.1
     * @example
     */
    GenerateYearMonthId(randomLength?: number, validFunc?: (id: string) => boolean, ignoreIDs?: string[], candidatesGUID?: string): string;
    /**
     *
     * @param randomLength
     * @param validFunc
     * @param ignoreIDs
     * @param candidatesGUID
     * @version 1.0.0
     * @since 1.0.5
     */
    GenerateYearMonthIdAsync(randomLength?: number, validFunc?: (id: string) => Promise<boolean>, ignoreIDs?: string[], candidatesGUID?: string): Promise<string>;
    /**
     * @version 1.0.0
     * @since 1.0.5
     */
    GenerateGuid(): string;
    /**
     *
     * @param length
     * @param validCharacters
     * @version 1.0.0
     * @since 1.0.5
     */
    GenerateRandomString(length: number, validCharacters?: string): string;
    /**
     *
     * @param length
     * @param numbers
     * @param lowercaseLetters
     * @param uppercaseLetters
     * @param specialCharacters
     * @version 1.0.0
     * @since 1.0.5
     */
    GeneratePassword(length: number, numbers?: boolean, lowercaseLetters?: boolean, uppercaseLetters?: boolean, specialCharacters?: boolean): string;
    /**
     *
     * @param func
     * @param times
     * @version 1.0.0
     * @since 1.0.5
     */
    RunTest(func: () => void, times: number): void;
    /**
     * @version 1.0.0
     * @since 1.0.5
     */
    RandomBoolean(): boolean;
    /**
     * @version 1.0.0
     * @since 1.0.5
     * @example C:/a/b/c  return C:/a/b
     */
    GetBaseDir(pathStr: string): string;
    /**
     *
     * @param fileName
     * @version 1.0.0
     * @since 1.0.5
     * @example "c:/a/b.xyz" => "xyz"
     */
    GetFileExtension(fileName: string): string;
    /**
     *
     * @param fileName
     * @since 1.1.7
     * @version 2018-08-31
     * @example "c:/a/b.xyz" => "b"
     */
    GetFileNameWithoutExtension(fileName: string): string;
    /**
     *
     * @param fileName
     * @version 2018-08-31
     * @since 1.0.5
     * @example
     * "c:/a/b.xyz" => "b.xyz"
     * "b.xyz" => "b.xyz"
     */
    GetFileName(fileName: string): string;
    /**
     *
     * @param fileName
     * @param extension
     * @version 2018-08-31
     * @since 1.0.5
     */
    ChangeFileExtension(fileName: string, extension: string): string;
    /**
     *
     * @param name
     * @param value
     * @version 1.0.0
     * @since 1.0.5
     */
    SetValue(name: string, value: any): void;
    /**
     *
     * @param name
     * @param defaultValueIfNotExist
     * @version 1.0.0
     * @since 1.0.5
     */
    GetValue<T>(name: string, defaultValueIfNotExist?: T): T | undefined;
    /**
     *
     * @param name
     * @version 1.0.0
     * @since 1.0.5
     */
    RemoveValue(name: string): void;
    /**
     *
     * @param obj
     * @version 1.0.0
     * @since 1.0.5
     */
    RemoveEmpty(obj: {}): {};
    /**
     *
     * @param obj
     * @version 1.0.0
     * @since 1.0.5
     */
    SortByKey(obj: {}): {};
    /**
     *
     * @param length
     * @param start
     * @param step
     * @version 1.0.0
     * @since 1.0.5
     */
    CreateArray(length: number, start: number, step?: number): number[];
    /**
     *
     *
     * @export
     * @param {string} str
     * @param {string} strStart
     * @param {string} strEnd
     * @returns
     * @version 2018-09-01
     * @since 1.0.6
     */
    GetStringBetween(str: string, strStart: string, strEnd: string, max?: number): string[];
    /**
     * @param {string} str
     * @param {string} strStart
     * @param {string} strEnd
     * @returns
     * @version 2018-09-02
     * @since 1.1.7
     */
    GetStringPositionBetween(str: string, strStart: string, strEnd: string, max?: number, startIndex?: number): StringPosition[];
    /**
     *
     * @param replaceMethod
     * @param str
     * @param strStart
     * @param strEnd
     * @since 1.1.7
     * @version 2018-09-01
     */
    ReplaceAllStringBetween(replaceMethod: (val: string) => string, str: string, strStart: string, strEnd: string): string;
    /**
     *
     *
     * @export
     * @param {string} str
     * @returns
     * @version 2019-03-21
     * @since 1.0.8
     */
    SplitStringByNewline(str: string): string[] | undefined;
    /**
     *
     * @param pathStr
     * @version 1.0.0
     * @since 1.0.9
     */
    RemoveInvalidCharactersForPath(pathStr: string): string;
    /**
     *
     *
     * @export
     * @param {string} version
     * @returns
     * @version 1.0.0
     * @since 1.0.12
     */
    GetNextVersion(version: string): string | number | undefined;
    /**
     *
     *
     * @export
     * @param {string} camelCaseStr
     * @version 1.0.0
     * @since 1.1.1
     * @see {@link https://stackoverflow.com/questions/7225407/convert-camelcasetext-to-sentence-case-text}
     */
    SplitCamelCaseString(camelCaseStr: string): string;
    /**
     *
     * @param action
     * @param timeout
     * @param retryCount
     * @param startImmediately
     * @version 2018-08-19 14:03:00.932
     * @since 1.1.5
     */
    DoUntilSuccess(action: () => boolean, timeout?: number, retryCount?: number, startImmediately?: boolean): void;
    /**
     *
     * @param action
     * @param count
     * @param interval
     * @param completeAction
     * @version 2018-08-19 15:59:52.369
     * @since 1.1.5
     */
    Countdown(action: (left?: number) => void, count: number, interval: number | undefined, runWhenStart: boolean | undefined, completeAction: () => void): void;
    /**
     * RFC3986: https://tools.ietf.org/html/rfc3986
     *
     * 字符A~Z、a~z、0~9以及字符 -、_、.、~ 不编码。
     *
     * 其它字符编码成%XY的格式，其中XY是字符对应ASCII码的16进制。示例：半角双引号（"）对应%22。
     *
     * 扩展的UTF-8字符，编码成%XY%ZA…的格式。
     *
     * 空格（ ）编码成 %20，而不是加号（+）。
     *
     * 该编码方式与application/x-www-form-urlencoded MIME格式编码算法相似，但又有所不同。
     *
     * encodeURIComponent:
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
     * Not Escaped: A-Z a-z 0-9 - _ . ! ~ * ' ( )
     *
     * !*()'
     * %21 %2A %28 %29 %27
     *
     * @since 2018-08-20
     * @version 1.1.6
     */
    EncodeByRFC3986(str: string): string;
    /**
     *
     * @param str
     * @version 1.1.11
     * @since 2018-10-19
     */
    DecodeByRFC3986(str: string): string;
    /**
     *
     * @see
     * {
     * @link
     * https://stackoverflow.com/questions/7640270/adding-modify-query-string-get-variables-in-a-url-with-javascript
     * }
     * @static
     * @param {string} key
     * @param {string} value
     * @param {string} url
     * @returns
     * @memberof KavenBasic
     * @since 1.1.6
     * @version 2018-08-27
     */
    UpdateQueryString(param: string, value: string, url: string): string;
    /**
     * @static
     * @param {number} time
     * @returns
     * @memberof KavenBasic
     * @version 1.1.7
     * @since 2018-08-30
     */
    Sleep(time: number): Promise<{}>;
    /**
     * @static
     * @param {string} url
     * @returns
     * @memberof KavenBasic
     * @version 1.1.7
     * @since 2018-08-30
     */
    RemoveHashFromURL(url: string): string;
    /**
     *
     * @param url
     * @since 1.1.7
     * @version 2018-08-30
     */
    RemoveQueriesFromURL(url: string): string;
    /**
     *
     * @param url
     * @param names
     * @since 1.1.17
     * @version 2019-02-19
     */
    RemoveQueryFromURL(url: string, ...names: string[]): string;
    /**
     *
     * @param url
     * @since 1.1.7
     * @version 2018-08-30
     */
    GetFileNameFromURL(url: string): string;
    /**
     *
     * @param base
     * @param paths
     * @since 1.1.7
     * @version 2018-08-31
     */
    CombinePath(base: string, ...paths: string[]): string;
    /**
     *
     * @param str
     * @version 1.1.13
     * @since 2018-10-21
     */
    GetMD5(str: string): string;
    /**
     *
     * @param fileExtension
     * @version 1.1.14
     * @since 2018-10-26
     */
    GetMIMEByExtension(fileExtension: string): IMIME[];
    /**
     *
     * @param contentType
     * @version 1.1.14
     * @since 2018-10-26
     */
    GetMIMEByContentType(contentType: string): IMIME[];
    /**
     * Assign the enumerable es6 Symbol properties from one or more objects to
     * the first object passed on the arguments.
     * Can be used as a supplement to other extend,
     * assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.
     * @param target
     * @param args
     * @since 1.1.15
     * @version 2018-11-02
     * @see https://github.com/jonschlinkert/assign-symbols/blob/master/index.js
     */
    AssignSymbols(target: any, ...args: any[]): any;
    /**
     * Deeply assign the values of all enumerable-own-properties and symbols f
     * rom one or more source objects to a target object. Returns the target object.
     * @param target
     * @param args
     * @since 1.1.15
     * @version 2018-11-02
     * @see https://github.com/jonschlinkert/assign-deep/blob/master/index.js
     */
    AssignDeep(target: any, ...args: any[]): any;
    /**
     *
     * @param url
     * @since 1.1.17
     * @version 2019-02-26
     */
    GetQueryStringFromURL(url: string): string | undefined;
    /**
     *
     * @param str
     * @version 1.1.20
     * @version 2019-03-29
     */
    GetCRC32(str: string): import("../../../../Git/Kaven-Basic/src/libs/BitString").BitString;
    GetCRC64(str: string): import("../../../../Git/Kaven-Basic/src/libs/BitString").BitString;
    /**
     * Warning: This algorithm is now considered vulnerable and should not be used.
     * @param str
     * @param separator
     * @since 1.1.20
     * @version 2019-03-30
     */
    GetSHA1(str: string): string;
    GetSHA256(str: string): string;
    GetSHA224(str: string): string;
    GetSHA512(str: string): string;
    GetSHA384(str: string): string;
    GetSHA512T(str: string, t: number): string;
    /**
     * @returns `true` if little endian, `false` if big endian
     */
    CheckEndian(): boolean | undefined;
}
declare const _default: KavenBasic;
export default _default;
//# sourceMappingURL=KavenBasic.d.ts.map