import * as vscode from 'vscode' ; import { diagramsOf } from '../diagram/tools' ; import { exportDiagrams } from './exportDiagrams' ; export interface FileAndFormat { uri : vscode . Uri ; format : string ; } param file param bar returns export async function exportFile ( file , bar ? ) { let doc = await vscode . workspace . openTextDocument ( file . uri ) ; let diagrams = diagramsOf ( doc ) ; if ( ! diagrams . length ) return Promise . resolve ( < Buffer [ ] [ ] > [ ] ) ; return exportDiagrams ( diagrams , file . format , bar ) ; }