UNPKG

es-grid-template

Version:

es-grid-template

26 lines (25 loc) 930 B
import type { AbstractTreeNode } from '../../interfaces'; export type CheckedStrategy = 'all' | 'parent' | 'child'; export interface TreeDataHelperOptions<N extends AbstractTreeNode> { tree: N[]; getNodeValue: (node: N) => string; value: string[]; checkedStrategy: CheckedStrategy; isDetached?: (node: N) => boolean; } export default class TreeDataHelper<N extends AbstractTreeNode> { private readonly opts; private wrapperMap; private rootWrapper; constructor(opts: TreeDataHelperOptions<N>); private get value(); private isDetached; private initWrapperTree; isIndeterminate(nodeValue: string): boolean; isChecked(nodeValue: string): boolean; getValueAfterCheck(nodeValue: string): string[]; getValueAfterUncheck(nodeValue: string): string[]; getValueAfterToggle(nodeValue: string): string[]; getNode(nodeValue: string): N; getCleanValue(): string[]; }