fix: address errors in moonwave comments and convert indentation

This commit is contained in:
Erica Marigold 2025-02-19 18:28:00 +00:00
parent 9ee7c1af0c
commit 5fb55268f4
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

View file

@ -123,7 +123,8 @@ type ZipEntryInner = {
-- stylua: ignore
--[=[
@type MadeByOS
@within ZipEntry
@type MadeByOS "FAT" | "AMIGA" | "VMS" | "UNIX" | "VM/CMS" | "Atari ST" | "OS/2" | "MAC" | "Z-System" | "CP/M" | "NTFS" | "MVS" | "VSE" | "Acorn RISCOS" | "VFAT" | "Alternate MVS" | "BeOS" | "TANDEM" | "OS/400" | "OS/X" | "Unknown"
The OS that created the ZIP.
]=]
@ -151,10 +152,10 @@ export type MadeByOS =
| "Unknown" -- 0x14 - 0xff; Unused
--[=[
@type CompressionMethod
The method used to compress the file: either `STORE` or `DEFLATE`.
@within ZipEntry
@type CompressionMethod "STORE" | "DEFLATE"
The method used to compress the file:
- `STORE` - No compression
- `DEFLATE` - Compressed raw deflate chunks
]=]
@ -187,7 +188,7 @@ type ZipEntryProperties = {
@param name string -- File path within ZIP, '/' suffix indicates directory
@param properties ZipEntryProperties -- Properties of the entry
@return ZipEntry -- The constructed entry
--]=]
]=]
function ZipEntry.new(offset: number, name: string, properties: ZipEntryProperties): ZipEntry
local versionMadeByOS = bit32.rshift(properties.versionMadeBy, 8)
local versionMadeByVersion = bit32.band(properties.versionMadeBy, 0x00ff)
@ -323,12 +324,13 @@ function ZipEntry.isFile(self: ZipEntry): boolean
end
--[=[
@within ZipEntry
@interface UnixMode
A object representation of the UNIX mode.
@field perms -- The permission octal
@field typeFlags -- The type flags octal
@field perms string -- The permission octal
@field typeFlags string -- The type flags octal
]=]
export type UnixMode = { perms: string, typeFlags: string }
@ -367,11 +369,11 @@ local ZipReader = {}
@interface ZipReader
@within ZipReader
@field data -- The buffer containing the raw bytes of the ZIP
@field comment -- Comment associated with the ZIP
@field entries -- The decoded entries present
@field directories -- The directories and their respective entries
@field root -- The entry of the root directory
@field data buffer -- The buffer containing the raw bytes of the ZIP
@field comment string -- Comment associated with the ZIP
@field entries { ZipEntry } -- The decoded entries present
@field directories { [string]: ZipEntry } -- The directories and their respective entries
@field root ZipEntry -- The entry of the root directory
]=]
export type ZipReader = typeof(setmetatable({} :: ZipReaderInner, { __index = ZipReader }))
type ZipReaderInner = {
@ -390,7 +392,7 @@ type ZipReaderInner = {
**Errors if the ZIP file is invalid.**
@param data -- The buffer containing the raw bytes of the ZIP
@param data buffer -- The buffer containing the raw bytes of the ZIP
@return ZipReader -- The new ZipReader instance
]=]
function ZipReader.new(data): ZipReader
@ -918,9 +920,9 @@ end
@interface ZipStatistics
@within ZipReader
@prop fileCount number -- The number of files in the zip
@prop dirCount number -- The number of directories in the zip
@prop totalSize number -- The total size of all files in the zip
@field fileCount number -- The number of files in the zip
@field dirCount number -- The number of directories in the zip
@field totalSize number -- The total size of all files in the zip
]=]
export type ZipStatistics = { fileCount: number, dirCount: number, totalSize: number }