formats.exposed/types/png.d.ts

24 lines
475 B
TypeScript
Raw Normal View History

import { PngNodeType } from "../public/png/constants.js";
type Node<T> = {
/**
* The type of this node. Typically an enum specific to the format.
*/
type: T;
/**
* The bytes that make up this node.
*
* It is highly encouraged to use `Uint8Array.prototype.subarray`,
* not `.slice`, to avoid copying the data.
*/
bytes: Uint8Array;
/**
* Child nodes.
*/
children?: ReadonlyArray<Node<T>>;
};
export type PngNode = Node<PngNodeType>;