@types/isomorphic-git__lightning-fs
Advanced tools
Comparing version
@@ -7,128 +7,19 @@ // Type definitions for @isomorphic-git/lightning-fs 4.4 | ||
// eslint-disable-next-line @definitelytyped/no-declare-current-package | ||
declare module '@isomorphic-git/lightning-fs' { | ||
/** | ||
* You can procrastinate initializing the FS object until later. And, if you're really adventurous, you can re-initialize it with a different name to switch between IndexedDb databases. | ||
*/ | ||
declare module "@isomorphic-git/lightning-fs" { | ||
/** | ||
* You can procrastinate initializing the FS object until later. And, if you're really adventurous, you can re-initialize it with a different name to switch between IndexedDb databases. | ||
*/ | ||
class FS { | ||
/** | ||
* First, create or open a "filesystem". | ||
* @param name This is used to determine the IndexedDb store name. | ||
* @param options The "filesystem" configuration. | ||
*/ | ||
constructor(name?: string, options?: FS.Options); | ||
/** | ||
* First, create or open a "filesystem". | ||
* @param name This is used to determine the IndexedDb store name. | ||
* @param options The "filesystem" configuration. | ||
*/ | ||
constructor(name?: string, options?: FS.Options); | ||
/** | ||
* | ||
* @param name This is used to determine the IndexedDb store name. | ||
* @param options The "filesystem" configuration. | ||
*/ | ||
init(name: string, options?: FS.Options): void; | ||
/** | ||
* Make directory | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
mkdir(filepath: string, options: FS.MKDirOptions | undefined, cb: (err: Error) => void): void; | ||
/** | ||
* Remove directory | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
rmdir(filepath: string, options: undefined, cb: (err: Error) => void): void; | ||
/** | ||
* Read directory | ||
* | ||
* The callback return value is an Array of strings. NOTE: To save time, it is NOT SORTED. (Fun fact: Node.js' readdir output is not guaranteed to be sorted either. I learned that the hard way.) | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
readdir(filepath: string, options: undefined, cb: (err: Error, files: string[]) => void): void; | ||
writeFile(filepath: string, data: Uint8Array | string, options: FS.WriteFileOptions | undefined | string, cb: (err: Error) => void): void; | ||
readFile(filepath: string, options: FS.ReadFileOptions | undefined | string, cb: (err: Error, data: Uint8Array | string) => void): void; | ||
/** | ||
* Delete a file | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
unlink(filepath: string, options: undefined, cb: (err: Error) => void): void; | ||
/** | ||
* Rename a file or directory | ||
* @param oldFilepath | ||
* @param newFilepath | ||
* @param cb | ||
*/ | ||
rename(oldFilepath: string, newFilepath: string, cb: (err: Error) => void): void; | ||
/** | ||
* The result is a Stat object similar to the one used by Node but with fewer and slightly different properties and methods. | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
stat(filepath: string, options: undefined, cb: (err: Error, stats: FS.Stats) => void): void; | ||
/** | ||
* Like fs.stat except that paths to symlinks return the symlink stats not the file stats of the symlink's target. | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
lstat(filepath: string, options: undefined, cb: (err: Error, stats: FS.Stats) => void): void; | ||
/** | ||
* Create a symlink at filepath that points to target. | ||
* @param target | ||
* @param filepath | ||
* @param cb | ||
*/ | ||
symlink(target: string, filepath: string, cb: (err: Error) => void): void; | ||
/** | ||
* Read the target of a symlink. | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
readlink(filepath: string, options: undefined, cb: (err: Error, linkString: string) => void): void; | ||
/** | ||
* Create or change the stat data for a file backed by HTTP. Size is fetched with a HEAD request. | ||
* Useful when using an HTTP backend without urlauto set, as then files will only be readable if | ||
* they have stat data. Note that stat data is made automatically from the file /.superblock.txt | ||
* if found on the server. /.superblock.txt can be generated or updated with the included - | ||
* [standalone script](https://github.com/isomorphic-git/lightning-fs/blob/main/src/superblocktxt.js). | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
backFile(filepath: string, options: FS.BackFileOptions | undefined, cb: (err: Error) => void): void; | ||
/** | ||
* Returns the size of a file or directory in bytes. | ||
* @param filepath | ||
* @param cb | ||
*/ | ||
du(filepath: string, cb: (err: Error, size: number) => void): void; | ||
readonly promises: FS.PromisifiedFS; | ||
} | ||
namespace FS { | ||
class PromisifiedFS { | ||
/** | ||
* | ||
* @param name This is used to determine the IndexedDb store name. | ||
* @param options The "filesystem" configuration. | ||
*/ | ||
init(name: string, options?: Options): void; | ||
init(name: string, options?: FS.Options): void; | ||
@@ -139,4 +30,5 @@ /** | ||
* @param options | ||
* @param cb | ||
*/ | ||
mkdir(filepath: string, options?: MKDirOptions): Promise<void>; | ||
mkdir(filepath: string, options: FS.MKDirOptions | undefined, cb: (err: Error) => void): void; | ||
@@ -147,4 +39,5 @@ /** | ||
* @param options | ||
* @param cb | ||
*/ | ||
rmdir(filepath: string, options?: undefined): Promise<void>; | ||
rmdir(filepath: string, options: undefined, cb: (err: Error) => void): void; | ||
@@ -154,13 +47,21 @@ /** | ||
* | ||
* The Promise return value is an Array of strings. NOTE: To save time, it is NOT SORTED. | ||
* (Fun fact: Node.js' readdir output is not guaranteed to be sorted either. I learned that the hard way.) | ||
* The callback return value is an Array of strings. NOTE: To save time, it is NOT SORTED. (Fun fact: Node.js' readdir output is not guaranteed to be sorted either. I learned that the hard way.) | ||
* @param filepath | ||
* @param options | ||
* @returns The file list. | ||
* @param cb | ||
*/ | ||
readdir(filepath: string, options?: undefined): Promise<string[]>; | ||
readdir(filepath: string, options: undefined, cb: (err: Error, files: string[]) => void): void; | ||
writeFile(filepath: string, data: Uint8Array | string, options?: WriteFileOptions | string): Promise<void>; | ||
writeFile( | ||
filepath: string, | ||
data: Uint8Array | string, | ||
options: FS.WriteFileOptions | undefined | string, | ||
cb: (err: Error) => void, | ||
): void; | ||
readFile(filepath: string, options?: ReadFileOptions | string): Promise<Uint8Array | string>; | ||
readFile( | ||
filepath: string, | ||
options: FS.ReadFileOptions | undefined | string, | ||
cb: (err: Error, data: Uint8Array | string) => void, | ||
): void; | ||
@@ -171,4 +72,5 @@ /** | ||
* @param options | ||
* @param cb | ||
*/ | ||
unlink(filepath: string, options?: undefined): Promise<void>; | ||
unlink(filepath: string, options: undefined, cb: (err: Error) => void): void; | ||
@@ -179,4 +81,5 @@ /** | ||
* @param newFilepath | ||
* @param cb | ||
*/ | ||
rename(oldFilepath: string, newFilepath: string): Promise<void>; | ||
rename(oldFilepath: string, newFilepath: string, cb: (err: Error) => void): void; | ||
@@ -187,4 +90,5 @@ /** | ||
* @param options | ||
* @param cb | ||
*/ | ||
stat(filepath: string, options?: undefined): Promise<Stats>; | ||
stat(filepath: string, options: undefined, cb: (err: Error, stats: FS.Stats) => void): void; | ||
@@ -195,4 +99,5 @@ /** | ||
* @param options | ||
* @param cb | ||
*/ | ||
lstat(filepath: string, options?: undefined): Promise<Stats>; | ||
lstat(filepath: string, options: undefined, cb: (err: Error, stats: FS.Stats) => void): void; | ||
@@ -203,4 +108,5 @@ /** | ||
* @param filepath | ||
* @param cb | ||
*/ | ||
symlink(target: string, filepath: string): Promise<void>; | ||
symlink(target: string, filepath: string, cb: (err: Error) => void): void; | ||
@@ -211,116 +117,217 @@ /** | ||
* @param options | ||
* @returns The link string. | ||
* @param cb | ||
*/ | ||
readlink(filepath: string, options?: undefined): Promise<string>; | ||
readlink(filepath: string, options: undefined, cb: (err: Error, linkString: string) => void): void; | ||
/** | ||
* Create or change the stat data for a file backed by HTTP. Size is fetched with a HEAD request. | ||
* Useful when using an HTTP backend without urlauto set, as then files will only be readable if they have stat data. | ||
* Note that stat data is made automatically from the file /.superblock.txt if found on the server. /.superblock.txt | ||
* can be generated or updated with the included - | ||
* Useful when using an HTTP backend without urlauto set, as then files will only be readable if | ||
* they have stat data. Note that stat data is made automatically from the file /.superblock.txt | ||
* if found on the server. /.superblock.txt can be generated or updated with the included - | ||
* [standalone script](https://github.com/isomorphic-git/lightning-fs/blob/main/src/superblocktxt.js). | ||
* @param filepath | ||
* @param options | ||
* @param cb | ||
*/ | ||
backFile(filepath: string, options?: BackFileOptions): Promise<void>; | ||
backFile(filepath: string, options: FS.BackFileOptions | undefined, cb: (err: Error) => void): void; | ||
/** | ||
* Returns the size of a file or directory in bytes. | ||
* @param filepath | ||
* @returns The size of a file or directory in bytes. | ||
* @param cb | ||
*/ | ||
du(filepath: string): Promise<number>; | ||
} | ||
du(filepath: string, cb: (err: Error, size: number) => void): void; | ||
interface Options { | ||
/** | ||
* Delete the database and start with an empty filesystem | ||
* @default false | ||
*/ | ||
wipe?: boolean; | ||
/** | ||
* Let readFile requests fall back to an HTTP request to this base URL | ||
* @default false | ||
*/ | ||
url?: string; | ||
/** | ||
* Fall back to HTTP for every read of a missing file, even if unbacked | ||
* @default false | ||
*/ | ||
urlauto?: boolean; | ||
/** | ||
* Customize the database name | ||
*/ | ||
fileDbName?: string; | ||
/** | ||
* Customize the store name | ||
*/ | ||
fileStoreName?: string; | ||
/** | ||
* Customize the database name for the lock mutex | ||
*/ | ||
lockDbName?: string; | ||
/** | ||
* Customize the store name for the lock mutex | ||
*/ | ||
lockStoreName?: string; | ||
/** | ||
* If true, avoids mutex contention during initialization | ||
* @default false | ||
*/ | ||
defer?: boolean; | ||
} | ||
interface MKDirOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o777 | ||
*/ | ||
mode: number; | ||
} | ||
interface WriteFileOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o777 | ||
*/ | ||
mode: number; | ||
encoding?: 'utf8'; | ||
} | ||
interface ReadFileOptions { | ||
encoding?: 'utf8'; | ||
} | ||
interface Stats { | ||
type: 'file' | 'dir'; | ||
mode: any; | ||
size: number; | ||
ino: any; | ||
mtimeMs: any; | ||
ctimeMs: any; | ||
uid: 1; | ||
gid: 1; | ||
dev: 1; | ||
isFile(): boolean; | ||
isDirectory(): boolean; | ||
isSymbolicLink(): boolean; | ||
} | ||
interface BackFileOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o666 | ||
*/ | ||
mode: number; | ||
} | ||
readonly promises: FS.PromisifiedFS; | ||
} | ||
namespace FS { | ||
class PromisifiedFS { | ||
/** | ||
* @param name This is used to determine the IndexedDb store name. | ||
* @param options The "filesystem" configuration. | ||
*/ | ||
init(name: string, options?: Options): void; | ||
/** | ||
* Make directory | ||
* @param filepath | ||
* @param options | ||
*/ | ||
mkdir(filepath: string, options?: MKDirOptions): Promise<void>; | ||
/** | ||
* Remove directory | ||
* @param filepath | ||
* @param options | ||
*/ | ||
rmdir(filepath: string, options?: undefined): Promise<void>; | ||
/** | ||
* Read directory | ||
* | ||
* The Promise return value is an Array of strings. NOTE: To save time, it is NOT SORTED. | ||
* (Fun fact: Node.js' readdir output is not guaranteed to be sorted either. I learned that the hard way.) | ||
* @param filepath | ||
* @param options | ||
* @returns The file list. | ||
*/ | ||
readdir(filepath: string, options?: undefined): Promise<string[]>; | ||
writeFile(filepath: string, data: Uint8Array | string, options?: WriteFileOptions | string): Promise<void>; | ||
readFile(filepath: string, options?: ReadFileOptions | string): Promise<Uint8Array | string>; | ||
/** | ||
* Delete a file | ||
* @param filepath | ||
* @param options | ||
*/ | ||
unlink(filepath: string, options?: undefined): Promise<void>; | ||
/** | ||
* Rename a file or directory | ||
* @param oldFilepath | ||
* @param newFilepath | ||
*/ | ||
rename(oldFilepath: string, newFilepath: string): Promise<void>; | ||
/** | ||
* The result is a Stat object similar to the one used by Node but with fewer and slightly different properties and methods. | ||
* @param filepath | ||
* @param options | ||
*/ | ||
stat(filepath: string, options?: undefined): Promise<Stats>; | ||
/** | ||
* Like fs.stat except that paths to symlinks return the symlink stats not the file stats of the symlink's target. | ||
* @param filepath | ||
* @param options | ||
*/ | ||
lstat(filepath: string, options?: undefined): Promise<Stats>; | ||
/** | ||
* Create a symlink at filepath that points to target. | ||
* @param target | ||
* @param filepath | ||
*/ | ||
symlink(target: string, filepath: string): Promise<void>; | ||
/** | ||
* Read the target of a symlink. | ||
* @param filepath | ||
* @param options | ||
* @returns The link string. | ||
*/ | ||
readlink(filepath: string, options?: undefined): Promise<string>; | ||
/** | ||
* Create or change the stat data for a file backed by HTTP. Size is fetched with a HEAD request. | ||
* Useful when using an HTTP backend without urlauto set, as then files will only be readable if they have stat data. | ||
* Note that stat data is made automatically from the file /.superblock.txt if found on the server. /.superblock.txt | ||
* can be generated or updated with the included - | ||
* [standalone script](https://github.com/isomorphic-git/lightning-fs/blob/main/src/superblocktxt.js). | ||
* @param filepath | ||
* @param options | ||
*/ | ||
backFile(filepath: string, options?: BackFileOptions): Promise<void>; | ||
/** | ||
* @param filepath | ||
* @returns The size of a file or directory in bytes. | ||
*/ | ||
du(filepath: string): Promise<number>; | ||
} | ||
interface Options { | ||
/** | ||
* Delete the database and start with an empty filesystem | ||
* @default false | ||
*/ | ||
wipe?: boolean; | ||
/** | ||
* Let readFile requests fall back to an HTTP request to this base URL | ||
* @default false | ||
*/ | ||
url?: string; | ||
/** | ||
* Fall back to HTTP for every read of a missing file, even if unbacked | ||
* @default false | ||
*/ | ||
urlauto?: boolean; | ||
/** | ||
* Customize the database name | ||
*/ | ||
fileDbName?: string; | ||
/** | ||
* Customize the store name | ||
*/ | ||
fileStoreName?: string; | ||
/** | ||
* Customize the database name for the lock mutex | ||
*/ | ||
lockDbName?: string; | ||
/** | ||
* Customize the store name for the lock mutex | ||
*/ | ||
lockStoreName?: string; | ||
/** | ||
* If true, avoids mutex contention during initialization | ||
* @default false | ||
*/ | ||
defer?: boolean; | ||
} | ||
interface MKDirOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o777 | ||
*/ | ||
mode: number; | ||
} | ||
interface WriteFileOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o777 | ||
*/ | ||
mode: number; | ||
encoding?: "utf8"; | ||
} | ||
interface ReadFileOptions { | ||
encoding?: "utf8"; | ||
} | ||
interface Stats { | ||
type: "file" | "dir"; | ||
mode: any; | ||
size: number; | ||
ino: any; | ||
mtimeMs: any; | ||
ctimeMs: any; | ||
uid: 1; | ||
gid: 1; | ||
dev: 1; | ||
isFile(): boolean; | ||
isDirectory(): boolean; | ||
isSymbolicLink(): boolean; | ||
} | ||
interface BackFileOptions { | ||
/** | ||
* Posix mode permissions | ||
* @default 0o666 | ||
*/ | ||
mode: number; | ||
} | ||
} | ||
export = FS; | ||
} | ||
} | ||
// eslint-disable-next-line @definitelytyped/no-declare-current-package | ||
declare module '@isomorphic-git/lightning-fs/src/path' { | ||
// eslint-disable-next-line @definitelytyped/no-declare-current-package | ||
declare module "@isomorphic-git/lightning-fs/src/path" { | ||
namespace Path { | ||
function join(...parts: string[]): string; | ||
function normalize(path: string): string; | ||
function split(path: string): string[]; | ||
function basename(path: string): string; | ||
function dirname(path: string): string; | ||
function resolve(...paths: string[]): string; | ||
function join(...parts: string[]): string; | ||
function normalize(path: string): string; | ||
function split(path: string): string[]; | ||
function basename(path: string): string; | ||
function dirname(path: string): string; | ||
function resolve(...paths: string[]): string; | ||
} | ||
export = Path; | ||
} | ||
} |
{ | ||
"name": "@types/isomorphic-git__lightning-fs", | ||
"version": "4.4.5", | ||
"version": "4.4.6", | ||
"description": "TypeScript definitions for @isomorphic-git/lightning-fs", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/isomorphic-git__lightning-fs", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "31603633a614eb4c30c6e20b02738ac1a415665374252c97c0a61e84d509bc3f", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "18bc341496f060c211d0f2f76d5254404b903fc88e9c787265461ebac80c845e", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 01 Sep 2023 20:03:14 GMT | ||
* Last updated: Tue, 26 Sep 2023 14:36:22 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
14028
6.86%292
2.46%