Hierarchy parser API.

层次结构分析器 API。

interface IHierarchyParserAPI {
    collectResourceLinks: ((data: any, basePath: string) => (string | ILoadURL)[]);
    parse: ((data: any, options?: Record<string, any>, errors?: any[]) => Node | Node[]);
}

属性

collectResourceLinks: ((data: any, basePath: string) => (string | ILoadURL)[])

类型声明

    • (data, basePath): (string | ILoadURL)[]
    • 参数

      • data: any

        The data object to process.

      • basePath: string

        The base path used to resolve resource links.

      返回 (string | ILoadURL)[]

      An array of strings or ILoadURL objects representing the resource links.

Collect resource links required by the data.

收集数据所需的资源链接。

parse: ((data: any, options?: Record<string, any>, errors?: any[]) => Node | Node[])

类型声明

    • (data, options?, errors?): Node | Node[]
    • 参数

      • data: any

        The data object to parse.

      • 可选options: Record<string, any>

        Optional settings for parsing.

      • 可选errors: any[]

        Array to store any errors encountered during parsing.

      返回 Node | Node[]

      An array of nodes or a single node if only one is created.

Parse the data and create a hierarchy of nodes.

解析数据并创建节点的层次结构。

返回节点数组或如果只创建了一个节点,则返回单个节点。