import { TreeDataProvider , Event , EventEmitter , TreeItem , TreeItemCollapsibleState , ProviderResult } from 'vscode' ; export abstract class BaseProvider implements TreeDataProvider < TreeNode > { protected _onDidChangeTreeData : EventEmitter < TreeNode | undefined > = new EventEmitter < TreeNode | undefined > ( ) ; readonly onDidChangeTreeData ? : Event < TreeNode | undefined | null | void > = this . _onDidChangeTreeData . event ; abstract getTreeItem ( element ) ; abstract getChildren ( element ? ) ; } export class TreeNode extends TreeItem { public isDir : boolean ; public nodeName : string | undefined ; public children : TreeNode [ ] | undefined ; public link : string = '' ; constructor ( label , isDir ) { super ( label , isDir ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ; this . isDir = isDir ; this . contextValue = isDir ? 'dir' : 'item' ; } }