xjs-node 3.0.0-alpha.1 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/func/u-file.d.ts +3 -12
- package/package.json +1 -1
package/build/func/u-file.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
1
2
|
import { MaybeArray } from "xjs-common";
|
|
2
|
-
interface FileStatus {
|
|
3
|
-
isFile(): boolean;
|
|
4
|
-
isDirectory(): boolean;
|
|
5
|
-
isBlockDevice(): boolean;
|
|
6
|
-
isCharacterDevice(): boolean;
|
|
7
|
-
isSymbolicLink(): boolean;
|
|
8
|
-
isFIFO(): boolean;
|
|
9
|
-
isSocket(): boolean;
|
|
10
|
-
}
|
|
11
3
|
export declare namespace UFile {
|
|
12
4
|
function mkdir(p: MaybeArray<string>): boolean;
|
|
13
5
|
function write(p: MaybeArray<string>, c: string): Promise<void>;
|
|
@@ -21,7 +13,7 @@ export declare namespace UFile {
|
|
|
21
13
|
/**
|
|
22
14
|
* return a file status. if the file of the status doesn't exist, this returns `null`.
|
|
23
15
|
*/
|
|
24
|
-
function status(p: MaybeArray<string>):
|
|
16
|
+
function status(p: MaybeArray<string>): fs.Stats;
|
|
25
17
|
function read(p: MaybeArray<string>): Promise<Buffer>;
|
|
26
18
|
function read(p: MaybeArray<string>, encoding: BufferEncoding): Promise<string>;
|
|
27
19
|
/**
|
|
@@ -30,7 +22,7 @@ export declare namespace UFile {
|
|
|
30
22
|
* @param d default value if the file path doesn't exist. default of this is `{}`.
|
|
31
23
|
* @param encoding encoding used by file reading. default is `utf-8`.
|
|
32
24
|
*/
|
|
33
|
-
function readAsJson<T>(p: MaybeArray<string>, d?: any, encoding?: BufferEncoding): Promise<T>;
|
|
25
|
+
function readAsJson<T = any>(p: MaybeArray<string>, d?: any, encoding?: BufferEncoding): Promise<T>;
|
|
34
26
|
function cp(from: MaybeArray<string>, to: MaybeArray<string>): Promise<void>;
|
|
35
27
|
function mv(from: MaybeArray<string>, to: MaybeArray<string>): Promise<void>;
|
|
36
28
|
function ls(p: MaybeArray<string>): string[];
|
|
@@ -49,4 +41,3 @@ export declare namespace UFile {
|
|
|
49
41
|
*/
|
|
50
42
|
function unzip(zipPath: MaybeArray<string>, destDir?: MaybeArray<string>): void;
|
|
51
43
|
}
|
|
52
|
-
export {};
|