-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
67 lines (53 loc) · 2.49 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/// <reference types="node" />
import { PathLike } from 'graceful-fs';
import type { Mode, Options } from 'mkdirp';
export type LogTypes = 'info' | 'warn' | 'trade' | 'debug' | 'error';
export interface cache {
[Key: string]: unknown;
}
export interface timeouts {
[Key: string]: NodeJS.Timeout
}
export type ArraySplitedValue = unknown[];
export interface timeStamp {
Date: string,
Time: string
}
declare type Log = (log: string) => Promise<void>;
declare interface Loggers {
Error: (log: string) => Promise<void>,
Trade: (log: string) => Promise<void>,
Warn: (log: string) => Promise<void>,
Debug: (log: string, json?: boolean, DebugMode?: boolean) => Promise<void>
}
declare namespace AzulHelper {
export function TimeStamp(date?: Date): Promise<timeStamp>;
export function isURL(str: string): Promise<boolean>;
export function FastConcat(BaseArray: any[], ToConcatArray: any[]): void;
export function AsyncFastConcat(BaseArray: any[], ToConcatArray: any[]): Promise<void>;
export function isTradeOfferURL(str: string): Promise<boolean>;
export function isSteamID64(str: string): Promise<boolean>;
export function isValidSteamID(value: string): Promise<boolean>;
export function GetSteamID64FromURL(str: string): Promise<string | null>;
export function formatNumber(number?: number): string;
export function readJSON(Filepath: PathLike): Promise<Promise<Record<string, unknown>>>;
export function readJSONSync(Filepath: PathLike): Promise<Promise<Record<string, unknown>>>;
export function sleep(ms: number): Promise<void>;
export function SplitArray(Array: any[], MaxSize: number): Promise<ArraySplitedValue>;
export function storeFile(filePath: PathLike, content: string | NodeJS.ArrayBufferView, flag?: string): Promise<void>;
export function createPath(dir: PathLike, opts?: Mode | Options): Promise<string | undefined>;
export function WriteFile(filePath: PathLike, content: string | NodeJS.ArrayBufferView, flag?: string): Promise<void>;
export function storeChatData(UserID64: string, Message: string, Bot?: boolean, server_timestamp?: string, BaseDir?: string): Promise<void>;
export function Pattern(): void;
export const Log: Log & Loggers;
export const Regex: {
SteamID64: RegExp;
TradeOfferUrl: RegExp;
Url: RegExp;
};
export const Cache: {
Get: (KeyID: string) => unknown,
Set: (KeyID: string, Value: unknown, Expiration: number) => void
};
}
export = AzulHelper;