Skip to content

Commit fa44f4b

Browse files
committed
Added path typings.
1 parent ac73970 commit fa44f4b

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

index.d.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ declare module '@isomorphic-git/lightning-fs' {
1212
* @param filepath
1313
* @param options
1414
*/
15-
mkdir(filepath: string, options: FS.MKDirOptions | undefined): Promise<void>
15+
mkdir(filepath: string, options: FS.MKDirOptions | undefined): Promise<never>
1616

1717
/**
1818
* Remove directory
1919
* @param filepath
2020
* @param options
2121
*/
22-
rmdir(filepath: string, options: undefined): Promise<void>
22+
rmdir(filepath: string, options: undefined): Promise<never>
2323

2424
/**
2525
* Read directory
@@ -31,7 +31,7 @@ declare module '@isomorphic-git/lightning-fs' {
3131
*/
3232
readdir(filepath: string, options: undefined): Promise<string[]>
3333

34-
writeFile(filepath: string, data: Uint8Array | string, options: FS.WriteFileOptions | undefined | string): Promise<void>
34+
writeFile(filepath: string, data: Uint8Array | string, options: FS.WriteFileOptions | undefined | string): Promise<never>
3535

3636
readFile(filepath: string, options: FS.ReadFileOptions | undefined | string): Promise<Uint8Array>
3737

@@ -40,14 +40,14 @@ declare module '@isomorphic-git/lightning-fs' {
4040
* @param filepath
4141
* @param options
4242
*/
43-
unlink(filepath: string, options: undefined): Promise<void>
43+
unlink(filepath: string, options: undefined): Promise<never>
4444

4545
/**
4646
* Rename a file or directory
4747
* @param oldFilepath
4848
* @param newFilepath
4949
*/
50-
rename(oldFilepath: string, newFilepath: string): Promise<void>
50+
rename(oldFilepath: string, newFilepath: string): Promise<never>
5151

5252
/**
5353
* The result is a Stat object similar to the one used by Node but with fewer and slightly different properties and methods.
@@ -68,7 +68,7 @@ declare module '@isomorphic-git/lightning-fs' {
6868
* @param target
6969
* @param filepath
7070
*/
71-
symlink(target: string, filepath: string): Promise<void>
71+
symlink(target: string, filepath: string): Promise<never>
7272

7373
/**
7474
* Read the target of a symlink.
@@ -83,7 +83,7 @@ declare module '@isomorphic-git/lightning-fs' {
8383
* @param filepath
8484
* @param options
8585
*/
86-
backFile(filepath: string, options: FS.BackFileOptions | undefined): Promise<void>
86+
backFile(filepath: string, options: FS.BackFileOptions | undefined): Promise<never>
8787

8888
/**
8989
* @param filepath
@@ -288,3 +288,15 @@ declare module '@isomorphic-git/lightning-fs' {
288288
}
289289
export default FS
290290
}
291+
292+
declare module '@isomorphic-git/lightning-fs/src/path' {
293+
namespace Path {
294+
function join(...parts: string[]): string
295+
function normalize(path: string): string
296+
function split(path: string): string[]
297+
function basename(path: string): string
298+
function dirname(path: string): string
299+
function resolve(...paths: string[]): string
300+
}
301+
export default Path
302+
}

0 commit comments

Comments
 (0)