import { EventEmitter , ProviderResult , TreeDataProvider } from 'vscode' ; import { ctx } from '../ctx' ; import { SlideItem } from './SlideItem' ; export class SlidesProvider implements TreeDataProvider < SlideItem > { private _onDidChangeTreeData = new EventEmitter < SlideItem | undefined > ( ) ; readonly onDidChangeTreeData = this . _onDidChangeTreeData . event ; refresh ( ) { this . _onDidChangeTreeData . fire ( undefined ) ; } getTreeItem ( element ) { return element ; } getChildren ( element ? ) { if ( ! element ) return ctx . data ?. slides ?. map ( i => new SlideItem ( i ) ) ; return [ ] ; } }