UNPKG

svelte-tree-view

Version:

Display JSON objects in a customizable tree-view

15 lines (14 loc) 757 B
/// <reference types="svelte" /> import type { TreeNode, TreeRecursionOpts } from '../types'; import type { PropsStore } from './props'; export type TreeStore = ReturnType<typeof createTreeStore>; export declare const createTreeStore: (propsStore: PropsStore) => { tree: import("svelte/store").Writable<TreeNode<any>>; treeMap: import("svelte/store").Writable<Map<string, TreeNode<any>>>; defaultRootNode: TreeNode<any>; init(newTree: TreeNode | null, newTreeMap: Map<string, TreeNode>, iterated: Map<any, TreeNode>): void; getNode(id: string): TreeNode<any> | undefined; toggleCollapse(id: string): void; expandNodeChildren(node: TreeNode, recursionOpts: TreeRecursionOpts): void; expandAllNodesToNode(id: string): void; };