subtree-hooks
    Preparing search index...

    Interface Node<CustomNode>

    Represents a generic tree node structure used in SubtreeHooks. This interface is intended to be extended to define your own custom tree shape.

    import { Node } from 'subtree-hooks';

    interface MyNode extends Node<MyNode> {
    // Some custom property for directories or files
    prop1: string;
    prop2: string;
    }

    const myNode: MyNode = {
    prop1: "rootProp1",
    prop2: "rootProp2",
    files: {
    "file1.txt": { prop1: "child1", prop2: "child2" }
    }
    };
    interface Node<CustomNode extends Node<CustomNode> = Node<object>> {
        files?: NodeMap<CustomNode>;
    }

    Type Parameters

    • CustomNode extends Node<CustomNode> = Node<object>

      The specific shape of your custom tree. This allows recursive typing so that child nodes have the same type.

    Index

    Properties

    Properties

    Child files or directories in this node. Each key is the file or directory name, and the value is a sub-node of type CustomNode.