import { SaveGame } from 'satisfactory-json' ; import { SaveFileWriter , SaveGameSaving } from '../core/SaveGameSaving' ; import { saveFileToFilesystem } from './saveFile' ; class DesktopFileWriter implements SaveFileWriter { writeFile ( saveGame , filepath , asJson , progressCallback , errorCallback , successCallback ) { saveFileToFilesystem ( saveGame , filepath , asJson , ( err , progress , success ) => { if ( err ) { errorCallback ( err ) ; return ; } if ( progress ) { progressCallback ( progress ) ; return ; } if ( success ) { successCallback ( ) ; } } ) ; } } export function saveFileAndShowProgress ( vue , path , asJson , asZip ) { new SaveGameSaving ( vue , new DesktopFileWriter ( ) ) . saveSaveGame ( window . data , path , asJson ) ; }