UNPKG

1.87 kBTypeScriptView Raw
1
2export { ReadStream } from "fs";
3export { EventEmitter } from "events";
4export { Readable, Writable } from "stream";
5/**
6 * Platform-specific tools.
7 */
8export declare class PlatformTools {
9 /**
10 * Type of the currently running platform.
11 */
12 static type: "browser" | "node";
13 /**
14 * Gets global variable where global stuff can be stored.
15 */
16 static getGlobalVariable(): any;
17 /**
18 * Loads ("require"-s) given file or package.
19 * This operation only supports on node platform
20 */
21 static load(name: string): any;
22 /**
23 * Normalizes given path. Does "path.normalize".
24 */
25 static pathNormalize(pathStr: string): string;
26 /**
27 * Gets file extension. Does "path.extname".
28 */
29 static pathExtname(pathStr: string): string;
30 /**
31 * Resolved given path. Does "path.resolve".
32 */
33 static pathResolve(pathStr: string): string;
34 /**
35 * Synchronously checks if file exist. Does "fs.existsSync".
36 */
37 static fileExist(pathStr: string): boolean;
38 static readFileSync(filename: string): Buffer;
39 static appendFileSync(filename: string, data: any): void;
40 static writeFile(path: string, data: any): Promise<void>;
41 /**
42 * Gets environment variable.
43 */
44 static getEnvVariable(name: string): any;
45 /**
46 * Highlights sql string to be print in the console.
47 */
48 static highlightSql(sql: string): string;
49 /**
50 * Highlights json string to be print in the console.
51 */
52 static highlightJson(json: string): string;
53 /**
54 * Logging functions needed by AdvancedConsoleLogger
55 */
56 static logInfo(prefix: string, info: any): void;
57 static logError(prefix: string, error: any): void;
58 static logWarn(prefix: string, warning: any): void;
59 static log(message: string): void;
60 static warn(message: string): any;
61}