ws-cleanup-types: archive, audio, data, font, image, layered, music, playlist, subtitle, vector, video: annotations, casts, one value per re-assignment where the solver loses the type
This commit is contained in:
1 parent
dc98aec2ec
commit
f459b2dcdf
44 files changed
+172
-119
No files matched your search
@@ -50,7 +50,7 @@ export type EncodeOptions = {
|
||||
-- ------------------------------------------------------------------------------------------------ constants
|
||||
local readu8 = buffer.readu8
|
||||
local DISPOSE = { [0] = "none", [1] = "none", [2] = "background", [3] = "previous" }
|
||||
local DISPOSE_CODE = { none = 1, background = 2, previous = 3 }
|
||||
local DISPOSE_CODE: { [string]: number } = { none = 1, background = 2, previous = 3 }
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ sniff
|
||||
function Gif.sniff(r: Bytes.Reader): number
|
||||
@@ -62,7 +62,7 @@ end
|
||||
-- a colour table at p (n entries) -> 256 u32 rgba entries (missing ones opaque black) and the { r, g, b, a } list
|
||||
local function colorTable(b: buffer, p: number, n: number): (buffer, { { number } })
|
||||
local t = buffer.create(1024)
|
||||
local list = table.create(n)
|
||||
local list: { { number } } = table.create(n) :: { { number } }
|
||||
for i = 0, 255 do
|
||||
buffer.writeu32(t, i * 4, 0xFF000000)
|
||||
end
|
||||
@@ -404,7 +404,7 @@ function Gif.encode(img: Types.Image, opts: EncodeOptions?): (buffer?, Err.Err?)
|
||||
end
|
||||
-- palettes
|
||||
local shared = (opts and opts.globalPalette) or not animated
|
||||
local qopts = { method = method, dither = dither }
|
||||
local qopts: Quantize.PaletteOptions = { method = method, dither = dither }
|
||||
local globalPal: { { number } }? = nil
|
||||
local globalTrans = false
|
||||
if shared then
|
||||
|
||||
Reference in new issue
Block a user