mirror of
https://github.com/0x5eal/luau-unzip.git
synced 2025-04-18 12:43:45 +01:00
fix: address errors in moonwave comments and convert indentation
This commit is contained in:
parent
9ee7c1af0c
commit
5fb55268f4
1 changed files with 672 additions and 670 deletions
|
@ -123,7 +123,8 @@ type ZipEntryInner = {
|
||||||
|
|
||||||
-- stylua: ignore
|
-- 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.
|
The OS that created the ZIP.
|
||||||
]=]
|
]=]
|
||||||
|
@ -151,10 +152,10 @@ export type MadeByOS =
|
||||||
| "Unknown" -- 0x14 - 0xff; Unused
|
| "Unknown" -- 0x14 - 0xff; Unused
|
||||||
|
|
||||||
--[=[
|
--[=[
|
||||||
@type CompressionMethod
|
@within ZipEntry
|
||||||
|
@type CompressionMethod "STORE" | "DEFLATE"
|
||||||
The method used to compress the file: either `STORE` or `DEFLATE`.
|
|
||||||
|
|
||||||
|
The method used to compress the file:
|
||||||
- `STORE` - No compression
|
- `STORE` - No compression
|
||||||
- `DEFLATE` - Compressed raw deflate chunks
|
- `DEFLATE` - Compressed raw deflate chunks
|
||||||
]=]
|
]=]
|
||||||
|
@ -187,7 +188,7 @@ type ZipEntryProperties = {
|
||||||
@param name string -- File path within ZIP, '/' suffix indicates directory
|
@param name string -- File path within ZIP, '/' suffix indicates directory
|
||||||
@param properties ZipEntryProperties -- Properties of the entry
|
@param properties ZipEntryProperties -- Properties of the entry
|
||||||
@return ZipEntry -- The constructed entry
|
@return ZipEntry -- The constructed entry
|
||||||
--]=]
|
]=]
|
||||||
function ZipEntry.new(offset: number, name: string, properties: ZipEntryProperties): ZipEntry
|
function ZipEntry.new(offset: number, name: string, properties: ZipEntryProperties): ZipEntry
|
||||||
local versionMadeByOS = bit32.rshift(properties.versionMadeBy, 8)
|
local versionMadeByOS = bit32.rshift(properties.versionMadeBy, 8)
|
||||||
local versionMadeByVersion = bit32.band(properties.versionMadeBy, 0x00ff)
|
local versionMadeByVersion = bit32.band(properties.versionMadeBy, 0x00ff)
|
||||||
|
@ -323,12 +324,13 @@ function ZipEntry.isFile(self: ZipEntry): boolean
|
||||||
end
|
end
|
||||||
|
|
||||||
--[=[
|
--[=[
|
||||||
|
@within ZipEntry
|
||||||
@interface UnixMode
|
@interface UnixMode
|
||||||
|
|
||||||
A object representation of the UNIX mode.
|
A object representation of the UNIX mode.
|
||||||
|
|
||||||
@field perms -- The permission octal
|
@field perms string -- The permission octal
|
||||||
@field typeFlags -- The type flags octal
|
@field typeFlags string -- The type flags octal
|
||||||
]=]
|
]=]
|
||||||
export type UnixMode = { perms: string, typeFlags: string }
|
export type UnixMode = { perms: string, typeFlags: string }
|
||||||
|
|
||||||
|
@ -367,11 +369,11 @@ local ZipReader = {}
|
||||||
@interface ZipReader
|
@interface ZipReader
|
||||||
@within ZipReader
|
@within ZipReader
|
||||||
|
|
||||||
@field data -- The buffer containing the raw bytes of the ZIP
|
@field data buffer -- The buffer containing the raw bytes of the ZIP
|
||||||
@field comment -- Comment associated with the ZIP
|
@field comment string -- Comment associated with the ZIP
|
||||||
@field entries -- The decoded entries present
|
@field entries { ZipEntry } -- The decoded entries present
|
||||||
@field directories -- The directories and their respective entries
|
@field directories { [string]: ZipEntry } -- The directories and their respective entries
|
||||||
@field root -- The entry of the root directory
|
@field root ZipEntry -- The entry of the root directory
|
||||||
]=]
|
]=]
|
||||||
export type ZipReader = typeof(setmetatable({} :: ZipReaderInner, { __index = ZipReader }))
|
export type ZipReader = typeof(setmetatable({} :: ZipReaderInner, { __index = ZipReader }))
|
||||||
type ZipReaderInner = {
|
type ZipReaderInner = {
|
||||||
|
@ -390,7 +392,7 @@ type ZipReaderInner = {
|
||||||
|
|
||||||
**Errors if the ZIP file is invalid.**
|
**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
|
@return ZipReader -- The new ZipReader instance
|
||||||
]=]
|
]=]
|
||||||
function ZipReader.new(data): ZipReader
|
function ZipReader.new(data): ZipReader
|
||||||
|
@ -918,9 +920,9 @@ end
|
||||||
@interface ZipStatistics
|
@interface ZipStatistics
|
||||||
@within ZipReader
|
@within ZipReader
|
||||||
|
|
||||||
@prop fileCount number -- The number of files in the zip
|
@field fileCount number -- The number of files in the zip
|
||||||
@prop dirCount number -- The number of directories in the zip
|
@field dirCount number -- The number of directories in the zip
|
||||||
@prop totalSize number -- The total size of all files in the zip
|
@field totalSize number -- The total size of all files in the zip
|
||||||
]=]
|
]=]
|
||||||
export type ZipStatistics = { fileCount: number, dirCount: number, totalSize: number }
|
export type ZipStatistics = { fileCount: number, dirCount: number, totalSize: number }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue