UEA-Prodem

This commit is contained in:
2026-06-10 12:38:42 -03:00
parent 3f33154e16
commit c41625e542
9352 changed files with 1128292 additions and 14752 deletions
+150
View File
@@ -0,0 +1,150 @@
# Changelog
## [0.15.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.14.0...types-v0.15.0) (2024-09-09)
### Features
* Add depth to HfsWalkEntry ([#130](https://github.com/humanwhocodes/humanfs/issues/130)) ([a633452](https://github.com/humanwhocodes/humanfs/commit/a63345260562b798e73c2ea63612e6fe95ac400d))
## [0.14.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.13.0...types-v0.14.0) (2024-06-12)
### Features
* Implement Hfs#walk() method ([#119](https://github.com/humanwhocodes/humanfs/issues/119)) ([2aeade0](https://github.com/humanwhocodes/humanfs/commit/2aeade0ffbef886103dc38d16694e9b63191a8df))
## [0.13.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.12.0...types-v0.13.0) (2024-03-20)
### ⚠ BREAKING CHANGES
* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105))
### Features
* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105)) ([b508df1](https://github.com/humanwhocodes/humanfs/commit/b508df19845f7a914895c13cfe47707c0cd1a7c7))
## [0.12.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.11.0...types-v0.12.0) (2024-02-27)
### Features
* impl write() method only needs to handle Uint8Arrays ([#92](https://github.com/humanwhocodes/humanfs/issues/92)) ([68bcfb5](https://github.com/humanwhocodes/humanfs/commit/68bcfb59a6684b184c55f97536aad730636299b5))
## [0.11.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.10.0...types-v0.11.0) (2024-02-23)
### Features
* Impls only need bytes() method to read data ([#90](https://github.com/humanwhocodes/humanfs/issues/90)) ([c0c3b36](https://github.com/humanwhocodes/humanfs/commit/c0c3b36413c8d10e63a94ad1cc6a5cead7b52e88))
## [0.10.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.9.0...types-v0.10.0) (2024-02-16)
### ⚠ BREAKING CHANGES
* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87))
### Features
* Add lastModified() method ([#84](https://github.com/humanwhocodes/humanfs/issues/84)) ([9cbcd03](https://github.com/humanwhocodes/humanfs/commit/9cbcd03c86e4c1bed5985e10da6ab452e8c2b44c))
* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87)) ([84e9812](https://github.com/humanwhocodes/humanfs/commit/84e98129e48acb3f2ea067b0ea745d591e8d8b91))
## [0.9.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.8.0...types-v0.9.0) (2024-02-14)
### Features
* Add append() method ([#82](https://github.com/humanwhocodes/humanfs/issues/82)) ([ab7b978](https://github.com/humanwhocodes/humanfs/commit/ab7b978ff3be84dc3fd2fd4d6fa1131dfdec8134))
* Add move() and moveAll() methods ([#80](https://github.com/humanwhocodes/humanfs/issues/80)) ([85f100b](https://github.com/humanwhocodes/humanfs/commit/85f100b721c99b920b307779548c2a043e7e18b5))
## [0.8.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.7.0...types-v0.8.0) (2024-02-09)
### Features
* Add copyAll() method ([#77](https://github.com/humanwhocodes/humanfs/issues/77)) ([3c0852a](https://github.com/humanwhocodes/humanfs/commit/3c0852af99cb835b3941f58fdc2206e7b1179e21))
## [0.7.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.6.0...types-v0.7.0) (2024-02-08)
### Features
* Add copy() method ([#69](https://github.com/humanwhocodes/humanfs/issues/69)) ([f252bac](https://github.com/humanwhocodes/humanfs/commit/f252bac6692a5b5c973ee3c696f5190caa5f12c7))
## [0.6.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.1...types-v0.6.0) (2024-02-07)
### Features
* Allow URL file and directory paths ([#62](https://github.com/humanwhocodes/humanfs/issues/62)) ([a767e37](https://github.com/humanwhocodes/humanfs/commit/a767e372287b1556c4c9e8bdb26c23ff81866f99))
## [0.5.1](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.0...types-v0.5.1) (2024-01-31)
### Bug Fixes
* Order of exports and engines in package.json ([66204c2](https://github.com/humanwhocodes/humanfs/commit/66204c24bc2dd02380aa2fb3c5769ca2cf5238a7)), closes [#61](https://github.com/humanwhocodes/humanfs/issues/61)
## [0.5.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.4.0...types-v0.5.0) (2024-01-30)
### ⚠ BREAKING CHANGES
* Rename fsx -> humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56))
### Features
* Rename fsx -> humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56)) ([f5dc533](https://github.com/humanwhocodes/humanfs/commit/f5dc533c8a46d45afd7aad602af39a6074f8a07b))
## [0.4.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.3.0...fsx-types-v0.4.0) (2024-01-27)
### Features
* New size() method ([#51](https://github.com/humanwhocodes/fsx/issues/51)) ([ffd12e6](https://github.com/humanwhocodes/fsx/commit/ffd12e6b0db318320dd5a9dbb8eb248106d60afa))
## [0.3.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.2.0...fsx-types-v0.3.0) (2024-01-23)
### ⚠ BREAKING CHANGES
* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37))
### Features
* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37)) ([2e85142](https://github.com/humanwhocodes/fsx/commit/2e85142e34bdc3cc18e18aa0b051cc9007fca4b8))
* write() to accept ArrayBuffer views as file contents ([1fd5517](https://github.com/humanwhocodes/fsx/commit/1fd55174a528ef3dcbabc154347006bec799f3f9))
### Bug Fixes
* **types:** Ensure FsxImpl methods also return undefined ([14eadc6](https://github.com/humanwhocodes/fsx/commit/14eadc66b19e40d7406a166e019004d9888075d3)), closes [#32](https://github.com/humanwhocodes/fsx/issues/32)
## [0.2.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.1.0...fsx-types-v0.2.0) (2024-01-19)
### Features
* Add list() method ([#25](https://github.com/humanwhocodes/fsx/issues/25)) ([dad841b](https://github.com/humanwhocodes/fsx/commit/dad841b7c9f5312996ff23db9be36774af985157))
## [0.1.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.3...fsx-types-v0.1.0) (2024-01-18)
### Features
* Add bytes() method, deprecate arrayBuffer() ([718c9c8](https://github.com/humanwhocodes/fsx/commit/718c9c84a0a1dcaef3cc032c882b1308e9cb3273))
## [0.0.3](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.2...fsx-types-v0.0.3) (2024-01-16)
### Bug Fixes
* Ensure isFile/isDirectory rethrow non-ENOENT errors. ([d31ee56](https://github.com/humanwhocodes/fsx/commit/d31ee56788e898cbc1fc0d6a54d1551f9b17cd45)), closes [#14](https://github.com/humanwhocodes/fsx/issues/14)
## [0.0.2](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.1...fsx-types-v0.0.2) (2024-01-06)
### Bug Fixes
- **docs:** Correct package names in READMEs ([6c552ac](https://github.com/humanwhocodes/fsx/commit/6c552ac74542a245cdc2675101858da022336a1a))
+13
View File
@@ -0,0 +1,13 @@
# `@humanfs/types`
by [Nicholas C. Zakas](https://humanwhocodes.com)
If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.
## Description
Additional type definitions for humanfs. These are used primarily to share type definitions across packages because there is no easy way to export imported type definitions using JavaScript and JSDoc.
## License
Apache 2.0
+42
View File
@@ -0,0 +1,42 @@
{
"name": "@humanfs/types",
"version": "0.15.0",
"description": "The TypeScript types for the hfs project.",
"type": "module",
"types": "src/hfs-types.ts",
"exports": {
".": {
"types": "./src/hfs-types.ts"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/humanwhocodes/humanfs.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"filesystem",
"fs",
"hfs",
"files"
],
"author": "Nicholas C. Zakas",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/humanwhocodes/humanfs/issues"
},
"homepage": "https://github.com/humanwhocodes/humanfs#readme",
"engines": {
"node": ">=18.18.0"
},
"devDependencies": {
"typescript": "^5.2.2"
}
}
+192
View File
@@ -0,0 +1,192 @@
/**
* @fileoverview The types file for the hfs package.
* @author Nicholas C. Zakas
*/
//------------------------------------------------------------------------------
// HfsImpl
//------------------------------------------------------------------------------
export interface HfsImpl {
/**
* Reads the given file and returns the contents as an Uint8Array.
* @param filePath The file to read.
* @returns The contents of the file as a Uint8Array or undefined if the file is empty.
*/
bytes?(filePath: string|URL): Promise<Uint8Array|undefined>;
/**
* Writes the given data to the given file. For text, assumes UTF-8 encoding.
* @param filePath The file to write to.
* @param data The data to write.
* @returns A promise that resolves when the file is written.
* @throws {Error} If the file cannot be written.
*/
write?(filePath: string|URL, data: Uint8Array): Promise<void>;
/**
* Appends the given data to the given file. For text, assumes UTF-8 encoding.
* @param filePath The file to append to.
* @param data The data to append.
* @returns A promise that resolves when the file is written.
* @throws {Error} If the file cannot be written.
*/
append?(filePath: string|URL, data: Uint8Array): Promise<void>;
/**
* Checks if the given file exists.
* @param filePath The file to check.
* @returns True if the file exists, false if not.
* @throws {Error} If the operation fails with a code other than ENOENT.
*/
isFile?(filePath: string|URL): Promise<boolean>;
/**
* Checks if the given directory exists.
* @param dirPath The directory to check.
* @returns True if the directory exists, false if not.
* @throws {Error} If the operation fails with a code other than ENOENT.
*/
isDirectory?(dirPath: string|URL): Promise<boolean>;
/**
* Creates the given directory, including any necessary parents.
* @param dirPath The directory to create.
* @returns A promise that resolves when the directory is created.
* @throws {Error} If the directory cannot be created.
*/
createDirectory?(dirPath: string|URL): Promise<void>;
/**
* Deletes the given file or empty directory.
* @param fileOrDirPath The file or directory to delete.
* @returns A promise that resolves when the file or directory is deleted,
* true if the file or directory was deleted, false if it did not exist.
* @throws {Error} If the file or directory cannot be deleted.
*/
delete?(fileOrDirPath: string|URL): Promise<boolean>;
/**
* Deletes the given file or directory recursively.
* @param fileOrDirPath The file or directory to delete.
* @returns A promise that resolves when the file or directory is deleted,
* true if the file or directory was deleted, false if it did not exist.
* @throws {Error} If the file or directory cannot be deleted.
*/
deleteAll?(fileOrDirPath: string|URL): Promise<boolean>;
/**
* Returns a list of directory entries for the given path.
* @param dirPath The path to the directory to read.
* @returns A promise that resolves with the
* directory entries.
* @throws {TypeError} If the directory path is not a string.
* @throws {Error} If the directory cannot be read.
*/
list?(dirPath: string|URL): AsyncIterable<HfsDirectoryEntry>;
/**
* Returns the size of the given file.
* @param filePath The path to the file to check.
* @returns A promise that resolves with the size of the file in bytes or
* undefined if the file does not exist.
* @throws {Error} If the file cannot be read.
*/
size?(filePath: string|URL): Promise<number|undefined>;
/**
* Returns the last modified date of the given file or directory.
* @param fileOrDirPath The path to the file or directory to check.
* @returns A promise that resolves with the last modified date of the file or
* directory, undefined if the file does not exist.
* @throws {Error} If the file or directory cannot be read.
*/
lastModified?(fileOrDirPath: string|URL): Promise<Date|undefined>;
/**
* Copies the file from the source path to the destination path.
* @param source The source file to copy.
* @param destination The destination file to copy to.
* @returns A promise that resolves when the file is copied.
* @throws {Error} If the file cannot be copied.
*/
copy?(source: string|URL, destination: string|URL): Promise<void>;
/**
* Copies a file or directory from one location to another.
* @param source The path to the file or directory to copy.
* @param destination The path to copy the file or directory to.
* @returns A promise that resolves when the file or directory is
* copied.
* @throws {Error} If the source file or directory does not exist.
* @throws {Error} If the source cannot be read.
*/
copyAll?(source: string|URL, destination: string|URL): Promise<void>;
/**
* Moves a file from the source path to the destination path.
* @param source The location of the file to move.
* @param destination The destination of the file to move.
* @returns A promise that resolves when the file is moved.
* @throws {Error} If the source is a directory.
* @throws {Error} If the file cannot be moved.
*/
move?(source: string|URL, destination: string|URL): Promise<void>;
/**
* Moves a file or directory from one location to another.
* @param source The path to the file or directory to move.
* @param destination The path to move the file or directory to.
* @returns A promise that resolves when the file or directory is
* moved.
* @throws {Error} If the source file or directory does not exist.
* @throws {Error} If the source cannot be read.
*/
moveAll?(source: string|URL, destination: string|URL): Promise<void>;
}
//------------------------------------------------------------------------------
// HfsDirectoryEntry
//------------------------------------------------------------------------------
export interface HfsDirectoryEntry {
/**
* The name of the file or directory.
*/
name: string;
/**
* True if the entry is a directory, false if not.
*/
isDirectory: boolean;
/**
* True if the entry is a file, false if not.
*/
isFile: boolean;
/**
* True if the entry is a symbolic link, false if not.
*/
isSymlink: boolean;
}
//------------------------------------------------------------------------------
// HfsWalkEntry
//------------------------------------------------------------------------------
export interface HfsWalkEntry extends HfsDirectoryEntry {
/**
* The path of the entry relative to the directory that was walked.
*/
path: string;
/**
* The depth of the entry in the directory tree from the directory that was walked.
*/
depth: number;
}
+13
View File
@@ -0,0 +1,13 @@
{
"files": ["src/hfs-types.ts"],
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"allowJs": true,
"checkJs": true,
"outDir": "dist",
"target": "ES2022",
"moduleResolution": "NodeNext",
"module": "NodeNext"
}
}