import { promisified } from './tauri' import { BaseDirectory } from './fs' /** * @name appDir * @description Returns the path to the suggested directory for your app config files. * @return {Promise} */ async function appDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.App }) } /** * @name audioDir * @description Returns the path to the user's audio directory. * @return {Promise} */ async function audioDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Audio }) } /** * @name cacheDir * @description Returns the path to the user's cache directory. * @return {Promise} */ async function cacheDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Cache }) } /** * @name configDir * @description Returns the path to the user's config directory. * @return {Promise} */ async function configDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Config }) } /** * @name dataDir * @description Returns the path to the user's data directory. * @return {Promise} */ async function dataDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Data }) } /** * @name desktopDir * @description Returns the path to the user's desktop directory. * @return {Promise} */ async function desktopDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Desktop }) } /** * @name documentDir * @description Returns the path to the user's document directory. * @return {Promise} */ async function documentDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Document }) } /** * @name downloadDir * @description Returns the path to the user's download directory. * @return {Promise} */ async function downloadDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Download }) } /** * @name executableDir * @description Returns the path to the user's executable directory. * @return {Promise} */ async function executableDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Executable }) } /** * @name fontDir * @description Returns the path to the user's font directory. * @return {Promise} */ async function fontDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Font }) } /** * @name homeDir * @description Returns the path to the user's home directory. * @return {Promise} */ async function homeDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Home }) } /** * @name localDataDir * @description Returns the path to the user's local data directory. * @return {Promise} */ async function localDataDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.LocalData }) } /** * @name pictureDir * @description Returns the path to the user's picture directory. * @return {Promise} */ async function pictureDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Picture }) } /** * @name publicDir * @description Returns the path to the user's public directory. * @return {Promise} */ async function publicDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Public }) } /** * @name resourceDir * @description Returns the path to the user's resource directory. * @return {Promise} */ async function resourceDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Resource }) } /** * @name runtimeDir * @descriptionReturns Returns the path to the user's runtime directory. * @return {Promise} */ async function runtimeDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Runtime }) } /** * @name templateDir * @descriptionReturns Returns the path to the user's template directory. * @return {Promise} */ async function templateDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Template }) } /** * @name videoDir * @descriptionReturns Returns the path to the user's video dir. * @return {Promise} */ async function videoDir(): Promise { return await promisified({ cmd: 'resolvePath', path: '', directory: BaseDirectory.Video }) } /** * @name resolvePath * @descriptionReturns Resolves the path with the optional base directory. * @return {Promise} */ async function resolvePath( path: string, directory: BaseDirectory ): Promise { return await promisified({ cmd: 'resolvePath', path, directory }) } export { appDir, audioDir, cacheDir, configDir, dataDir, desktopDir, documentDir, downloadDir, executableDir, fontDir, homeDir, localDataDir, pictureDir, publicDir, resourceDir, runtimeDir, templateDir, videoDir, resolvePath }