import { Disposable , TreeDataProvider , TreeItem , TreeItemIndex } from '../types' ; export class CompleteTreeDataProvider < T = any > implements Required < TreeDataProvider < T > > { private provider : TreeDataProvider ; constructor ( provider ) { this . provider = provider ; } public async getTreeItem ( itemId ) { return this . provider . getTreeItem ( itemId ) ; } public async getTreeItems ( itemIds ) { return this . provider . getTreeItems ? this . provider . getTreeItems ( itemIds ) : Promise . all ( itemIds . map ( id => this . provider . getTreeItem ( id ) ) ) ; } public async onChangeItemChildren ( itemId , newChildren ) { return this . provider . onChangeItemChildren ?. ( itemId , newChildren ) ; } public onDidChangeTreeData ( listener ) { return this . provider . onDidChangeTreeData ? this . provider . onDidChangeTreeData ( listener ) : { dispose : ( ) => { } } ; } public async onRenameItem ( item , name ) { return this . provider . onRenameItem ?. ( item , name ) ; } }