import fs = require ( "fs" ) ; import path = require ( "path" ) ; import os = require ( "os" ) ; import vscode = require ( "vscode" ) ; /**
 * Returns temporary file path of edited document.
 */ export function getDirtyFile ( document ) { var dirtyFilePath = path . normalize ( path . join ( os . tmpdir ( ) , "vscodemintdirty.mint" ) ) ; fs . writeFileSync ( dirtyFilePath , document . getText ( ) ) ; return dirtyFilePath ; } export function createAndShowOutputWindow ( ) { var channel = vscode . window . createOutputChannel ( "mint" ) ; channel . show ( ) ; return channel ; } param subcommand param description export function runMintCommandAsTask ( subcommand , description ) { return vscode . tasks . executeTask ( new vscode . Task ( { command : "" , type : "" } , vscode . TaskScope . Workspace , description , "mint" , new vscode . ShellExecution ( `mint ${ subcommand }` ) ) ) ; } param seconds export function promiseSeconds ( seconds ) { return new Promise ( ( res ) => { setTimeout ( res , 1000 * seconds ) ; } ) ; }