GIF: fix type errors

This commit is contained in:
Evan Hahn 2023-11-09 09:30:29 -06:00
parent 253b8e272c
commit 8f6bb74e17
2 changed files with 2 additions and 12 deletions

View File

@ -1,7 +1,7 @@
// @ts-check // @ts-check
/** @enum {string} */ /** @enum {string} */
const types = [ export const GifNodeType = [
"root", "root",
"header", "header",
@ -49,14 +49,3 @@ const types = [
result[id] = id; result[id] = id;
return result; return result;
}, Object.create(null)); }, Object.create(null));
// TODO: Revert this and just export the thing
export const GifNodeType = new Proxy(types, {
get(target, prop) {
const result = target[prop];
if (!result) {
throw new Error(`cannot get ${String(prop)}`);
}
return result;
},
});

View File

@ -220,6 +220,7 @@ const NODE_UI_FNS = {
// Local color table // Local color table
[GifNodeType.localColorTable]: ({ children }) => ({ [GifNodeType.localColorTable]: ({ children }) => ({
title: "Local Color Table",
description: p( description: p(
`The Local Color Table is a list of colors for this frame. Each color is encoded as three bytes: one for red, one for green, and one for blue. The number of colors in the table is ${ `The Local Color Table is a list of colors for this frame. Each color is encoded as three bytes: one for red, one for green, and one for blue. The number of colors in the table is ${
pluralize(children?.length || 0, "color") pluralize(children?.length || 0, "color")