ws-apifix: API.md / STYLE.md / README: music as audio, video as animated image, F.save extra files, variant(r), caps.extraFiles, F.music builder, bitrate in bit/s; type baseline 92

This commit is contained in:
4DBug committed 2026-10-31 14:14:11 -05:00
1 parent 6274eedd12
commit 5bbb4227c2
5 files changed
+21 -7

No files matched your search

+5 -2
View File
@@ -20,7 +20,7 @@ The reference implementation to copy is **PNG**:
src/Formats/
init.luau Registry.luau (generated) api (layer 6)
ops/ ops (layer 5.5) editing on the standard types (F.ops.image /
mesh / layers / audio; ImageOps, MeshOps, ...)
mesh / layers / audio / music; ImageOps, ...)
<category>/<fmt>/ formats (layer 5) image audio video model cad font archive data
vector layered subtitle music playlist
containers/ containers (layer 4) Chunks, Riff, IsoBmff, Ebml, Ogg, Zip, Tar, ...
@@ -126,7 +126,10 @@ Rules:
- `open(r, opts)` (audio / video) returns the streaming Decoder / VideoDecoder / Demuxer from `Types.luau`. If a format
has `open` but no `decode`, `F.load` decodes the whole stream through it.
- Options are a typed table with defaults documented on each field (`level: number?, -- 0..9, default 6`).
- Extra format-specific functions (`Png.info(r)`) are fine; `F.format("png")` returns the module.
- Extra format-specific functions (`Png.info(r)`) are fine; `F.format("png")` returns the module. Two optional ones the
api calls: `variant(r) -> string?` (a more precise name for `F.detect`: video/mkv gives `"webm"`), and encoders
that write extra files into `opts.files` declare `caps.extraFiles = true` (the api then returns them from
`F.save` without a destination).
- No globals, no state between calls, no host access (no files, no `game`).
### Conventions shared by every format