GIF: fix type errors
This commit is contained in:
parent
253b8e272c
commit
8f6bb74e17
|
@ -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;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue