20 lines
381 B
TypeScript
20 lines
381 B
TypeScript
|
export 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>>;
|
||
|
};
|