🚀 Additions
- Verbose RX/TX debugging
- Can be turned on via
$BadgeAPI.badge.debug.rx = true/$BadgeAPI.badge.debug.tx = true
- Can be turned on via
✨ Improvements
- RX data is now handled completely asynchronously
- Code readability
- Return type of
BadgeFileSystemApi.list()is now a discriminated unionFSListingofFileListingandDirListingto allow type narrowing
⚠️ Breaking change ⚠️
The type export FileListing of api/filesystem has been renamed to FSListing. The new export FileListing only represents actual files instead of both files and folders, and is complemented by DirListing. FSListing is a union of FileListing and DirListing. This allows type narrowing when consuming an FSListing, e.g. from BadgeAPI.fileSystem.list():
const items = await $BadgeAPI.fileSystem.list('/internal');
items.forEach(item => {
if (item.type == 'file') {
/* type of `item` is narrowed to FileListing */
}
else {
/* type of `item` narrowed to DirListing */
}
})