UNPKG

icetool

Version:
181 lines (169 loc) 6.76 kB
export declare type valueOf<T> = T[keyof T]; export declare const language: readonly ["fr-FR", "us-US"]; export declare type language = typeof language[number]; export declare const styleFormatNumber: readonly ["none", "roman", "convert"]; export declare type styleFormatNumber = typeof styleFormatNumber[number]; export declare const compactDisplayFormatNumber: readonly ["short", "long"]; export declare type compactDisplayFormatNumber = typeof compactDisplayFormatNumber[number]; export declare type positveInteger<T extends number> = number extends T ? never : `${T}` extends `-${string}` | `${string}.${string}` ? never : T; export declare type noDecimalInteger<T extends number> = number extends T ? never : `${T}` extends `${string}.${string}` ? never : T; export declare const romanList: readonly ["I", "V", "X", "L", "C", "D", "M", "ↈ", "ↇ", "ↂ", "ↁ", "ↀ"]; export declare type romanList = typeof romanList[number]; export declare type romanInteger<T extends string> = "N" | romanList | (string extends T ? never : `${T}` extends `${romanList}${romanList}${string}` & `${string}${romanList}${romanList}` ? T : never); export declare type timeFormat = { time: number; format: string[]; }; export declare const convertValue: readonly ["k", "h", "da", "d", "c", "m"]; export declare type convertValue = typeof convertValue[number]; export declare const convertList: { readonly g: { readonly convert: readonly ["g"]; readonly type: readonly ["k", "h", "da", "d", "c", "m"]; }; readonly L: { readonly convert: readonly ["L", "m3", "m³"]; readonly type: readonly ["k", "h", "da", "d", "c", "m"]; }; readonly m: { readonly convert: readonly ["m", "r"]; readonly type: readonly ["k", "h", "da", "d", "c", "m"]; }; readonly "m\u00B2": { readonly convert: readonly ["m2", "m²"]; readonly type: readonly ["k", "h", "da", "d", "c", "m"]; }; readonly "m\u00B3": { readonly convert: readonly ["m3", "m³", "L"]; readonly type: readonly ["k", "h", "da", "d", "c", "m"]; }; }; export declare type convertList = keyof typeof convertList; export declare type convertType<E extends convertList> = `${number}${E}` | `${number}${convertValue}${E}`; export interface ConvertNumber { before: convertList; after: convertList; } export interface interfaceFormatNumber<N extends number> { decimalNumber?: positveInteger<N>; compactDisplay?: compactDisplayFormatNumber; style?: styleFormatNumber; convert?: ConvertNumber; } export interface interfaceFormatDate { format?: string; } export interface interfaceFormatTime { compactDisplay?: compactDisplayFormatNumber; format?: string; valueNull?: boolean; suppressTag?: boolean; suffix?: string; prefix?: string; separator?: string; } export interface unRepeat { replaceArray: boolean; } export declare function unRepeat(array: any[], data?: unRepeat): any[]; export declare function sleep(time: number | string, lang?: language): Promise<unknown>; export declare function sleep(time: number | string, lang?: language): Promise<unknown>; export declare class Translate { #private; language: language; constructor(language?: language); get(type: string): string; } export declare class Errors { #private; language: language; translate?: string; type: string; constructor(language: "fr-FR" | "us-US" | undefined, type: string); } declare const colors: { readonly reset: "\u001B[0m"; readonly bright: "\u001B[1m"; readonly dim: "\u001B[2m"; readonly underscore: "\u001B[4m"; readonly blink: "\u001B[5m"; readonly reverse: "\u001B[7m"; readonly hidden: "\u001B[8m"; readonly FgBlack: "\u001B[30m"; readonly FgRed: "\u001B[31m"; readonly FgGreen: "\u001B[32m"; readonly FgYellow: "\u001B[33m"; readonly FgBlue: "\u001B[34m"; readonly FgMagenta: "\u001B[35m"; readonly FgCyan: "\u001B[36m"; readonly FgWhite: "\u001B[37m"; readonly BgBlack: "\u001B[40m"; readonly BgRed: "\u001B[41m"; readonly BgGreen: "\u001B[42m"; readonly BgYellow: "\u001B[43m"; readonly BgBlue: "\u001B[44m"; readonly BgMagenta: "\u001B[45m"; readonly BgCyan: "\u001B[46m"; readonly BgWhite: "\u001B[47m"; }; declare type ColorList = keyof typeof colors; export declare class Console { #private; static log(...value: any): void; static error(...value: any): void; static info(title: string, ...value: any): void; static test(...value: any): void; static custom(color1: ColorList, color2: ColorList, title: string | undefined, ...value: any): void; } export {}; export declare class NumberTimeFormat { #private; constructor(lang: language, data?: interfaceFormatTime); format(value: string | number): string | number; } export declare class NumberFormat<T extends number> { #private; constructor(lang: language, data?: interfaceFormatNumber<T>); format<N extends number, S extends string>(value: noDecimalInteger<N> | romanInteger<S> | number): string | number | undefined; } export declare class NumberDateFormat { #private; constructor(lang: language, data?: interfaceFormatDate); format(value: string | number): string; } export declare class AdvancedArray extends Array { #private; constructor(value: any[] | number); /** * Replace an array * @param array the replacement array */ replaceArray(array: any[]): this; /** * Determines whether an array includes a certain element, returning true or false as appropriate, if the recursive option is enalbe it will search the element in all arrays of an array. * * @param search The element to search for. * @param option Different search options */ includes(search: any, option?: number | { recurive?: boolean; start?: number; end?: number; }): boolean; indexOf(searchElement: any, fromIndex?: number): number; lastIndexOf(searchElement: any, fromIndex?: number): number; /** * Returns an new array. */ clone(): AdvancedArray; /** * Removes all elements from an array, if the recursive option is enalbe it will remove the element in all arrays of an array * @param value Removes all elements from an array * @param recurive enable or disable the recurive option */ spliceAll(value: any, recurive?: boolean): any[]; /** * get the random elements in an array. */ random(): any; }